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