#include <function_dispatcher.h>
|
| void | register_function (const std::string &key, std::function< Treturntype(Targs...)> new_function) |
| |
| Treturntype | dispatch (const std::string &key, Targs...args) |
| |
| bool | check (const std::string &key) const |
| |
| std::vector< std::string > | list () const |
| |
template<typename Treturntype, typename... Targs>
class Dispatcher< Treturntype, Targs >
Singleton function dispatcher
- Template Parameters
-
| Treturntype | Function return type |
| Targs | Function arguments |
Definition at line 16 of file function_dispatcher.h.
template<typename Treturntype, typename... Targs>
| bool Dispatcher< Treturntype, Targs >::check |
( |
const std::string & |
key | ) |
const |
|
inline |
Check if a function is registered
- Parameters
-
| [in] | key | Key to be checked in registry |
- Returns
- status Return if key is in registry or not
Definition at line 60 of file function_dispatcher.h.
template<typename Treturntype, typename... Targs>
| Treturntype Dispatcher< Treturntype, Targs >::dispatch |
( |
const std::string & |
key, |
|
|
Targs... |
args |
|
) |
| |
|
inline |
Dispatch function with input arguments
- Parameters
-
| key | Key to function in dispatcher |
| args | Inputs to function |
- Returns
- Return result of evaluating function with input args
Definition at line 47 of file function_dispatcher.h.
template<typename Treturntype, typename... Targs>
template<typename Treturntype, typename... Targs>
| std::vector<std::string> Dispatcher< Treturntype, Targs >::list |
( |
| ) |
const |
|
inline |
List registered functions
- Returns
- dispather_items Return list of items in the registry
Definition at line 71 of file function_dispatcher.h.
template<typename Treturntype, typename... Targs>
| void Dispatcher< Treturntype, Targs >::register_function |
( |
const std::string & |
key, |
|
|
std::function< Treturntype(Targs...)> |
new_function |
|
) |
| |
|
inline |
The documentation for this class was generated from the following file: