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

`#include <callback_service.h>`

## Public Member Functions

| callback_service ()
| callback_service (const callback_service &) ETL_DELETE
callback_service & | operator= (const callback_service &) ETL_DELETE
template<size_t Id>
void | register_callback (etl::ifunction< size_t > &callback)
void | register_callback (size_t id, etl::ifunction< size_t > &callback)
void | register_unhandled_callback (etl::ifunction< size_t > &callback)
template<size_t Id>
void | callback ()
void | callback (size_t id)

## Detailed Description

template<size_t Range, size_t Offset = 0U>
class etl::callback_service< Range, Offset >

An indexed callback service.

Template Parameters

  Range | The number of callbacks to handle.
  Offset | The lowest callback id value. The callback ids must range between Offset and Offset + Range - 1.

## Constructor & Destructor Documentation

## callback_service()

template<size_t Range, size_t Offset = 0U>

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

inline

Reset the callback service. Sets all callbacks to the internal default.

## Member Function Documentation

## callback() [1/2]

template<size_t Range, size_t Offset = 0U>
template<size_t Id>

void etl::callback_service< Range, Offset >::callback | ( |  | ) |

inline

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

Template Parameters

  Id | The id of the callback.

## callback() [2/2]

template<size_t Range, size_t Offset = 0U>

void etl::callback_service< Range, Offset >::callback | ( | size_t | id | ) |

inline

Executes the callback function for the index.

Parameters

  id | Id of the callback.

## register_callback() [1/2]

template<size_t Range, size_t Offset = 0U>
template<size_t Id>

void etl::callback_service< Range, Offset >::register_callback | ( | etl::ifunction< size_t > & | callback | ) |

inline

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

Template Parameters

  Id | The id of the callback.

Parameters

  callback | Reference to the callback.

## register_callback() [2/2]

template<size_t Range, size_t Offset = 0U>

void etl::callback_service< Range, Offset >::register_callback | ( | size_t | id,
|  | etl::ifunction< size_t > & | callback )

inline

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

Parameters

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

## register_unhandled_callback()

template<size_t Range, size_t Offset = 0U>

void etl::callback_service< Range, Offset >::register_unhandled_callback | ( | etl::ifunction< size_t > & | callback | ) |

inline

Registers an alternative callback for unhandled ids.

Parameters

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

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

- include/etl/callback_service.h