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