lsst.daf.persistence
13.0-11-gfc17871
|
Class that registers all Formatter subclasses. More...
#include <FormatterRegistry.h>
Public Member Functions | |
void | registerFormatter (std::string const &persistableName, std::type_info const &persistableType, Formatter::FactoryPtr factory) |
Register a factory for a Formatter subclass using the name and type of the Persistable subclass it formats. More... | |
Formatter::Ptr | lookupFormatter (std::type_info const &persistableType, lsst::pex::policy::Policy::Ptr policy) |
Create a new instance of a Formatter subclass given the typeid() of its corresponding Persistable subclass. More... | |
Formatter::Ptr | lookupFormatter (std::string const &persistableName, lsst::pex::policy::Policy::Ptr policy) |
Create a new instance of a Formatter subclass given the string name of its corresponding Persistable subclass. More... | |
Static Public Member Functions | |
static FormatterRegistry & | getInstance (void) |
Get a reference to the singleton instance of the FormatterRegistry. More... | |
Class that registers all Formatter subclasses.
Allows lookup by Persistable type_info or name.
Definition at line 53 of file FormatterRegistry.h.
|
static |
Get a reference to the singleton instance of the FormatterRegistry.
Uses function-scoped static to ensure proper initialization.
Definition at line 56 of file FormatterRegistry.cc.
Formatter::Ptr lsst::daf::persistence::FormatterRegistry::lookupFormatter | ( | std::type_info const & | persistableType, |
lsst::pex::policy::Policy::Ptr | policy | ||
) |
Create a new instance of a Formatter subclass given the typeid() of its corresponding Persistable subclass.
[in] | persistableType | typeid() of the Persistable subclass |
[in] | policy | Policy containing all Formatter policies |
Definition at line 81 of file FormatterRegistry.cc.
Formatter::Ptr lsst::daf::persistence::FormatterRegistry::lookupFormatter | ( | std::string const & | persistableName, |
lsst::pex::policy::Policy::Ptr | policy | ||
) |
Create a new instance of a Formatter subclass given the string name of its corresponding Persistable subclass.
[in] | persistableName | Name of the Persistable subclass |
[in] | policy | Policy containing all Formatter policies |
Definition at line 99 of file FormatterRegistry.cc.
void lsst::daf::persistence::FormatterRegistry::registerFormatter | ( | std::string const & | persistableName, |
std::type_info const & | persistableType, | ||
Formatter::FactoryPtr | factory | ||
) |
Register a factory for a Formatter subclass using the name and type of the Persistable subclass it formats.
[in] | persistableName | Name of the Persistable subclass |
[in] | persistableType | typeid() of the Persistable subclass |
[in] | factory | Factory function for the Formatter, taking a Policy |
Definition at line 67 of file FormatterRegistry.cc.