DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
General singleton, abstract factory. More...
#include <AbstractFactory.hpp>
Public Member Functions | |
AbstractFactory () | |
AbstractFactory (const AbstractFactory &)=delete | |
AbstractFactory & | operator= (const AbstractFactory &)=delete |
virtual | ~AbstractFactory ()=default |
std::shared_ptr< T > | create_processor (const std::string &processor_name) |
Create the requested processor. | |
Static Public Member Functions | |
static void | register_creator (const std::string &processor_name, create_processor_func creator) |
Register the processor creation function to a given name. | |
static std::shared_ptr< AbstractFactory< T > > | get_instance () |
Singleton get instance function. | |
Static Protected Attributes | |
static std::shared_ptr< AbstractFactory< T > > | s_single_factory = nullptr |
Singleton instance. | |
Private Types | |
using | create_processor_func = std::function<std::shared_ptr<T>()> |
Function that creates shared_ptrs of type T. | |
using | name_creator_map = std::unordered_map<std::string, create_processor_func> |
Map from processor name to processor creation function. | |
Static Private Member Functions | |
static name_creator_map & | get_creators () |
Returns singleton instance of creation map. | |
General singleton, abstract factory.
Definition at line 26 of file AbstractFactory.hpp.
|
private |
Function that creates shared_ptrs of type T.
Definition at line 28 of file AbstractFactory.hpp.
|
private |
Map from processor name to processor creation function.
Definition at line 30 of file AbstractFactory.hpp.
|
inline |
Definition at line 33 of file AbstractFactory.hpp.
|
delete |
|
virtualdefault |
std::shared_ptr< T > tpglibs::AbstractFactory< T >::create_processor | ( | const std::string & | processor_name | ) |
Create the requested processor.
processor_name | Name of the processor being created. |
Definition at line 37 of file AbstractFactory.hxx.
|
staticprivate |
Returns singleton instance of creation map.
Definition at line 18 of file AbstractFactory.hxx.
|
static |
Singleton get instance function.
Definition at line 50 of file AbstractFactory.hxx.
|
delete |
|
static |
Register the processor creation function to a given name.
processor_name | String name of the processor to be registered as. |
creator | Processor creation function. |
Definition at line 24 of file AbstractFactory.hxx.
|
staticprotected |
Singleton instance.
Definition at line 57 of file AbstractFactory.hpp.