RKH
|
Files | |
file | rkhqueue.h |
Specifies the interface of the queue services. | |
Data Structures | |
struct | RKH_QUEUE_T |
Defines the data structure used to maintain information about the queue. More... | |
Macros | |
#define | RKH_QUEUE_IS_EMPTY(q) (rbool_t)(rkh_queue_get_num((RKH_QUEUE_T *)(q)) == 0) |
This macro query the queue. More... | |
Functions | |
void | rkh_queue_init (RKH_QUEUE_T *q, const void **sstart, RKH_QUENE_T ssize, void *sma) |
Initializes the previously allocated queue data structure RKH_QUEUE_T. More... | |
rbool_t | rkh_queue_is_full (RKH_QUEUE_T *q) |
This function query the queue. More... | |
RKH_QUENE_T | rkh_queue_get_num (RKH_QUEUE_T *q) |
Returns the number of elements currently in the queue. More... | |
RKH_QUENE_T | rkh_queue_get_lwm (RKH_QUEUE_T *q) |
This function returns the lowest number of free elements ever present in the pool. This number provides valuable empirical data for proper sizing of the queue. More... | |
void * | rkh_queue_get (RKH_QUEUE_T *q) |
Get and remove an element from a queue. More... | |
void | rkh_queue_put_fifo (RKH_QUEUE_T *q, const void *pe) |
Puts an element on a queue in a FIFO manner. The element is queued by reference, not by copy. More... | |
void | rkh_queue_put_lifo (RKH_QUEUE_T *q, const void *pe) |
Puts an element on a queue in a LIFO manner. The element is queued by reference, not by copy. More... | |
void | rkh_queue_deplete (RKH_QUEUE_T *q) |
Depletes a queue. Empties the contents of the queue and eliminates all stored elements. More... | |
ruint | rkh_queue_read (RKH_QUEUE_T *q, void *pe) |
Read an element from a queue without remove it. More... | |
void | rkh_queue_get_info (RKH_QUEUE_T *q, RKH_QUEI_T *pqi) |
Retrieves performance information for a particular queue. More... | |
void | rkh_queue_clear_info (RKH_QUEUE_T *q) |
Clear performance information for a particular queue. More... | |
#define RKH_QUEUE_IS_EMPTY | ( | q | ) | (rbool_t)(rkh_queue_get_num((RKH_QUEUE_T *)(q)) == 0) |
This macro query the queue.
[in] | q | pointer to previously created queue. |
Definition at line 83 of file rkhqueue.h.
void rkh_queue_init | ( | RKH_QUEUE_T * | q, |
const void ** | sstart, | ||
RKH_QUENE_T | ssize, | ||
void * | sma | ||
) |
Initializes the previously allocated queue data structure RKH_QUEUE_T.
A queue is declared with the RKH_QUEUE_T data type and is defined with the rkh_queue_init() service. The total number of messages is calculated from the specified message size (pointer size) and the total number of bytes in the queue. Note that if the total number of bytes specified in the queue's memory area is not evenly divisible by the specified message size, the remaining bytes in the memory area are not used.
[in] | q | pointer to previously allocated queue structure. |
[in] | sstart | storage start. Pointer to an array of pointers that holds the elements. This array must be declared as an array of void pointers. |
[in] | ssize | storage size [in the units of void pointers]. |
[in] | sma | pointer to associated SMA that receives the enqueued events. If sma is set to NULL they never block. When using a queue to store deferred events the sma parameter must be set to NULL. |
rbool_t rkh_queue_is_full | ( | RKH_QUEUE_T * | q | ) |
This function query the queue.
[in] | q | pointer to previously created queue. |
RKH_QUENE_T rkh_queue_get_num | ( | RKH_QUEUE_T * | q | ) |
Returns the number of elements currently in the queue.
[in] | q | pointer to previously created queue. |
RKH_QUENE_T rkh_queue_get_lwm | ( | RKH_QUEUE_T * | q | ) |
This function returns the lowest number of free elements ever present in the pool. This number provides valuable empirical data for proper sizing of the queue.
[in] | q | pointer to previously created queue. |
void* rkh_queue_get | ( | RKH_QUEUE_T * | q | ) |
Get and remove an element from a queue.
[in] | q | pointer to previously created queue from which the elements are received. |
void rkh_queue_put_fifo | ( | RKH_QUEUE_T * | q, |
const void * | pe | ||
) |
Puts an element on a queue in a FIFO manner. The element is queued by reference, not by copy.
[in] | q | pointer to previously created queue into which the element is deposited. |
[in] | pe | pointer-sized variable and is application specific. |
void rkh_queue_put_lifo | ( | RKH_QUEUE_T * | q, |
const void * | pe | ||
) |
Puts an element on a queue in a LIFO manner. The element is queued by reference, not by copy.
[in] | q | pointer to previously created queue into which the element is deposited. |
[in] | pe | pointer-sized variable and is application specific. |
void rkh_queue_deplete | ( | RKH_QUEUE_T * | q | ) |
Depletes a queue. Empties the contents of the queue and eliminates all stored elements.
[in] | q | pointer to previously created queue. |
ruint rkh_queue_read | ( | RKH_QUEUE_T * | q, |
void * | pe | ||
) |
Read an element from a queue without remove it.
[in] | q | pointer to previously created queue from which the elements are received. |
[in] | pe | pointer to the buffer into which the received item will be copied. |
void rkh_queue_get_info | ( | RKH_QUEUE_T * | q, |
RKH_QUEI_T * | pqi | ||
) |
Retrieves performance information for a particular queue.
The user application must allocate an RKH_QUEI_T data structure used to receive data. The performance information is available during run-time for each of the RKH services. This can be useful in determining whether the application is performing properly, as well as helping to optimize the application. This information provides a "snapshot" a particular instant in time, i.e., when the service is invoked.
[in] | q | pointer to previously created queue. |
[in] | pqi | pointer to the buffer into which the performance information will be copied. |
void rkh_queue_clear_info | ( | RKH_QUEUE_T * | q | ) |
Clear performance information for a particular queue.
[in] | q | pointer to previously created queue. |