14 #ifndef FLASHPROHIBITFACTORY_H
15 #define FLASHPROHIBITFACTORY_H
20 namespace flashmatch {
57 std::cerr <<
"Found no registered class " << name << std::endl;
60 auto ptr = (*iter).second->create(instance_name);
66 std::map<std::string,flashmatch::FlashProhibitFactoryBase*>
_factory_map;
BEGIN_PROLOG could also be cerr
~FlashProhibitFactory()
Default dtor.
static FlashProhibitFactory * _me
Static self.
FlashProhibitFactory()
Default ctor, shouldn't be used.
Class def header for a class BaseProhibitAlgo.
BaseProhibitAlgo * create(const std::string name, const std::string instance_name)
Factory creation method (should be called by clients, possibly you!)
Factory class for instantiating flash algorithm instance.
FlashProhibitFactoryBase()
Default ctor.
virtual BaseProhibitAlgo * create(const std::string instance_name)=0
Abstract constructor method.
void add_factory(const std::string name, flashmatch::FlashProhibitFactoryBase *factory)
Factory registration method (should be called by global factory instance in algorithm header) ...
virtual ~FlashProhibitFactoryBase()
Default dtor (virtual)
std::map< std::string, flashmatch::FlashProhibitFactoryBase * > _factory_map
Static factory container.
Abstract base class for factory (to be implemented per flash)