14 #ifndef FLASHMATCHFACTORY_H
15 #define FLASHMATCHFACTORY_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::FlashMatchFactoryBase*>
_factory_map;
BEGIN_PROLOG could also be cerr
virtual BaseFlashMatch * create(const std::string instance_name)=0
Abstract constructor method.
Abstract base class for factory (to be implemented per flash)
void add_factory(const std::string name, flashmatch::FlashMatchFactoryBase *factory)
Factory registration method (should be called by global factory instance in algorithm header) ...
FlashMatchFactory()
Default ctor, shouldn't be used.
BaseFlashMatch * create(const std::string name, const std::string instance_name)
Factory creation method (should be called by clients, possibly you!)
~FlashMatchFactory()
Default dtor.
static FlashMatchFactory * _me
Static self.
FlashMatchFactoryBase()
Default ctor.
Class def header for a class BaseFlashMatch.
Factory class for instantiating flash algorithm instance.
virtual ~FlashMatchFactoryBase()
Default dtor (virtual)
std::map< std::string, flashmatch::FlashMatchFactoryBase * > _factory_map
Static factory container.