OpenLexocad  27.1
Base::Factory2 Class Reference

#include <Factory.h>

Inheritance diagram for Base::Factory2:
Base::ScriptFactorySingleton

Public Member Functions

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

Protected Member Functions

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

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

Constructor & Destructor Documentation

◆ Factory2()

Base::Factory2::Factory2 ( void  )
inlineprotected

construction

◆ ~Factory2()

virtual Base::Factory2::~Factory2 ( )
protectedvirtual

destruction

Member Function Documentation

◆ AddProducer()

void Base::Factory2::AddProducer ( const char *  sClassName,
AbstractProducer pcProducer 
)

Adds a new producer instance.

◆ CanProduce() [1/2]

bool Base::Factory2::CanProduce ( const char *  sClassName) const

returns true if there is a producer for this class registered

◆ CanProduce() [2/2]

std::list<std::string> Base::Factory2::CanProduce ( ) const

returns a list of all registered producer

◆ Produce()

void* Base::Factory2::Produce ( const char *  sClassName) const
protected

produce a class with the given name

Member Data Documentation

◆ _mpcProducers

std::map<const std::string, AbstractProducer*> Base::Factory2::_mpcProducers
protected

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