81 #define RKH_RQ_IS_EMPTY(q) \
82 (rbool_t)(rkh_rq_get_num((RKH_RQ_T *)(q)) == 0)
94 #if RKH_CFG_RQ_SIZEOF_NELEM == 8
96 #elif RKH_CFG_RQ_SIZEOF_NELEM == 16
98 #elif RKH_CFG_RQ_SIZEOF_NELEM == 32
110 RKH_RQ_OK, RKH_RQ_EMPTY, RKH_RQ_FULL
124 typedef struct RKH_QINFO_T
221 #if RKH_CFG_RQ_GET_LWMARK_EN == RKH_ENABLED
230 #if RKH_CFG_RQ_GET_INFO_EN == RKH_ENABLED
void rkh_rq_put_lifo(RKH_RQ_T *q, const void *pe)
Puts an element on a queue in a LIFO manner. The element is queued by reference, not by copy...
rui8_t RKH_RQNE_T
This data type defines the maximum number of elements that any queue can contain. ...
void * rkh_rq_get(RKH_RQ_T *q)
Get and remove an element from a queue.
Describes the SMA (active object in UML).
void rkh_rq_init(RKH_RQ_T *q, const void **sstart, RKH_RQNE_T ssize, const struct RKH_SMA_T *sma)
Initializes the previously allocated queue data structure RKH_RQ_T.
Defines the data structure used to maintain information about the queue.
const struct RKH_SMA_T * sma
Points to the associated SMA (a.k.a Active Object) that receives the enqueued events.
void rkh_rq_deplete(RKH_RQ_T *q)
Depletes a queue. Empties the contents of the queue and eliminates all stored elements.
RKH_RQNE_T rkh_rq_get_num(RKH_RQ_T *q)
Returns the number of elements currently in the queue.
RKH_RQNE_T rkh_rq_get_lwm(RKH_RQ_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 ** pout
Points to the free next place in the storage area.
RKH_RQNE_T qty
Number of elements currently in the queue.
void rkh_rq_put_fifo(RKH_RQ_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 rkh_rq_clear_info(RKH_RQ_T *q)
Clear performance information for a particular queue.
RKH_RQNE_T nelems
Number of elements.
void ** pin
Points to the next place of queued item.
RKH_RQI_T rqi
Performance information. This member is optional, thus it could be eliminated in compile-time with RK...
RKH_RQNE_T nmin
Minimum number of free elements ever in this queue. The nmin low-watermark provides valuable empirica...
RKH_RQCODE_T
Return codes from queue operations.
const void ** pstart
Points to beginning of the queue storage area.
Defines the data structure into which the performance information for queues is stored.
ruint rkh_rq_read(RKH_RQ_T *q, void *pe)
Read an element from a queue without remove it.
void ** pend
Points to the end of the queue storage area.
rbool_t rkh_rq_is_full(RKH_RQ_T *q)
This function query the queue.
Defines the data types that uses RKH.
void rkh_rq_get_info(RKH_RQ_T *q, RKH_RQI_T *pqi)
Retrieves performance information for a particular queue.