Note! This project has moved to github.com/armmbed/mbed-events
This repository has been superceded
This project has moved to mbed-events
Composable event loops combine the cheap synchronicity of event loops with the composability of preempted threads.
Two modular event queue classes are provided:
- EventLoop - for loops coupled with a c++ managed thread
- EventQueue - for manually managed event queues
The Event class takes advantage of the extensibility of FuncPtr to allow an event to be passed through APIs as a normal function.
More information on composable event loops.
Diff: Event.h
- Revision:
- 17:6d564266850e
- Parent:
- 14:5abf2ccf2dbf
diff -r ff5d48fcce1b -r 6d564266850e Event.h --- a/Event.h Mon Apr 18 09:47:21 2016 -0500 +++ b/Event.h Mon Apr 18 12:51:04 2016 -0500 @@ -97,7 +97,7 @@ * @return True if the event was posted successfully */ bool trigger(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, int ms=-1) { - return _queue->trigger( + return _queue->event_trigger( Binder<void(A0,A1,A2,A3,A4),A0,A1,A2,A3,A4>(_func,a0,a1,a2,a3,a4), _delay, _period, _tolerance, ms); } @@ -218,7 +218,7 @@ * @return True if the event was posted successfully */ bool trigger(A0 a0, A1 a1, A2 a2, A3 a3, int ms=-1) { - return _queue->trigger( + return _queue->event_trigger( Binder<void(A0,A1,A2,A3),A0,A1,A2,A3>(_func,a0,a1,a2,a3), _delay, _period, _tolerance, ms); } @@ -339,7 +339,7 @@ * @return True if the event was posted successfully */ bool trigger(A0 a0, A1 a1, A2 a2, int ms=-1) { - return _queue->trigger( + return _queue->event_trigger( Binder<void(A0,A1,A2),A0,A1,A2>(_func,a0,a1,a2), _delay, _period, _tolerance, ms); } @@ -460,7 +460,7 @@ * @return True if the event was posted successfully */ bool trigger(A0 a0, A1 a1, int ms=-1) { - return _queue->trigger( + return _queue->event_trigger( Binder<void(A0,A1),A0,A1>(_func,a0,a1), _delay, _period, _tolerance, ms); } @@ -581,7 +581,7 @@ * @return True if the event was posted successfully */ bool trigger(A0 a0, int ms=-1) { - return _queue->trigger( + return _queue->event_trigger( Binder<void(A0),A0>(_func,a0), _delay, _period, _tolerance, ms); } @@ -702,7 +702,8 @@ * @return True if the event was posted successfully */ bool trigger(int ms=-1) { - return _queue->trigger(_func, _delay, _period, _tolerance, ms); + return _queue->event_trigger(_func, + _delay, _period, _tolerance, ms); } /** Post the event onto the bound queue