ponder 3.2
C++ reflection library
ponder::Constructor Class Referenceabstract

Represents a metaconstructor which is used to create objects instances from metaclasses. More...

#include <constructor.hpp>

+ Inheritance diagram for ponder::Constructor:

Public Member Functions

virtual ~Constructor ()
 Destructor.
 
virtual bool matches (const Args &args) const =0
 Check if the constructor matches the given set of arguments. More...
 
virtual UserObject create (void *ptr, const Args &args) const =0
 Use the constructor to create a new object. More...
 

Detailed Description

Represents a metaconstructor which is used to create objects instances from metaclasses.

This class is an interface which has to be derived to implement typed constructors.

See also
Property, Function

Member Function Documentation

◆ create()

virtual UserObject ponder::Constructor::create ( void *  ptr,
const Args args 
) const
pure virtual

Use the constructor to create a new object.

Parameters
ptrIf not null, use for placement new, otherwise heap allocate using new
argsSet of arguments to pass to the constructor
Returns
Pointer to the new object wrapped in a UserObject, or UserObject::nothing on failure

◆ matches()

virtual bool ponder::Constructor::matches ( const Args args) const
pure virtual

Check if the constructor matches the given set of arguments.

Parameters
argsSet of arguments to check
Returns
True if the constructor is compatible with the given arguments

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