poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
PSC_Queue Class Reference

A simple queue of objects. More...

#include <poser/core/queue.h>

Public Member Functions

PSC_QueuePSC_Queue_create (void)
 PSC_Queue default constructor.
 
void PSC_Queue_enqueue (PSC_Queue *self, void *obj, void(*deleter)(void *))
 Enqueue an object.
 
void * PSC_Queue_dequeue (PSC_Queue *self)
 Dequeue the oldest object.
 
void PSC_Queue_destroy (PSC_Queue *self)
 PSC_Queue destructor.
 

Detailed Description

A simple queue of objects.

Member Function Documentation

◆ PSC_Queue_create()

PSC_Queue * PSC_Queue_create ( void  )

PSC_Queue default constructor.

Creates a new PSC_Queue

Returns
a newly created PSC_Queue

◆ PSC_Queue_dequeue()

void * PSC_Queue_dequeue ( PSC_Queue self)

Dequeue the oldest object.

The object will not be destroyed, so it can be used by the caller.

Parameters
selfthe PSC_Queue
Returns
the dequeued object, or NULL if the PSC_Queue was empty

◆ PSC_Queue_destroy()

void PSC_Queue_destroy ( PSC_Queue self)

PSC_Queue destructor.

All still queued objects that have a deleter attached are also destroyed.

Parameters
selfthe PSC_Queue

◆ PSC_Queue_enqueue()

void PSC_Queue_enqueue ( PSC_Queue self,
void *  obj,
void(*)(void *)  deleter 
)

Enqueue an object.

Parameters
selfthe PSC_Queue
objthe object to enqueue
deleteroptional function to destroy the object

The documentation for this class was generated from the following file: