Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Teem::Registrar< T, IdT, void, void > Class Template Reference

#include <Registrar.h>

List of all members.

Detailed Description

template<typename T, typename IdT>
class Teem::Registrar< T, IdT, void, void >

A Registrar for classes with no parameter constructors.


A, is a class; B, C are its subclasses

Registrar<A, std::string> reg;


A* a1 = reg.createItem("you");
A* a2 = reg.createItem("yeah");

Public Member Functions

template<typename Sub>
void registerItem (const IdT &id)
 Register a class by storing a pointer to its constructor.
T * createItem (const IdT &id)
 Create an instance of a registered class.
void dump (std::ostream &stream)
 Print the list of registered classes to stream.

Protected Types

typedef T *(* CreatorFunc )()
 Pointer to constructor of class T.

Static Protected Member Functions

template<typename Sub>
static T * Creator ()
 Create a new class of type Sub.

Protected Attributes

std::map< IdT, CreatorFuncmItems
 registered constructors

The documentation for this class was generated from the following file:
Generated on Mon Oct 24 17:38:29 2005 for Teem by  doxygen 1.4.2