9#ifndef TPGLIBS_ABSTRACTFACTORY_HPP_
10#define TPGLIBS_ABSTRACTFACTORY_HPP_
18#include <unordered_map>
53 static std::shared_ptr<AbstractFactory<T>>
get_instance();
General singleton, abstract factory.
AbstractFactory(const AbstractFactory &)=delete
std::unordered_map< std::string, create_processor_func > name_creator_map
Map from processor name to processor creation function.
AbstractFactory & operator=(const AbstractFactory &)=delete
static std::shared_ptr< AbstractFactory< T > > s_single_factory
Singleton instance.
static name_creator_map & get_creators()
Returns singleton instance of creation map.
virtual ~AbstractFactory()=default
std::function< std::shared_ptr< T >()> create_processor_func
Function that creates shared_ptrs of type T.
static std::shared_ptr< AbstractFactory< T > > get_instance()
Singleton get instance function.
std::shared_ptr< T > create_processor(const std::string &processor_name)
Create the requested processor.
static void register_creator(const std::string &processor_name, create_processor_func creator)
Register the processor creation function to a given name.