Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::TypeFactory Class Reference

#include <TypeFactory.h>

Collaboration diagram for PLearn::TypeFactory:

Collaboration graph
[legend]
List of all members.

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.

ObjectnewObject (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 TypeMapgetTypeMap () 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.

TypeFactoryinstance ()
 Return the singleton (static) instance of the type factory.


Protected Attributes

TypeMap type_map_

Member Function Documentation

const TypeMap& PLearn::TypeFactory::getTypeMap  )  const [inline]
 

Definition at line 125 of file TypeFactory.h.

References type_map_, and PLearn::TypeMap.

Referenced by PLearn::displayObjectHelp().

TypeFactory & PLearn::TypeFactory::instance  )  [static]
 

Return the singleton (static) instance of the type factory.

Definition at line 98 of file TypeFactory.cc.

Referenced by register_type().

bool PLearn::TypeFactory::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).

Definition at line 90 of file TypeFactory.cc.

References PLERROR, and type_map_.

bool PLearn::TypeFactory::isRegistered string  type_name  )  const
 

Verify if the type is registered.

Definition at line 75 of file TypeFactory.cc.

References type_map_.

Object * PLearn::TypeFactory::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.

Definition at line 80 of file TypeFactory.cc.

References PLERROR, and type_map_.

void PLearn::TypeFactory::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
[static]
 

Register a type.

Definition at line 45 of file TypeFactory.cc.

References PLearn::GETOPTIONLIST_METHOD, instance(), PLearn::ISA_METHOD, PLearn::NEW_OBJECT, and registerType().

void PLearn::TypeFactory::registerType const TypeMapEntry entry  ) 
 

Register a type.

Definition at line 64 of file TypeFactory.cc.

References type_map_, and PLearn::TypeMapEntry::type_name.

Referenced by register_type().

void PLearn::TypeFactory::unregisterType string  type_name  ) 
 

Unregister a type.

Definition at line 70 of file TypeFactory.cc.

References type_map_.


Member Data Documentation

TypeMap PLearn::TypeFactory::type_map_ [protected]
 

Definition at line 94 of file TypeFactory.h.

Referenced by getTypeMap(), isAbstract(), isRegistered(), newObject(), registerType(), and unregisterType().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:22:46 2004 for PLearn by doxygen 1.3.7