ponder 3.2
C++ reflection library
ponder::runtime::FunctionCaller Class Reference

This object is used to invoke a function. More...

#include <runtime.hpp>

Public Member Functions

 FunctionCaller (const Function &f)
 Constructor. More...
 
const Functionfunction () const
 Get the function begin used. More...
 
template<typename... A>
Value call (A... args)
 Call the static function. More...
 

Detailed Description

This object is used to invoke a function.

There are helpers for this class, see ponder::runtime::call() and ponder::runtime::callStatic().

Constructor & Destructor Documentation

◆ FunctionCaller()

ponder::runtime::FunctionCaller::FunctionCaller ( const Function f)

Constructor.

Parameters
fThe function to call

Member Function Documentation

◆ call()

template<typename... A>
Value ponder::runtime::FunctionCaller::call ( A...  args)
inline

Call the static function.

Parameters
argsArguments to pass to the function, for example "ponder::Args::empty"
Returns
Value returned by the function call
runtime::FunctionCaller caller(classByType<MyClass>.function("fpp"));
caller.call(Args("bar"));
Exceptions
NotEnoughArgumentstoo few arguments are provided
BadArgumentone of the arguments can't be converted to the requested type

◆ function()

const Function& ponder::runtime::FunctionCaller::function ( ) const
inline

Get the function begin used.

Returns
a Function reference

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