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>
Public Member Functions | |
void | AddProducer (const char *sClassName, AbstractProducer *pcProducer) |
Adds a new prducer instance. More... | |
std::list< std::string > | CanProduce () const |
returns a list of all registered producer More... | |
bool | CanProduce (const char *sClassName) const |
returns true if there is a producer for this class registered More... | |
Protected Member Functions | |
Factory () | |
construction More... | |
void * | Produce (const char *sClassName) const |
produce a class with the given name More... | |
virtual | ~Factory () |
destruction More... | |
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
|
protected |
construction
|
protectedvirtual |
destruction
void Factory::AddProducer | ( | const char * | sClassName, |
AbstractProducer * | pcProducer | ||
) |
Adds a new prducer instance.
Referenced by Gui::CustomPageProducer< CLASS >::CustomPageProducer(), Base::ExceptionProducer< CLASS >::ExceptionProducer(), Gui::PrefPageProducer< CLASS >::PrefPageProducer(), Gui::PrefPagePyProducer::PrefPagePyProducer(), Gui::PrefPageUiProducer::PrefPageUiProducer(), Gui::PropertyEditor::PropertyItemProducer< CLASS >::PropertyItemProducer(), Base::ScriptProducer::ScriptProducer(), and Gui::WidgetProducer< CLASS >::WidgetProducer().
std::list< std::string > Factory::CanProduce | ( | ) | const |
returns a list of all registered producer
bool Factory::CanProduce | ( | const char * | sClassName | ) | const |
returns true if there is a producer for this class registered
|
protected |
produce a class with the given name
Referenced by Gui::WidgetFactoryInst::createPreferencePage(), Gui::PropertyEditor::PropertyItemFactory::createPropertyItem(), Gui::WidgetFactoryInst::createWidget(), Gui::WorkbenchFactoryInst::createWorkbench(), and Base::ScriptFactorySingleton::ProduceScript().