|
Nori
|
Factory for Nori objects. More...
#include <object.h>
Public Types | |
| typedef boost::function < NoriObject *(const PropertyList &)> | Constructor |
Static Public Member Functions | |
| static void | registerClass (const QString &name, const Constructor &constr) |
| Register an object constructor with the object factory. | |
| static NoriObject * | createInstance (const QString &name, const PropertyList &propList) |
| Construct an instance from the class of the given name. | |
Factory for Nori objects.
This utility class is part of a mini-RTTI framework and can instantiate arbitrary Nori objects by their name.
| typedef boost::function<NoriObject *(const PropertyList &)> NoriObjectFactory::Constructor |
| static NoriObject* NoriObjectFactory::createInstance | ( | const QString & | name, |
| const PropertyList & | propList | ||
| ) | [inline, static] |
Construct an instance from the class of the given name.
| name | An internal name that is associated with this class. This is the 'type' field found in the scene description XML files |
| propList | A list of properties that will be passed to the constructor of the class. |
| static void NoriObjectFactory::registerClass | ( | const QString & | name, |
| const Constructor & | constr | ||
| ) | [static] |
Register an object constructor with the object factory.
This function is called by the macro NORI_REGISTER_CLASS
| name | An internal name that is associated with this class. This is the 'type' field found in the scene description XML files |
| constr | A Boost function pointer to an anonymous function that is able to call the constructor of the class. |