#include <Factory.h>
Public Member Functions | |
~Factory () | |
void | registerClass (ClassType class_type, Creator *c) |
Register a ClassType with the Factory. | |
Static Public Member Functions | |
static GeomObject * | createObject (ClassType class_type) |
Makes a new GeomObject instance of the specified ClassType and returns a pointer to it. | |
static Factory * | globalFactory () |
This function returns a pointer to the unique, global Factory. |
There will be one, global Factory object, called Go::global_factory_. However, the user will not have to deal with this directly. The user need only interact with the Factory using the static member function 'createObject(ClassType)' and the template Register() function (or Registrator class, if the compiler misbehaves.
Definition at line 78 of file Factory.h.
static GeomObject* Go::Factory::createObject | ( | ClassType | class_type | ) | [inline, static] |
Makes a new GeomObject instance of the specified ClassType and returns a pointer to it.
The user assumes ownership over the created object.
class_type | the class type of the object that the user wants to have constructed. |
Definition at line 92 of file Factory.h.
References doCreateObject(), and globalFactory().
Register a ClassType with the Factory.
This amounts to provide the Factory with the Creator object that is used to generate a new GeomObject of type ClassType. Usually, the user would not want to call this function directly, but through the (template) function Register() or by using a Registrator
class_type | the ClassType for which we want the Factory to associate a particular Creator. | |
c | pointer to the Creator object to be used by the Factory when creating objects of type ClassType. |
Definition at line 106 of file Factory.h.
Referenced by Go::Register(), and Go::Registrator< T >::Registrator().
static Factory* Go::Factory::globalFactory | ( | ) | [inline, static] |
This function returns a pointer to the unique, global Factory.
Definition at line 113 of file Factory.h.
Referenced by createObject(), Go::Register(), and Go::Registrator< T >::Registrator().