Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | List of all members
jau::FunctionDef< R, A > Class Template Reference

#include <function_def.hpp>

Inheritance diagram for jau::FunctionDef< R, A >:
Collaboration diagram for jau::FunctionDef< R, A >:

Public Member Functions

 FunctionDef () noexcept
 Constructs an instance with a null function. More...
 
 FunctionDef (InvocationFunc< R, A... > *_funcPtr) noexcept
 Constructs an instance by wrapping the given naked InvocationFunc<R, A...> function pointer in a shared_ptr and taking ownership. More...
 
 FunctionDef (std::shared_ptr< InvocationFunc< R, A... >> _func) noexcept
 Constructs an instance using the shared InvocationFunc<R, A...> function. More...
 
 FunctionDef (const FunctionDef &o) noexcept=default
 
 FunctionDef (FunctionDef &&o) noexcept=default
 
FunctionDefoperator= (const FunctionDef &o) noexcept=default
 
FunctionDefoperator= (FunctionDef &&o) noexcept=default
 
bool operator== (const FunctionDef< R, A... > &rhs) const noexcept
 
bool operator!= (const FunctionDef< R, A... > &rhs) const noexcept
 
std::shared_ptr< InvocationFunc< R, A... > > getFunction () noexcept
 Returns the shared InvocationFunc<R, A...> function. More...
 
InvocationFunc< R, A... > * cloneFunction () const noexcept
 Returns a new instance of the held InvocationFunc<R, A...> function. More...
 
std::string toString () const
 
invoke (A... args)
 

Detailed Description

template<typename R, typename... A>
class jau::FunctionDef< R, A >

Examples
test_functiondef01.cpp.

Definition at line 309 of file function_def.hpp.

Constructor & Destructor Documentation

◆ FunctionDef() [1/5]

template<typename R , typename... A>
jau::FunctionDef< R, A >::FunctionDef ( )
inlinenoexcept

Constructs an instance with a null function.

Definition at line 317 of file function_def.hpp.

◆ FunctionDef() [2/5]

template<typename R , typename... A>
jau::FunctionDef< R, A >::FunctionDef ( InvocationFunc< R, A... > *  _funcPtr)
inlinenoexcept

Constructs an instance by wrapping the given naked InvocationFunc<R, A...> function pointer in a shared_ptr and taking ownership.

Definition at line 324 of file function_def.hpp.

◆ FunctionDef() [3/5]

template<typename R , typename... A>
jau::FunctionDef< R, A >::FunctionDef ( std::shared_ptr< InvocationFunc< R, A... >>  _func)
inlineexplicitnoexcept

Constructs an instance using the shared InvocationFunc<R, A...> function.

Definition at line 330 of file function_def.hpp.

◆ FunctionDef() [4/5]

template<typename R , typename... A>
jau::FunctionDef< R, A >::FunctionDef ( const FunctionDef< R, A > &  o)
defaultnoexcept

◆ FunctionDef() [5/5]

template<typename R , typename... A>
jau::FunctionDef< R, A >::FunctionDef ( FunctionDef< R, A > &&  o)
defaultnoexcept

Member Function Documentation

◆ cloneFunction()

template<typename R , typename... A>
InvocationFunc<R, A...>* jau::FunctionDef< R, A >::cloneFunction ( ) const
inlinenoexcept

Returns a new instance of the held InvocationFunc<R, A...> function.

Definition at line 348 of file function_def.hpp.

◆ getFunction()

template<typename R , typename... A>
std::shared_ptr<InvocationFunc<R, A...> > jau::FunctionDef< R, A >::getFunction ( )
inlinenoexcept

Returns the shared InvocationFunc<R, A...> function.

Definition at line 345 of file function_def.hpp.

◆ invoke()

template<typename R , typename... A>
R jau::FunctionDef< R, A >::invoke ( A...  args)
inline

Definition at line 354 of file function_def.hpp.

Here is the caller graph for this function:

◆ operator!=()

template<typename R , typename... A>
bool jau::FunctionDef< R, A >::operator!= ( const FunctionDef< R, A... > &  rhs) const
inlinenoexcept

Definition at line 341 of file function_def.hpp.

◆ operator=() [1/2]

template<typename R , typename... A>
FunctionDef& jau::FunctionDef< R, A >::operator= ( const FunctionDef< R, A > &  o)
defaultnoexcept

◆ operator=() [2/2]

template<typename R , typename... A>
FunctionDef& jau::FunctionDef< R, A >::operator= ( FunctionDef< R, A > &&  o)
defaultnoexcept

◆ operator==()

template<typename R , typename... A>
bool jau::FunctionDef< R, A >::operator== ( const FunctionDef< R, A... > &  rhs) const
inlinenoexcept

Definition at line 338 of file function_def.hpp.

◆ toString()

template<typename R , typename... A>
std::string jau::FunctionDef< R, A >::toString ( ) const
inline

Definition at line 350 of file function_def.hpp.

Here is the caller graph for this function:

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