WorldElementFactory Class Reference

Factory class for creating WorldElements. More...

#include <worldElementFactory.h>

List of all members.

Public Member Functions

WorldElementcreateElement (std::string elementType, World *parent, const char *name)
 Instantiates an element based on the given type.
void registerCreator (std::string elementType, WorldElementCreator *creator)
 Registers a new world element creator for the given type.
 WorldElementFactory ()
 Stub constructor.
 ~WorldElementFactory ()
 Cleans up, deletes all creators.

Static Public Member Functions

static void registerBuiltinCreators ()
 Registers creators for the built in element types. Called from the world constructor.

Private Attributes

std::map< std::string,
WorldElementCreator * > 
mCreators
 Maps world element types to their creators.

Detailed Description

Factory class for creating WorldElements.

Used to instantiate the right WorldElement based on a name, presumably read from an .xml configuration file, such as a saved world or a robot definition.

Definition at line 58 of file worldElementFactory.h.


Constructor & Destructor Documentation

WorldElementFactory::WorldElementFactory (  )  [inline]

Stub constructor.

Definition at line 66 of file worldElementFactory.h.

WorldElementFactory::~WorldElementFactory (  ) 

Cleans up, deletes all creators.

Definition at line 45 of file worldElementFactory.cpp.


Member Function Documentation

WorldElement * WorldElementFactory::createElement ( std::string  elementType,
World parent,
const char *  name 
)

Instantiates an element based on the given type.

Definition at line 54 of file worldElementFactory.cpp.

void WorldElementFactory::registerBuiltinCreators (  )  [static]

Registers creators for the built in element types. Called from the world constructor.

Definition at line 68 of file worldElementFactory.cpp.

void WorldElementFactory::registerCreator ( std::string  elementType,
WorldElementCreator creator 
)

Registers a new world element creator for the given type.

Definition at line 62 of file worldElementFactory.cpp.


Member Data Documentation

std::map<std::string, WorldElementCreator*> WorldElementFactory::mCreators [private]

Maps world element types to their creators.

Definition at line 62 of file worldElementFactory.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


graspit
Author(s):
autogenerated on Wed Jan 25 11:00:27 2012