ponder 3.2
C++ reflection library
ponder::runtime Namespace Reference

Contains Ponder runtime support public API. More...

Classes

class  FunctionCaller
 This object is used to invoke a function. More...
 
class  ObjectCaller
 This object is used to invoke a object member function, or method. More...
 
class  ObjectFactory
 This object is used to create instances of metaclasses. More...
 

Typedefs

typedef std::unique_ptr< UserObjectUniquePtr
 

Functions

static void destroy (const UserObject &obj)
 Destroy a UserObject instance. More...
 
template<typename... A>
static UserObject create (const Class &cls, A... args)
 Create instance of metaclass as a UserObject. More...
 
UniquePtr makeUniquePtr (UserObject *obj)
 
template<typename... A>
static UniquePtr createUnique (const Class &cls, A... args)
 
template<typename... A>
static Value call (const Function &fn, const UserObject &obj, A &&... args)
 Call a member function. More...
 
template<typename... A>
static Value callStatic (const Function &fn, A &&... args)
 Call a non-member function. More...
 

Detailed Description

Contains Ponder runtime support public API.

Function Documentation

◆ call()

template<typename... A>
static Value ponder::runtime::call ( const Function fn,
const UserObject obj,
A &&...  args 
)
inlinestatic

Call a member function.

This is a helper function which uses ObjectCaller to call the member function.

Parameters
fnThe Function to call
objReference to UserObject instance to destroy
argsArguments for the function
Returns
The return value. This is NoType if function return type return is void.
See also
callStatic(), Class::function()

◆ callStatic()

template<typename... A>
static Value ponder::runtime::callStatic ( const Function fn,
A &&...  args 
)
inlinestatic

Call a non-member function.

This is a helper function which uses FunctionCaller to call the function.

Parameters
fnThe Function to call
argsArguments for the function
Returns
The return value. This is NoType if function return type return is void.
See also
call(), Class::function()

◆ create()

template<typename... A>
static UserObject ponder::runtime::create ( const Class cls,
A...  args 
)
inlinestatic

Create instance of metaclass as a UserObject.

This is a helper function which uses ObjectFactory to create the instance.

Parameters
clsThe metaclass to make an instance of
argsThe constructor arguments for the class instance
Returns
A UserObject which owns an instance of the metaclass.
// construct a new person
ponder::UserObject person = ponder::runtime::create(metaclass, "Bozo");
See also
destroy()

◆ destroy()

static void ponder::runtime::destroy ( const UserObject obj)
inlinestatic

Destroy a UserObject instance.

This is a helper function which uses ObjectFactory to destroy the instance.

Parameters
objReference to UserObject instance to destroy
See also
create()
ponder::runtime::create
static UserObject create(const Class &cls, A... args)
Create instance of metaclass as a UserObject.
Definition: runtime.hpp:294
ponder::UserObject
Wrapper to manipulate user objects in the Ponder system.
Definition: userobject.hpp:62