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 (void) | |
construction More... | |
void * | Produce (const char *sClassName) const |
produce a class with the given name More... | |
virtual | ~Factory () |
destruction More... | |
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
Constructor & Destructor Documentation
◆ Factory()
|
protected |
construction
◆ ~Factory()
|
protectedvirtual |
destruction
Member Function Documentation
◆ AddProducer()
void Factory::AddProducer | ( | const char * | sClassName, |
AbstractProducer * | pcProducer | ||
) |
Adds a new prducer instance.
Referenced by Gui::PrefPagePyProducer::PrefPagePyProducer(), Gui::PrefPageUiProducer::PrefPageUiProducer(), Gui::WidgetProducer< CLASS >::Produce(), and Gui::PropertyEditor::PropertyItemProducer< CLASS >::PropertyItemProducer().
◆ CanProduce() [1/2]
std::list< std::string > Factory::CanProduce | ( | ) | const |
returns a list of all registered producer
◆ CanProduce() [2/2]
bool Factory::CanProduce | ( | const char * | sClassName | ) | const |
returns true if there is a producer for this class registered
◆ Produce()
|
protected |
produce a class with the given name
Referenced by Gui::WidgetFactoryInst::createPreferencePage(), Gui::WidgetFactoryInst::createWidget(), Gui::WorkbenchFactoryInst::createWorkbench(), and Base::ScriptFactorySingleton::ProduceScript().
The documentation for this class was generated from the following files:
- src/Base/Factory.h
- src/Base/Factory.cpp