µEvLoop
A fast and lightweight event loop aimed at embedded platforms in C99.
event-loop.h
Go to the documentation of this file.
1 
5 #ifndef UEL_EVENT_LOOP_H
6 #define UEL_EVENT_LOOP_H
7 
12 
20 typedef struct uel_evloop uel_evloop_t;
21 struct uel_evloop{
22  uel_syspools_t *pools;
23  uel_sysqueues_t *queues;
24  uel_llist_t observers;
25 };
26 
33 void uel_evloop_init(
34  uel_evloop_t *event_loop,
35  uel_syspools_t *pools,
36  uel_sysqueues_t *queues
37 );
38 
49 void uel_evloop_run(uel_evloop_t *event_loop);
50 
58  uel_evloop_t *event_loop,
59  uel_closure_t *closure,
60  void *value
61 );
62 
71 uel_event_t *uel_evloop_observe(
72  uel_evloop_t *event_loop,
73  volatile uintptr_t *condition_var,
74  uel_closure_t *closure
75 );
76 
86 uel_event_t *uel_evloop_observe_once(
87  uel_evloop_t *event_loop,
88  volatile uintptr_t *condition_var,
89  uel_closure_t *closure
90 );
91 
92 #endif /* end of include guard: UEL_EVENT_LOOP_H */
linked-list.h
Defines a simple implementation of linked lists and functions to manipulate it.
uel_evloop_run
void uel_evloop_run(uel_evloop_t *event_loop)
Triggers a runloop.
uel_evloop_init
void uel_evloop_init(uel_evloop_t *event_loop, uel_syspools_t *pools, uel_sysqueues_t *queues)
Initialises an event loop.
uel_evloop::pools
uel_syspools_t * pools
Reference to the system's pools.
Definition: event-loop.h:22
closure.h
Defines closures, objects that bind functions to creating and calling contexts.
uel_evloop::queues
uel_sysqueues_t * queues
Reference to the system's queues.
Definition: event-loop.h:23
uel_evloop_observe
uel_event_t * uel_evloop_observe(uel_evloop_t *event_loop, volatile uintptr_t *condition_var, uel_closure_t *closure)
Observes a value and reacts to changes in it.
uel_evloop::observers
uel_llist_t observers
Stores references to values to be observed.
Definition: event-loop.h:24
uel_evloop_enqueue_closure
void uel_evloop_enqueue_closure(uel_evloop_t *event_loop, uel_closure_t *closure, void *value)
Enqueues a closure to be invoked.
uel_evloop
The event loop object.
Definition: event-loop.h:21
uel_evloop_observe_once
uel_event_t * uel_evloop_observe_once(uel_evloop_t *event_loop, volatile uintptr_t *condition_var, uel_closure_t *closure)
Observes a value and reacts once to changes in it. Afterwards, the observer will be destroyed.
system-queues.h
A container for the system's internal queues.
system-pools.h
A container for the system's internal pools.