21#define q_init_def(q, sz) q_init(q, sz, 20, FIFO, false)
24#define q_nbRecs q_getCount
25#define q_clean q_flush
68 const size_t size_rec,
const uint16_t nb_recs,
69 const QueueType type,
const bool overwrite);
82 const
size_t size_rec, const uint16_t nb_recs,
83 const
QueueType type, const
bool overwrite,
84 void * const pQDat, const
size_t lenQDat);
105bool __attribute__((nonnull))
q_push(
Queue_t * const pQ, const
void * const record);
116bool __attribute__((nonnull))
q_pop(
Queue_t * const pQ,
void * const record);
128bool __attribute__((nonnull))
q_peek(const
Queue_t * const pQ,
void * const record);
152bool __attribute__((nonnull))
q_peekIdx(const
Queue_t * const pQ,
void * const record, const uint16_t idx);
uint32_t q_sizeof(const Queue_t *const pQ)
get size of queue
Definition cQueue.c:309
enum enumQueueType QueueType
bool q_push(Queue_t *const pQ, const void *const record)
Push record to queue.
Definition cQueue.c:150
bool q_isInitialized(const Queue_t *const pQ)
get initialization state of the queue
Definition cQueue.c:306
void q_kill(Queue_t *const pQ)
Queue destructor: release dynamically allocated queue.
Definition cQueue.c:135
bool q_peek(const Queue_t *const pQ, void *const record)
Peek record from queue.
Definition cQueue.c:214
void * q_init(Queue_t *const pQ, const size_t size_rec, const uint16_t nb_recs, const QueueType type, const bool overwrite)
Queue initialization (using dynamic queue allocation)
Definition cQueue.c:85
bool q_isEmpty(const Queue_t *const pQ)
get emptiness state of the queue
Definition cQueue.c:312
bool q_isFull(const Queue_t *const pQ)
get fullness state of the queue
Definition cQueue.c:315
uint16_t q_getRemainingCount(const Queue_t *const pQ)
get number of records left in the queue
Definition cQueue.c:321
enumQueueType
Queue behavior enumeration (FIFO, LIFO)
Definition cQueue.h:31
@ FIFO
First In First Out behavior.
Definition cQueue.h:32
@ LIFO
Last In First Out behavior.
Definition cQueue.h:33
bool q_peekIdx(const Queue_t *const pQ, void *const record, const uint16_t idx)
Peek record at index from queue.
Definition cQueue.c:269
bool q_peekPrevious(const Queue_t *const pQ, void *const record)
Peek previous record from queue.
Definition cQueue.c:296
void q_flush(Queue_t *const pQ)
Flush queue, restarting from empty queue.
Definition cQueue.c:142
bool q_drop(Queue_t *const pQ)
Drop current record from queue.
Definition cQueue.c:244
bool q_pop(Queue_t *const pQ, void *const record)
Pop record from queue.
Definition cQueue.c:184
uint16_t q_getCount(const Queue_t *const pQ)
get number of records in the queue
Definition cQueue.c:318
void * q_init_static(Queue_t *const pQ, const size_t size_rec, const uint16_t nb_recs, const QueueType type, const bool overwrite, void *const pQDat, const size_t lenQDat)
Queue initialization (using static queue)
Definition cQueue.c:111
Queue type structure holding all variables to handle the queue.
Definition cQueue.h:40
bool ovw
Overwrite previous records when queue is full allowed.
Definition cQueue.h:42
uint16_t cnt
number of records not retrieved from the queue
Definition cQueue.h:51
bool dynamic
Set to true when queue is dynamically allocated.
Definition cQueue.h:43
uint16_t out
number of records pulled from the queue (only for FIFO)
Definition cQueue.h:50
QueueType impl
Queue implementation: FIFO LIFO.
Definition cQueue.h:41
size_t rec_sz
Size of a record.
Definition cQueue.h:45
uint16_t rec_nb
number of records in the queue
Definition cQueue.h:46
uint16_t init
set to QUEUE_INITIALIZED after successful init of the queue and reset when killing queue
Definition cQueue.h:52
uint16_t in
number of records pushed into the queue
Definition cQueue.h:49
uint8_t * queue
Queue start pointer (when allocated)
Definition cQueue.h:47
size_t queue_sz
Size of the full queue.
Definition cQueue.h:44