14 typedef struct _Queue {
20 int32_t (*push) (
struct _Queue*, Item);
24 int32_t (*front) (
struct _Queue*, Item*);
28 int32_t (*back) (
struct _Queue*, Item*);
32 int32_t (*pop) (
struct _Queue*);
36 int32_t (*size) (
struct _Queue*);
40 int32_t (*set_destroy) (
struct _Queue*, void (*) (Item));
int32_t QueueSize(Queue *self)
Return the number of stored items.
int32_t QueueFront(Queue *self, Item *pItem)
Retrieve item from the head of the queue.
QueueData * pData
The container private information.
int32_t QueueInit(Queue **ppObj)
The constructor for Queue.
int32_t QueuePop(Queue *self)
Delete item from top of the queue.
The implementation for queue.
struct _QueueData QueueData
QueueData is the data type for the container private information.
int32_t QueueSetDestroy(Queue *self, void(*pFunc)(Item))
Set the custom item resource clean method.
void QueueDeinit(Queue **ppObj)
The destructor for Queue.
int32_t QueuePush(Queue *self, Item item)
Insert an item to the tail of the queue.
int32_t QueueBack(Queue *self, Item *pItem)
Retrieve item from the tail of the queue.