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

This object is used to invoke a object member function, or method. More...

#include <runtime.hpp>

Public Member Functions

 ObjectCaller (const Function &fn)
 Constructor. More...
 
const Functionfunction () const
 Get the function begin used. More...
 
template<typename... A>
Value call (const UserObject &obj, A &&... args)
 Call the function. More...
 

Detailed Description

This object is used to invoke a object member function, or method.

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

Constructor & Destructor Documentation

◆ ObjectCaller()

ponder::runtime::ObjectCaller::ObjectCaller ( const Function fn)

Constructor.

Parameters
fnThe Function to be called
Returns
a Function reference

Member Function Documentation

◆ call()

template<typename... A>
Value ponder::runtime::ObjectCaller::call ( const UserObject obj,
A &&...  args 
)
inline

Call the function.

Parameters
objObject
argsArguments to pass to the function, for example "ponder::Args::empty"
Returns
Value returned by the function call
runtime::ObjectCaller caller(classByType<MyClass>.function("foo"));
caller.call(instancem, "bar");
Exceptions
ForbiddenCallthe function is not callable
NullObjectobject is invalid
NotEnoughArgumentstoo few arguments are provided
BadArgumentone of the arguments can't be converted to the requested type

◆ function()

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

Get the function begin used.

Returns
a Function reference

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