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_view &name)
 Construct registration by function name.
bool isValid () const noexcept
 Check if the registration is valid.
std::string description ()
 Gets the given description og the registered function.
 operator bool () const noexcept
 Operator type of the isValid() method.
R call (Args... args) const
 Calls the registered function when it exists.
R 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_view & 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

◆ description()

template<typename R, typename... Args>
std::string sf::FunctionRegistry::Registration< R, Args >::description ( )

Gets the given description og the registered function.

◆ 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: