Go::Factory Class Reference
['geometry' - a spline library]

This is the Factory for creating instances of GeomObjects of type requested by the user. More...

#include <Factory.h>

List of all members.

Public Member Functions

 ~Factory ()
void registerClass (ClassType class_type, Creator *c)
 Register a ClassType with the Factory.

Static Public Member Functions

static GeomObjectcreateObject (ClassType class_type)
 Makes a new GeomObject instance of the specified ClassType and returns a pointer to it.
static FactoryglobalFactory ()
 This function returns a pointer to the unique, global Factory.


Detailed Description

This is the Factory for creating instances of GeomObjects of type requested by the user.

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.


Member Function Documentation

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.

Parameters:
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().

void Go::Factory::registerClass ( ClassType  class_type,
Creator c 
) [inline]

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

Parameters:
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.

Returns:
pointer to global Factory.

Definition at line 113 of file Factory.h.

Referenced by createObject(), Go::Register(), and Go::Registrator< T >::Registrator().


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 14:48:18 2007 for GoTools Core Library by  doxygen 1.5.1