#include <NamedFactory.h>
Public Types | |
typedef IType | interface_type |
typedef std::shared_ptr< IType > | interface_ptr |
typedef WireCell::INamedFactory * | factory_ptr |
typedef std::unordered_map< std::string, factory_ptr > | factory_lookup |
typedef std::set< std::string > | known_type_set |
Public Member Functions | |
NamedFactoryRegistry () | |
size_t | hello (const std::string &classname) |
known_type_set | known_types () const |
bool | associate (const std::string &classname, factory_ptr factory) |
Register an existing factory by the "class" name of the instance it can create. More... | |
factory_ptr | lookup_factory (const std::string &classname) |
Look up an existing factory by the name of the "class" it can create. More... | |
interface_ptr | instance (const std::string &classname, const std::string &instname="", bool create=true, bool nullok=false) |
std::vector< std::string > | known_classes () |
Private Attributes | |
Log::logptr_t | l |
factory_lookup | m_lookup |
known_type_set | m_known_types |
A registry of factories that produce instances which implement a given interface.
Definition at line 71 of file NamedFactory.h.
typedef std::unordered_map<std::string, factory_ptr> WireCell::NamedFactoryRegistry< IType >::factory_lookup |
Definition at line 77 of file NamedFactory.h.
typedef WireCell::INamedFactory* WireCell::NamedFactoryRegistry< IType >::factory_ptr |
Definition at line 76 of file NamedFactory.h.
typedef std::shared_ptr<IType> WireCell::NamedFactoryRegistry< IType >::interface_ptr |
Definition at line 75 of file NamedFactory.h.
typedef IType WireCell::NamedFactoryRegistry< IType >::interface_type |
Definition at line 74 of file NamedFactory.h.
typedef std::set<std::string> WireCell::NamedFactoryRegistry< IType >::known_type_set |
Definition at line 78 of file NamedFactory.h.
|
inline |
Definition at line 80 of file NamedFactory.h.
|
inline |
Register an existing factory by the "class" name of the instance it can create.
Definition at line 88 of file NamedFactory.h.
|
inline |
Definition at line 81 of file NamedFactory.h.
|
inline |
Return instance of give type and optional instance name. If create is true, create the instance if it does not exist. If nullok is true return nullptr if it does not exist else throw by default.
Definition at line 141 of file NamedFactory.h.
|
inline |
Return a collection of class names known to this factory registry. Note: linked/plugged shared libraries do not automatically register their factories.
Definition at line 191 of file NamedFactory.h.
|
inline |
Definition at line 85 of file NamedFactory.h.
|
inline |
Look up an existing factory by the name of the "class" it can create.
Definition at line 95 of file NamedFactory.h.
|
private |
Definition at line 72 of file NamedFactory.h.
|
private |
Definition at line 202 of file NamedFactory.h.
|
private |
Definition at line 201 of file NamedFactory.h.