14 #ifndef TPCFILTERFACTORY_H
15 #define TPCFILTERFACTORY_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::TPCFilterFactoryBase*>
_factory_map;
BEGIN_PROLOG could also be cerr
virtual ~TPCFilterFactoryBase()
Default dtor (virtual)
TPCFilterFactoryBase()
Default ctor.
Factory class for instantiating flash algorithm instance.
TPCFilterFactory()
Default ctor, shouldn't be used.
Class def header for a class BaseTPCFilter.
std::map< std::string, flashmatch::TPCFilterFactoryBase * > _factory_map
Static factory container.
static TPCFilterFactory * _me
Static self.
~TPCFilterFactory()
Default dtor.
BaseTPCFilter * create(const std::string name, const std::string instance_name)
Factory creation method (should be called by clients, possibly you!)
virtual BaseTPCFilter * 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::TPCFilterFactoryBase *factory)
Factory registration method (should be called by global factory instance in algorithm header) ...