57 #ifndef __RKHQUEUE_H__
58 #define __RKHQUEUE_H__
81 #define RKH_QUEUE_IS_EMPTY(q) \
82 (rbool_t)(rkh_queue_get_num((RKH_QUEUE_T *)(q)) == 0)
94 #if RKH_CFG_QUE_SIZEOF_NELEM == 8
96 #elif RKH_CFG_QUE_SIZEOF_NELEM == 16
98 #elif RKH_CFG_QUE_SIZEOF_NELEM == 32
110 RKH_QUE_OK, RKH_QUE_EMPTY, RKH_QUE_FULL
124 typedef struct RKH_QINFO_T
221 #if RKH_CFG_QUE_GET_LWMARK_EN == RKH_ENABLED
230 #if RKH_CFG_QUE_GET_INFO_EN == RKH_ENABLED
RKH_QUENE_T rkh_queue_get_num(RKH_QUEUE_T *q)
Returns the number of elements currently in the queue.
const void ** pstart
Points to beginning of the queue storage area.
Describes the SMA (active object in UML).
rui8_t RKH_QUENE_T
This data type defines the maximum number of elements that any queue can contain. ...
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.
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.
RKH_QUENE_T nmin
Minimum number of free elements ever in this queue. The nmin low-watermark provides valuable empirica...
Defines the data structure used to maintain information about the queue.
RKH_QUENE_T qty
Number of elements currently in the queue.
rbool_t rkh_queue_is_full(RKH_QUEUE_T *q)
This function query the queue.
Defines the data structure into which the performance information for queues is stored.
const struct RKH_SMA_T * sma
Points to the associated SMA (a.k.a Active Object) that receives the enqueued events.
void rkh_queue_clear_info(RKH_QUEUE_T *q)
Clear performance information for a particular queue.
RKH_QUECODE_T
Return codes from queue operations.
void rkh_queue_get_info(RKH_QUEUE_T *q, RKH_QUEI_T *pqi)
Retrieves performance information for a particular queue.
void rkh_queue_deplete(RKH_QUEUE_T *q)
Depletes a queue. Empties the contents of the queue and eliminates all stored elements.
RKH_QUENE_T nelems
Number of elements.
RKH_QUEI_T rqi
Performance information. This member is optional, thus it could be eliminated in compile-time with RK...
void * rkh_queue_get(RKH_QUEUE_T *q)
Get and remove an element from a queue.
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...
void ** pend
Points to the end of the queue storage area.
ruint rkh_queue_read(RKH_QUEUE_T *q, void *pe)
Read an element from a queue without remove it.
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...
void ** pout
Points to the free next place in the storage area.
void ** pin
Points to the next place of queued item.
Defines the data types that uses RKH.