Embedded Template Library 1.0
|
#include <delegate_service.h>
Public Types | |
typedef etl::delegate< void(size_t)> | delegate_type |
Public Member Functions | |
delegate_service () | |
template<size_t Id> | |
void | register_delegate (delegate_type callback) |
void | register_delegate (size_t id, delegate_type callback) |
void | register_unhandled_delegate (delegate_type callback) |
template<size_t Id> | |
void | call () const |
void | call (const size_t id) const |
An indexed delegate service.
Range | The number of delegates to handle. |
Offset | The lowest delegate id value. |
Delegates | Pointer to an array of delegate pointers. The delegate ids must range between Offset and Offset + Range - 1. 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 |
Default constructor. 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. Compile time assert if the id is out of range.
Id | The id of the delegate. |
delegate | Reference to 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 an alternative delegate for unhandled ids.
delegate | A reference to the user supplied 'unhandled' delegate. |