µEvLoop
A fast and lightweight event loop aimed at embedded platforms in C99.
Data Structures | Macros | Functions
system-queues.h File Reference

A container for the system's internal queues. More...

#include "uevloop/system/event.h"
#include "uevloop/config.h"
#include "uevloop/utils/circular-queue.h"
Include dependency graph for system-queues.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uel_sysqueues_t
 A container for the system's internal queues. More...
 

Macros

#define UEL_SYSQUEUES_EVENT_QUEUE_SIZE   (1<<UEL_SYSQUEUES_EVENT_QUEUE_SIZE_LOG2N)
 Unrolls the UEL_SYSQUEUES_EVENT_QUEUE_SIZE_LOG2N value to its power-of-two form.
 
#define UEL_SYSQUEUES_SCHEDULE_QUEUE_SIZE   (1<<UEL_SYSQUEUES_SCHEDULE_QUEUE_SIZE_LOG2N)
 Unrolls the UEL_SYSQUEUES_SCHEDULE_QUEUE_SIZE_LOG2N value to its power-of-two form.
 

Functions

void uel_sysqueues_init (uel_sysqueues_t *queues)
 Initialises a new uel_sysqueues_t. More...
 
void uel_sysqueues_enqueue_event (uel_sysqueues_t *queues, uel_event_t *event)
 Pushes an event into the event queue. More...
 
uel_event_t * uel_sysqueues_get_enqueued_event (uel_sysqueues_t *queues)
 Pops an event from the event queue. More...
 
uintptr_t uel_sysqueues_count_enqueued_events (uel_sysqueues_t *queues)
 Counts the number of elements in the event queue. More...
 
void uel_sysqueues_schedule_event (uel_sysqueues_t *queues, uel_event_t *event)
 Pushes an event into the schedule queue. More...
 
uel_event_t * uel_sysqueues_get_scheduled_event (uel_sysqueues_t *queues)
 Pops an event from the schedule queue. More...
 
uintptr_t uel_sysqueues_count_scheduled_events (uel_sysqueues_t *queues)
 Counts the number of elements in the schedule queue. More...
 

Detailed Description

A container for the system's internal queues.

Function Documentation

◆ uel_sysqueues_count_enqueued_events()

uintptr_t uel_sysqueues_count_enqueued_events ( uel_sysqueues_t *  queues)

Counts the number of elements in the event queue.

Parameters
queuesThe uel_sysqueues_t instance whose event queue's elements should be counted
Returns
The number of elements in the queue

◆ uel_sysqueues_count_scheduled_events()

uintptr_t uel_sysqueues_count_scheduled_events ( uel_sysqueues_t *  queues)

Counts the number of elements in the schedule queue.

Parameters
queuesThe uel_sysqueues_t instance whose schedule queue's elements should be counted
Returns
The number of elements in the queue

◆ uel_sysqueues_enqueue_event()

void uel_sysqueues_enqueue_event ( uel_sysqueues_t *  queues,
uel_event_t *  event 
)

Pushes an event into the event queue.

This makes the event ready for colletion e processing by the event loop.

Parameters
queuesThe uel_sysqueues_t instance to be initialised
eventThe event to be enqueued

◆ uel_sysqueues_get_enqueued_event()

uel_event_t* uel_sysqueues_get_enqueued_event ( uel_sysqueues_t *  queues)

Pops an event from the event queue.

Parameters
queuesThe uel_sysqueues_t instance from whose event queue the event must be popped.
Returns
The popped event's address. If the queue is empty, returns NULL.

◆ uel_sysqueues_get_scheduled_event()

uel_event_t* uel_sysqueues_get_scheduled_event ( uel_sysqueues_t *  queues)

Pops an event from the schedule queue.

Parameters
queuesThe uel_sysqueues_t instance from whose schedule queue the event must be popped.
Returns
The popped event's address. If the queue is empty, returns NULL.

◆ uel_sysqueues_init()

void uel_sysqueues_init ( uel_sysqueues_t *  queues)

Initialises a new uel_sysqueues_t.

Parameters
queuesThe uel_sysqueues_t instance to be initialised

◆ uel_sysqueues_schedule_event()

void uel_sysqueues_schedule_event ( uel_sysqueues_t *  queues,
uel_event_t *  event 
)

Pushes an event into the schedule queue.

This makes the event ready for collection and scheduling by the scheduler.

Parameters
queuesThe uel_sysqueues_t instance to be initialised
eventThe event to be scheduled