lsst.daf.persistence
15.0-6-g4cfb9db
|
Class that registers all Formatter subclasses. More...
#include <FormatterRegistry.h>
Public Types | |
typedef unsigned long | memId |
typedef memId(* | memNewCallback) (const memId cid) |
typedef memId(* | memCallback) (const Citizen *ptr) |
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... | |
std::string | repr () const |
void | markPersistent (void) |
memId | getId () const |
Static Public Member Functions | |
static FormatterRegistry & | getInstance (void) |
Get a reference to the singleton instance of the FormatterRegistry. More... | |
static bool | hasBeenCorrupted () |
static memId | getNextMemId () |
static int | init () |
static int | census (int, memId startingMemId=0) |
static void | census (std::ostream &stream, memId startingMemId=0) |
static const std::vector< const Citizen *> * | census () |
static int | census (int, memId startingMemId=0) |
static void | census (std::ostream &stream, memId startingMemId=0) |
static const std::vector< const Citizen *> * | census () |
static memId | setNewCallbackId (memId id) |
static memId | setNewCallbackId (memId id) |
static memId | setDeleteCallbackId (memId id) |
static memId | setDeleteCallbackId (memId id) |
static memNewCallback | setNewCallback (memNewCallback func) |
static memCallback | setDeleteCallback (memCallback func) |
static memCallback | setCorruptionCallback (memCallback func) |
Public Attributes | |
magicSentinel | |
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.