Loading...
Searching...
No Matches
etl::delegate_service< Range, Offset > Class Template Reference

`#include <delegate_service.h>`

## Public Types

typedef etl::delegate< void(size_t)> | delegate_type

## Public Member Functions

| delegate_service ()
| delegate_service (const delegate_service &) ETL_DELETE
delegate_service & | operator= (const delegate_service &) ETL_DELETE
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

## Detailed Description

template<size_t Range, size_t Offset>
class etl::delegate_service< Range, Offset >

An indexed delegate service.

Template Parameters

  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.

## Constructor & Destructor Documentation

## delegate_service()

template<size_t Range, size_t Offset>

etl::delegate_service< Range, Offset >::delegate_service | ( |  | ) |

inline

Default constructor. Sets all delegates to the internal default.

## Member Function Documentation

## call() [1/2]

template<size_t Range, size_t Offset>
template<size_t Id>

void etl::delegate_service< Range, Offset >::call | ( |  | ) | const

inline

Executes the delegate function for the index. Compile time assert if the id is out of range.

Template Parameters

  Id | The id of the delegate.

## call() [2/2]

template<size_t Range, size_t Offset>

void etl::delegate_service< Range, Offset >::call | ( | const size_t | id | ) | const

inline

Executes the delegate function for the index.

Parameters

  id | Id of the delegate.

## register_delegate() [1/2]

template<size_t Range, size_t Offset>
template<size_t Id>

void etl::delegate_service< Range, Offset >::register_delegate | ( | delegate_type | callback | ) |

inline

Registers a delegate for the specified id. Compile time assert if the id is out of range.

Template Parameters

  Id | The id of the delegate.

Parameters

  delegate | Reference to the delegate.

## register_delegate() [2/2]

template<size_t Range, size_t Offset>

void etl::delegate_service< Range, Offset >::register_delegate | ( | size_t | id,
|  | delegate_type | callback )

inline

Registers a delegate for the specified id. No action if the id is out of range.

Parameters

  id | Id of the delegate.
  delegate | Reference to the delegate.

## register_unhandled_delegate()

template<size_t Range, size_t Offset>

void etl::delegate_service< Range, Offset >::register_unhandled_delegate | ( | delegate_type | callback | ) |

inline

Registers an alternative delegate for unhandled ids.

Parameters

  delegate | A reference to the user supplied 'unhandled' delegate.

The documentation for this class was generated from the following file:

- include/etl/delegate_service.h