openModeller
Version 1.5.0
|
#include <PreFactory.hh>
Public Types | |
typedef map< string, PreFactory< T, Arg > * > | PreFactoryMap |
Public Member Functions | |
PreFactory (const string &factoryName) | |
virtual | ~PreFactory () |
Static Public Member Functions | |
static PreFactoryMap & | instance () |
static T * | make (string name, const Arg &arg) |
Protected Member Functions | |
virtual T * | build (const Arg &arg)=0 |
Private Attributes | |
string | Fname_ |
Implements a template for the "PreFactory" pattern.
The "factory" pattern is a technique for creating new instances of objects which defines an abstract interface, (represented by the "Make" module). The subclasses of factory decide which class to instantiate.
Each subclass of factory "registers" itself at compile time; therefore, the addition of a new factory requires no change the parent class.
author: Gilberto Camara
Definition at line 51 of file PreFactory.hh.
typedef map<string, PreFactory<T,Arg>* > PreFactory< T, Arg >::PreFactoryMap |
Definition at line 56 of file PreFactory.hh.
PreFactory< T, Arg >::PreFactory | ( | const string & | factoryName | ) |
Definition at line 85 of file PreFactory.hh.
References PreFactory< T, Arg >::instance().
|
inlinevirtual |
Definition at line 69 of file PreFactory.hh.
|
protectedpure virtual |
|
inlinestatic |
Definition at line 59 of file PreFactory.hh.
Referenced by PreFactory< T, Arg >::make(), and PreFactory< T, Arg >::PreFactory().
|
static |
Definition at line 94 of file PreFactory.hh.
References Log::error(), Log::instance(), and PreFactory< T, Arg >::instance().
|
private |
Definition at line 80 of file PreFactory.hh.