Nori

NoriObjectFactory Class Reference

Factory for Nori objects. More...

#include <object.h>

List of all members.

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 NoriObjectcreateInstance (const QString &name, const PropertyList &propList)
 Construct an instance from the class of the given name.

Detailed Description

Factory for Nori objects.

This utility class is part of a mini-RTTI framework and can instantiate arbitrary Nori objects by their name.

Definition at line 112 of file object.h.


Member Typedef Documentation

typedef boost::function<NoriObject *(const PropertyList &)> NoriObjectFactory::Constructor

Definition at line 114 of file object.h.


Member Function Documentation

static NoriObject* NoriObjectFactory::createInstance ( const QString &  name,
const PropertyList propList 
) [inline, static]

Construct an instance from the class of the given name.

Parameters:
nameAn internal name that is associated with this class. This is the 'type' field found in the scene description XML files
propListA list of properties that will be passed to the constructor of the class.

Definition at line 142 of file object.h.

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

Parameters:
nameAn internal name that is associated with this class. This is the 'type' field found in the scene description XML files
constrA Boost function pointer to an anonymous function that is able to call the constructor of the class.

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines