Base::Factory Class Reference

Base class of all factories This class has the purpose to produce at runtime instances of classes not known at compile time. More...

#include <Factory.h>

Inheritance diagram for Base::Factory:
Base::ScriptFactorySingleton Gui::BitmapFactoryInst Gui::WidgetFactoryInst Gui::WorkbenchFactoryInst

List of all members.

Public Member Functions

void AddProducer (const char *sClassName, AbstractProducer *pcProducer)
 Adds a new prducer instance.
std::list< std::string > CanProduce () const
 returns a list of all registered producer
bool CanProduce (const char *sClassName) const
 returns true if there is a producer for this class registered

Protected Member Functions

 Factory (void)
 construction
void * Produce (const char *sClassName) const
 produce a class with the given name
virtual ~Factory ()
 destruction

Protected Attributes

std::map< const std::string,
AbstractProducer * > 
_mpcProducers

Detailed Description

Base class of all factories This class has the purpose to produce at runtime instances of classes not known at compile time.

It holds a map of so called producers which are able to produce an instance of a special class. Producer can be registered at runtime through e.g. application modules

Definition at line 57 of file Factory.h.


Constructor & Destructor Documentation

Base::Factory::Factory ( void   )  [inline, protected]

construction

Definition at line 72 of file Factory.h.

Factory::~Factory (  )  [protected, virtual]

destruction

Definition at line 39 of file Factory.cpp.

References _mpcProducers.


Member Function Documentation

void Factory::AddProducer ( const char *  sClassName,
AbstractProducer pcProducer 
)
std::list< std::string > Factory::CanProduce (  )  const

returns a list of all registered producer

Definition at line 66 of file Factory.cpp.

References _mpcProducers.

bool Factory::CanProduce ( const char *  sClassName  )  const

returns true if there is a producer for this class registered

Definition at line 61 of file Factory.cpp.

References _mpcProducers.

Referenced by Gui::UiLoader::createWidget().

void * Factory::Produce ( const char *  sClassName  )  const [protected]

Member Data Documentation

std::map<const std::string, AbstractProducer*> Base::Factory::_mpcProducers [protected]

The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:01:46 2011 for FreeCAD by  doxygen 1.6.1