Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzc_queue.h File Reference

Queue (First-In-First-Out). More...

Functions

kzsError kzcQueueCreate (const struct KzcMemoryManager *memoryManager, struct KzcQueue **out_queue)
 Creates a new initially empty queue. More...
 
kzsError kzcQueueDelete (struct KzcQueue *queue)
 Frees the memory allocated for the queue. More...
 
kzsError kzcQueueAdd (struct KzcQueue *queue, void *element)
 Add the specified element to the queue. More...
 
kzsError kzcQueueReceive (struct KzcQueue *queue, void **out_element)
 Gets and removes the first element from the queue. More...
 
kzsError kzcQueuePeek (const struct KzcQueue *queue, void **out_element)
 Gets the first element from the queue without removing it. More...
 
kzUint kzcQueueGetSize (const struct KzcQueue *queue)
 Returns the number of elements in the queue. More...
 
kzBool kzcQueueIsEmpty (const struct KzcQueue *queue)
 Checks if the queue is empty or not. More...
 
kzsError kzcQueueClear (struct KzcQueue *queue)
 Clears the queue by removing all items from it. More...
 

Detailed Description

Queue (First-In-First-Out).

Copyright 2008-2019 by Rightware. All rights reserved.

Function Documentation

kzsError kzcQueueCreate ( const struct KzcMemoryManager memoryManager,
struct KzcQueue **  out_queue 
)

Creates a new initially empty queue.

kzsError kzcQueueDelete ( struct KzcQueue queue)

Frees the memory allocated for the queue.

kzsError kzcQueueAdd ( struct KzcQueue queue,
void element 
)

Add the specified element to the queue.

kzsError kzcQueueReceive ( struct KzcQueue queue,
void **  out_element 
)

Gets and removes the first element from the queue.

Returns error if the queue is empty.

kzsError kzcQueuePeek ( const struct KzcQueue queue,
void **  out_element 
)

Gets the first element from the queue without removing it.

Returns error if the queue is empty.

kzUint kzcQueueGetSize ( const struct KzcQueue queue)

Returns the number of elements in the queue.

kzBool kzcQueueIsEmpty ( const struct KzcQueue queue)

Checks if the queue is empty or not.

kzsError kzcQueueClear ( struct KzcQueue queue)

Clears the queue by removing all items from it.