|
LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
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) |
| Formatter::Ptr | lookupFormatter (std::type_info const &persistableType, lsst::pex::policy::Policy::Ptr policy) |
| Formatter::Ptr | lookupFormatter (std::string const &persistableName, lsst::pex::policy::Policy::Ptr policy) |
Public Member Functions inherited from lsst::daf::base::Citizen | |
| Citizen (const std::type_info &) | |
| Citizen (Citizen const &) | |
| ~Citizen () | |
| Citizen & | operator= (Citizen const &) |
| std::string | repr () const |
| Return a string representation of a Citizen. More... | |
| void | markPersistent (void) |
| Mark a Citizen as persistent and not destroyed until process end. More... | |
| memId | getId () const |
| Return the Citizen's ID. More... | |
Static Public Member Functions | |
| static FormatterRegistry & | getInstance (void) |
Static Public Member Functions inherited from lsst::daf::base::Citizen | |
| static bool | hasBeenCorrupted () |
| Check all allocated blocks for corruption. More... | |
| static memId | getNextMemId () |
| Return the memId of the next object to be allocated. More... | |
| static int | init () |
| Called once when the memory system is being initialised. More... | |
| static int | census (int, memId startingMemId=0) |
| How many active Citizens are there? More... | |
| static void | census (std::ostream &stream, memId startingMemId=0) |
| Print a list of all active Citizens to stream, sorted by ID. More... | |
| static const std::vector < const Citizen * > * | census () |
| Return a (newly allocated) std::vector of active Citizens sorted by ID. More... | |
| static memId | setNewCallbackId (memId id) |
| Call the NewCallback when block is allocated. More... | |
| static memId | setDeleteCallbackId (memId id) |
| Call the current DeleteCallback when block is deleted. More... | |
| static memNewCallback | setNewCallback (memNewCallback func) |
| Set the NewCallback function. More... | |
| static memCallback | setDeleteCallback (memCallback func) |
| Set the DeleteCallback function. More... | |
| static memCallback | setCorruptionCallback (memCallback func) |
| Set the CorruptionCallback function. More... | |
Private Types | |
| typedef std::map< std::string, Formatter::FactoryPtr > | FactoryMap |
| typedef std::map< std::string, std::string > | StringMap |
Private Member Functions | |
| FormatterRegistry (void) | |
| ~FormatterRegistry (void) | |
| FormatterRegistry (FormatterRegistry const &) | |
| FormatterRegistry & | operator= (FormatterRegistry const &) |
Private Attributes | |
| FactoryMap | _byName |
| Registry of Formatter factories by Persistable name. More... | |
| StringMap | _nameForType |
| Registry of Persistable names by std::type_info::name(). More... | |
Additional Inherited Members | |
Public Types inherited from lsst::daf::base::Citizen | |
| enum | { magicSentinel = 0xdeadbeef } |
| typedef unsigned long | memId |
| Type of the block's ID. More... | |
| typedef memId(* | memNewCallback )(const memId cid) |
| A function used to register a callback. More... | |
| typedef memId(* | memCallback )(const Citizen *ptr) |
Class that registers all Formatter subclasses.
Allows lookup by Persistable type_info or name.
Definition at line 53 of file FormatterRegistry.h.
|
private |
Definition at line 66 of file FormatterRegistry.h.
|
private |
Definition at line 67 of file FormatterRegistry.h.
|
private |
Default constructor.
Definition at line 117 of file FormatterRegistry.cc.
|
private |
|
private |
|
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.
|
private |
| 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.
|
private |
Registry of Formatter factories by Persistable name.
Definition at line 76 of file FormatterRegistry.h.
|
private |
Registry of Persistable names by std::type_info::name().
Definition at line 78 of file FormatterRegistry.h.
1.8.5