Functions | |
template<class IType > | |
bool | associate (const std::string &classname, WireCell::INamedFactory *factory) |
Associate a factory with the type it makes. More... | |
template<class IType > | |
WireCell::INamedFactory * | lookup_factory (const std::string &classname) |
Lookup up a factory for the given type. More... | |
template<class IType > | |
std::shared_ptr< IType > | lookup (const std::string &classname, const std::string &instname="", bool create=true, bool nullok=false) |
template<class IType > | |
std::shared_ptr< IType > | find (const std::string &classname, const std::string &instname="") |
template<class IType > | |
std::shared_ptr< IType > | find_maybe (const std::string &classname, const std::string &instname="") |
As above but quietly returns nullptr on failure. More... | |
template<class IType > | |
std::shared_ptr< IType > | lookup_tn (const std::string &tn, bool create=true, bool nullok=false) |
Lookup an interface by a type:name pair. More... | |
template<class IType > | |
std::shared_ptr< IType > | find_tn (const std::string &tn) |
Like lookup_tn but with create false. More... | |
template<class IType > | |
std::shared_ptr< IType > | find_maybe_tn (const std::string &tn) |
Like find_tn but with nullok true. More... | |
template<class IType > | |
std::vector< std::string > | known_classes () |
Return a vector of all known classes of given interface. More... | |
template<class IType > | |
std::vector< std::string > | known_types () |
Singleton interface.
bool WireCell::Factory::associate | ( | const std::string & | classname, |
WireCell::INamedFactory * | factory | ||
) |
Associate a factory with the type it makes.
Definition at line 210 of file NamedFactory.h.
std::shared_ptr<IType> WireCell::Factory::find | ( | const std::string & | classname, |
const std::string & | instname = "" |
||
) |
Return existing instance of given classname with instname Throws on failure.
Definition at line 247 of file NamedFactory.h.
std::shared_ptr<IType> WireCell::Factory::find_maybe | ( | const std::string & | classname, |
const std::string & | instname = "" |
||
) |
As above but quietly returns nullptr on failure.
Definition at line 253 of file NamedFactory.h.
std::shared_ptr<IType> WireCell::Factory::find_maybe_tn | ( | const std::string & | tn | ) |
Like find_tn but with nullok true.
Definition at line 281 of file NamedFactory.h.
std::shared_ptr<IType> WireCell::Factory::find_tn | ( | const std::string & | tn | ) |
Like lookup_tn but with create false.
Definition at line 275 of file NamedFactory.h.
std::vector<std::string> WireCell::Factory::known_classes | ( | ) |
Return a vector of all known classes of given interface.
Definition at line 288 of file NamedFactory.h.
std::vector<std::string> WireCell::Factory::known_types | ( | ) |
Definition at line 294 of file NamedFactory.h.
std::shared_ptr<IType> WireCell::Factory::lookup | ( | const std::string & | classname, |
const std::string & | instname = "" , |
||
bool | create = true , |
||
bool | nullok = false |
||
) |
Lookup an interface by a type and optional name. If create is true, create instance if missing. if nullok is true return nullptr if can not create. See also find<IType>().
Definition at line 233 of file NamedFactory.h.
WireCell::INamedFactory* WireCell::Factory::lookup_factory | ( | const std::string & | classname | ) |
Lookup up a factory for the given type.
Definition at line 220 of file NamedFactory.h.
std::shared_ptr<IType> WireCell::Factory::lookup_tn | ( | const std::string & | tn, |
bool | create = true , |
||
bool | nullok = false |
||
) |
Lookup an interface by a type:name pair.
Definition at line 260 of file NamedFactory.h.