#include <TypeFactory.h>
Collaboration diagram for PLearn::TypeFactory:

Public Member Functions | |
| void | registerType (const TypeMapEntry &entry) |
| Register a type. | |
| void | unregisterType (string type_name) |
| Unregister a type. | |
| bool | isRegistered (string type_name) const |
| Verify if the type is registered. | |
| Object * | newObject (string type_name) const |
| Construct a new default-constructed object given its type name Calls PLERROR (throws an exception) if type_name is not registered. | |
| bool | isAbstract (string type_name) const |
| Tells if the given object is a virtual base class (with pure virtual methods) (This simply checks if it was declared with a constructor or not). | |
| const TypeMap & | getTypeMap () const |
Static Public Member Functions | |
| void | register_type (const string &type_name, const string &parent_class, NEW_OBJECT constructor, GETOPTIONLIST_METHOD getoptionlist_method, ISA_METHOD isa_method, const string &one_line_descr, const string &multi_line_help) |
| Register a type. | |
| TypeFactory & | instance () |
| Return the singleton (static) instance of the type factory. | |
Protected Attributes | |
| TypeMap | type_map_ |
|
|
Definition at line 125 of file TypeFactory.h. References type_map_, and PLearn::TypeMap. Referenced by PLearn::displayObjectHelp(). |
|
|
Return the singleton (static) instance of the type factory.
Definition at line 98 of file TypeFactory.cc. Referenced by register_type(). |
|
|
Tells if the given object is a virtual base class (with pure virtual methods) (This simply checks if it was declared with a constructor or not).
Definition at line 90 of file TypeFactory.cc. |
|
|
Verify if the type is registered.
Definition at line 75 of file TypeFactory.cc. References type_map_. |
|
|
Construct a new default-constructed object given its type name Calls PLERROR (throws an exception) if type_name is not registered.
Definition at line 80 of file TypeFactory.cc. |
|
||||||||||||||||||||||||||||||||
|
Register a type.
Definition at line 45 of file TypeFactory.cc. References PLearn::GETOPTIONLIST_METHOD, instance(), PLearn::ISA_METHOD, PLearn::NEW_OBJECT, and registerType(). |
|
|
Register a type.
Definition at line 64 of file TypeFactory.cc. References type_map_, and PLearn::TypeMapEntry::type_name. Referenced by register_type(). |
|
|
Unregister a type.
Definition at line 70 of file TypeFactory.cc. References type_map_. |
|
|
Definition at line 94 of file TypeFactory.h. Referenced by getTypeMap(), isAbstract(), isRegistered(), newObject(), registerType(), and unregisterType(). |
1.3.7