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