#include <NamedFactory.h>
Public Types | |
typedef Type | type |
Remember the underlying type. More... | |
typedef std::shared_ptr< Type > | pointer_type |
The exposed pointer type. More... | |
Public Types inherited from WireCell::INamedFactory | |
typedef std::shared_ptr< INamedFactory > | pointer |
Public Types inherited from WireCell::IComponent< IFactory > | |
typedef std::shared_ptr< IFactory > | pointer |
Access subclass facet by pointer. More... | |
typedef std::vector< pointer > | vector |
Vector of shared pointers. More... | |
Public Types inherited from WireCell::Interface | |
typedef std::shared_ptr< Interface > | pointer |
Public Member Functions | |
NamedFactory () | |
Interface::pointer | find (const std::string &name) |
Return existing instance of given name or nullptr if not found. More... | |
Interface::pointer | create () |
Return an instance associated with the given name. More... | |
Interface::pointer | create (const std::string &name) |
Create an instance by name. More... | |
virtual void | set_classname (const std::string &name) |
Set name of class this factory can make. More... | |
virtual const std::string & | classname () |
Access name of class this factory can make. More... | |
Public Member Functions inherited from WireCell::INamedFactory | |
virtual | ~INamedFactory () |
Public Member Functions inherited from WireCell::IFactory | |
virtual | ~IFactory () |
Public Member Functions inherited from WireCell::IComponent< IFactory > | |
virtual | ~IComponent () |
Public Member Functions inherited from WireCell::Interface | |
virtual | ~Interface () |
Private Attributes | |
std::unordered_map< std::string, pointer_type > | m_objects |
std::string | m_classname |
A templated factory of objects of type Type that associates a name to an object, returning a preexisting one if it exists.
Definition at line 27 of file NamedFactory.h.
typedef std::shared_ptr<Type> WireCell::NamedFactory< Type >::pointer_type |
The exposed pointer type.
Definition at line 33 of file NamedFactory.h.
typedef Type WireCell::NamedFactory< Type >::type |
Remember the underlying type.
Definition at line 30 of file NamedFactory.h.
|
inline |
Definition at line 35 of file NamedFactory.h.
|
inlinevirtual |
Access name of class this factory can make.
Implements WireCell::INamedFactory.
Definition at line 59 of file NamedFactory.h.
|
inlinevirtual |
Return an instance associated with the given name.
Implements WireCell::IFactory.
Definition at line 47 of file NamedFactory.h.
|
inlinevirtual |
Create an instance by name.
Implements WireCell::INamedFactory.
Definition at line 48 of file NamedFactory.h.
|
inlinevirtual |
Return existing instance of given name or nullptr if not found.
Implements WireCell::INamedFactory.
Definition at line 38 of file NamedFactory.h.
|
inlinevirtual |
Set name of class this factory can make.
Implements WireCell::INamedFactory.
Definition at line 58 of file NamedFactory.h.
|
private |
Definition at line 63 of file NamedFactory.h.
|
private |
Definition at line 62 of file NamedFactory.h.