|
Veethree D7 SDK
|
The event_queue class.
This class implements a queue intended for storing vsdk::io::event objects (as std::shared_ptr). You can install multiple handlers for the same event source and type.
Event objects will handled in background as soon as possible once they are added to the queue. Once an event is processed by all its handlers, it is removed from queue.
#include <io_event_queue.h>
Public Member Functions | |
| event_queue (const event_queue &eq)=delete | |
| event_queue (event_queue &&eq) noexcept=delete | |
| event_queue & | operator= (const event_queue &)=delete |
| event_queue & | operator= (event_queue &&eq) noexcept=delete |
| event_handler_id | add_handler (event_source evt_src, event_type evt_type, event_handler evt_handler) |
| Add an event handler for a specific type of event. | |
| bool | remove_handler (event_handler_id id) |
| Remove an event handler from the event queue. | |
| void | remove_all_handlers () |
| Remove all handlers for this queue. | |
| void | push_event (std::shared_ptr< event > evt) |
| Push an event into the queue. | |
| void | flush_events () |
| Flush all events from the queue. Handlers will not be called for existing items in the queue. | |
The event_queue class.
This class implements a queue intended for storing vsdk::io::event objects (as std::shared_ptr). You can install multiple handlers for the same event source and type.
Event objects will handled in background as soon as possible once they are added to the queue. Once an event is processed by all its handlers, it is removed from queue.
| event_handler_id vsdk::io::event_queue::add_handler | ( | event_source | evt_src, |
| event_type | evt_type, | ||
| event_handler | evt_handler ) |
Add an event handler for a specific type of event.
See also the event_notification interface.
| evt_src | The event source. See vsdk::io::event_source. |
| evt_type | The event type. See vsdk::io::event_type. |
| evt_handler | The event handler. See vsdk::io::event_handler. |
| void vsdk::io::event_queue::push_event | ( | std::shared_ptr< event > | evt | ) |
Push an event into the queue.
| evt | A std::shared_ptr<event> object. The object in the std::shared_ptr must implement vsdk::io::event interface. |
| bool vsdk::io::event_queue::remove_handler | ( | event_handler_id | id | ) |
Remove an event handler from the event queue.
| id | The event handler to be removed. See vsdk::io::event_handler_id. |