Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
EventQueue Class Reference
Flexible queue for managing events. More...
#include <EventQueue.h>
Inherited by EventLoop.
Public Member Functions | |
| EventQueue (unsigned event_count=32, unsigned event_context=0, unsigned char *event_pointer=NULL) | |
| Create an event queue. | |
| ~EventQueue () | |
| Clean up event queue. | |
| void | dispatch (int ms=-1) |
| Dispatch pending events. | |
| unsigned | get_tick () |
| Get current tick of the event queue. | |
| bool | past_tick (unsigned tick) |
| Determine if tick has been passed. | |
| template<typename F , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 > | |
| bool | trigger (F func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) |
| Immediately post an event to the queue. | |
| template<typename F , typename A0 , typename A1 , typename A2 , typename A3 > | |
| bool | trigger (F func, A0 a0, A1 a1, A2 a2, A3 a3) |
| Immediately post an event to the queue. | |
| template<typename F , typename A0 , typename A1 , typename A2 > | |
| bool | trigger (F func, A0 a0, A1 a1, A2 a2) |
| Immediately post an event to the queue. | |
| template<typename F , typename A0 , typename A1 > | |
| bool | trigger (F func, A0 a0, A1 a1) |
| Immediately post an event to the queue. | |
| template<typename F , typename A0 > | |
| bool | trigger (F func, A0 a0) |
| Immediately post an event to the queue. | |
| template<typename F > | |
| bool | trigger (F func) |
| Immediately post an event to the queue. | |
| template<typename F , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 > | |
| bool | trigger_in (F func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, int ms) |
| Post an event after a specified time. | |
| template<typename F , typename A0 , typename A1 , typename A2 , typename A3 > | |
| bool | trigger_in (F func, A0 a0, A1 a1, A2 a2, A3 a3, int ms) |
| Post an event after a specified time. | |
| template<typename F , typename A0 , typename A1 , typename A2 > | |
| bool | trigger_in (F func, A0 a0, A1 a1, A2 a2, int ms) |
| Post an event after a specified time. | |
| template<typename F , typename A0 , typename A1 > | |
| bool | trigger_in (F func, A0 a0, A1 a1, int ms) |
| Post an event after a specified time. | |
| template<typename F , typename A0 > | |
| bool | trigger_in (F func, A0 a0, int ms) |
| Post an event after a specified time. | |
| template<typename F > | |
| bool | trigger_in (F func, int ms) |
| Post an event after a specified time. | |
| template<typename F , typename A0 , typename A1 , typename A2 , typename A3 , typename A4 > | |
| bool | trigger_every (F func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, int ms) |
| Post an event periodically. | |
| template<typename F , typename A0 , typename A1 , typename A2 , typename A3 > | |
| bool | trigger_every (F func, A0 a0, A1 a1, A2 a2, A3 a3, int ms) |
| Post an event periodically. | |
| template<typename F , typename A0 , typename A1 , typename A2 > | |
| bool | trigger_every (F func, A0 a0, A1 a1, A2 a2, int ms) |
| Post an event periodically. | |
| template<typename F , typename A0 , typename A1 > | |
| bool | trigger_every (F func, A0 a0, A1 a1, int ms) |
| Post an event periodically. | |
| template<typename F , typename A0 > | |
| bool | trigger_every (F func, A0 a0, int ms) |
| Post an event periodically. | |
| template<typename F > | |
| bool | trigger_every (F func, int ms) |
| Post an event periodically. | |
Detailed Description
Flexible queue for managing events.
Definition at line 16 of file EventQueue.h.
Constructor & Destructor Documentation
| EventQueue | ( | unsigned | event_count = 32, |
| unsigned | event_context = 0, |
||
| unsigned char * | event_pointer = NULL |
||
| ) |
Create an event queue.
- Parameters:
-
event_count Number of events to allow enqueueing at once (default: 32) event_context Max size of arguments passed with an event (default: 0) event_pointer Pointer to memory area to be used for events (default: NULL)
Definition at line 20 of file EventQueue.cpp.
| ~EventQueue | ( | ) |
Clean up event queue.
Definition at line 48 of file EventQueue.cpp.
Member Function Documentation
| void dispatch | ( | int | ms = -1 ) |
Dispatch pending events.
- Parameters:
-
ms Time to wait for events in milliseconds, 0 indicates to return immediately if no events are pending
Definition at line 65 of file EventQueue.cpp.
| unsigned get_tick | ( | ) |
Get current tick of the event queue.
- Returns:
- Number of milliseconds since the queue was instantiated, this count intentionally overflows to 0 after 2^32-1
Definition at line 52 of file EventQueue.cpp.
| bool past_tick | ( | unsigned | tick ) |
Determine if tick has been passed.
- Parameters:
-
Tick to check True if tick has been passed
Definition at line 56 of file EventQueue.cpp.
| bool trigger | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| A3 | a3, | ||
| A4 | a4 | ||
| ) |
Immediately post an event to the queue.
Definition at line 111 of file EventQueue.h.
| bool trigger | ( | F | func, |
| A0 | a0 | ||
| ) |
Immediately post an event to the queue.
Definition at line 179 of file EventQueue.h.
| bool trigger | ( | F | func ) |
Immediately post an event to the queue.
Definition at line 196 of file EventQueue.h.
| bool trigger | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2 | ||
| ) |
Immediately post an event to the queue.
Definition at line 145 of file EventQueue.h.
| bool trigger | ( | F | func, |
| A0 | a0, | ||
| A1 | a1 | ||
| ) |
Immediately post an event to the queue.
Definition at line 162 of file EventQueue.h.
| bool trigger | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| A3 | a3 | ||
| ) |
Immediately post an event to the queue.
Definition at line 128 of file EventQueue.h.
| bool trigger_every | ( | F | func, |
| int | ms | ||
| ) |
Post an event periodically.
- Parameters:
-
ms Delay in milliseconds
Definition at line 412 of file EventQueue.h.
| bool trigger_every | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| A3 | a3, | ||
| A4 | a4, | ||
| int | ms | ||
| ) |
Post an event periodically.
- Parameters:
-
ms Delay in milliseconds
Definition at line 322 of file EventQueue.h.
| bool trigger_every | ( | F | func, |
| A0 | a0, | ||
| int | ms | ||
| ) |
Post an event periodically.
- Parameters:
-
ms Delay in milliseconds
Definition at line 394 of file EventQueue.h.
| bool trigger_every | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| int | ms | ||
| ) |
Post an event periodically.
- Parameters:
-
ms Delay in milliseconds
Definition at line 358 of file EventQueue.h.
| bool trigger_every | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| int | ms | ||
| ) |
Post an event periodically.
- Parameters:
-
ms Delay in milliseconds
Definition at line 376 of file EventQueue.h.
| bool trigger_every | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| A3 | a3, | ||
| int | ms | ||
| ) |
Post an event periodically.
- Parameters:
-
ms Delay in milliseconds
Definition at line 340 of file EventQueue.h.
| bool trigger_in | ( | F | func, |
| int | ms | ||
| ) |
Post an event after a specified time.
- Parameters:
-
ms Delay in milliseconds
Definition at line 304 of file EventQueue.h.
| bool trigger_in | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| A3 | a3, | ||
| int | ms | ||
| ) |
Post an event after a specified time.
- Parameters:
-
ms Delay in milliseconds
Definition at line 232 of file EventQueue.h.
| bool trigger_in | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| int | ms | ||
| ) |
Post an event after a specified time.
- Parameters:
-
ms Delay in milliseconds
Definition at line 250 of file EventQueue.h.
| bool trigger_in | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| A2 | a2, | ||
| A3 | a3, | ||
| A4 | a4, | ||
| int | ms | ||
| ) |
Post an event after a specified time.
- Parameters:
-
ms Delay in milliseconds
Definition at line 214 of file EventQueue.h.
| bool trigger_in | ( | F | func, |
| A0 | a0, | ||
| A1 | a1, | ||
| int | ms | ||
| ) |
Post an event after a specified time.
- Parameters:
-
ms Delay in milliseconds
Definition at line 268 of file EventQueue.h.
| bool trigger_in | ( | F | func, |
| A0 | a0, | ||
| int | ms | ||
| ) |
Post an event after a specified time.
- Parameters:
-
ms Delay in milliseconds
Definition at line 286 of file EventQueue.h.
Generated on Wed Jul 13 2022 19:57:07 by
1.7.2