Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::FunctionRegistry::Registration< R, Args > Class Template Reference

Registration handle templated on function signature. More...

#include <FunctionRegistry.h>

Classes

class  Holder
 Nested holder storing a function with a specific signature. More...
 

Public Member Functions

 Registration (const std::string &name)
 Construct registration by function name.
 
bool isValid () const noexcept
 Check if the registration is valid.
 
 operator bool () const noexcept
 Operator type of the isValid() method.
 
call (Args... args) const
 Calls the registered function when it exists.
 
operator() (Args... args) const
 Operator type of the call() method.
 

Detailed Description

template<typename R, typename... Args>
class sf::FunctionRegistry::Registration< R, Args >

Registration handle templated on function signature.

Template Parameters
RReturn type
ArgsArgument types

Constructor & Destructor Documentation

◆ Registration()

template<typename R , typename... Args>
sf::FunctionRegistry::Registration< R, Args >::Registration ( const std::string &  name)
explicit

Construct registration by function name.

Parameters
nameName and signature key

Member Function Documentation

◆ call()

template<typename R , typename... Args>
R sf::FunctionRegistry::Registration< R, Args >::call ( Args...  args) const

Calls the registered function when it exists.

Parameters
argsArguments to pass
Exceptions
std::runtime_errorWhen it does not exist.
Returns
Result of the function call

◆ isValid()

template<typename R , typename... Args>
bool sf::FunctionRegistry::Registration< R, Args >::isValid ( ) const
noexcept

Check if the registration is valid.

Returns
true if valid, false otherwise

◆ operator bool()

template<typename R , typename... Args>
sf::FunctionRegistry::Registration< R, Args >::operator bool ( ) const
noexcept

Operator type of the isValid() method.

◆ operator()()

template<typename R , typename... Args>
R sf::FunctionRegistry::Registration< R, Args >::operator() ( Args...  args) const

Operator type of the call() method.


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