![]() |
Embedded Template Library
1.0
|
#include <delegate_service.h>
Public Member Functions | |
delegate_service () | |
template<const size_t ID> | |
void | register_delegate (etl::delegate< void(size_t)> callback) |
void | register_delegate (const size_t id, etl::delegate< void(size_t)> callback) |
void | register_unhandled_delegate (etl::delegate< void(size_t)> callback) |
template<const size_t ID> | |
void | call () |
void | call (const size_t id) |
An indexed delegate service.
RANGE | The number of delegates to handle. |
OFFSET | The lowest delegate id value. The delegate ids must range between OFFSET and OFFSET + RANGE - 1. |
|
inline |
Reset the delegate service. Sets all delegates to the internal default.
|
inline |
Executes the delegate function for the index. Compile time assert if the id is out of range.
ID | The id of the delegate. |
|
inline |
Executes the delegate function for the index.
id | Id of the delegate. |
|
inline |
Registers a delegate for the specified id. No action if the id is out of range.
id | Id of the delegate. |
delegate | Reference to the delegate. |
|
inline |
Registers a delegate for the specified id. Compile time assert if the id is out of range.
ID | The id of the delegate. |
delegate | Reference to the delegate. |
|
inline |
Registers an alternative delegate for unhandled ids.
delegate | A reference to the user supplied 'unhandled' delegate. |