lsst.daf.persistence
16.0-3-g3806c63+8
|
Abstract base class for all formatters. More...
#include <Formatter.h>
Public Types | |
typedef std::shared_ptr< Formatter > | Ptr |
typedef Ptr(* | FactoryPtr) (lsst::pex::policy::Policy::Ptr) |
Pointer to a (static) factory function for a Formatter subclass. More... | |
typedef unsigned long | memId |
typedef memId(* | memNewCallback) (const memId cid) |
typedef memId(* | memCallback) (const Citizen *ptr) |
Public Member Functions | |
virtual | ~Formatter (void) |
Minimal destructor. More... | |
virtual void | write (lsst::daf::base::Persistable const *persistable, FormatterStorage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Write a Persistable instance to a FormatterStorage instance. More... | |
virtual lsst::daf::base::Persistable * | read (FormatterStorage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Read a Persistable instance from a FormatterStorage instance. More... | |
virtual void | update (lsst::daf::base::Persistable *persistable, FormatterStorage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Update an existing Persistable instance with information from an additional FormatterStorage instance. More... | |
std::string | repr () const |
void | markPersistent (void) |
memId | getId () const |
Static Public Member Functions | |
static Formatter::Ptr | lookupFormatter (std::string const &persistableType, lsst::pex::policy::Policy::Ptr policy) |
Lookup Formatter subclass by name of Persistable subclass. More... | |
static Formatter::Ptr | lookupFormatter (std::type_info const &persistableType, lsst::pex::policy::Policy::Ptr policy) |
Lookup Formatter subclass by its type_info from typeid(). 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 | |
Protected Member Functions | |
Formatter (std::type_info const &type) | |
Constructor. More... | |
Abstract base class for all formatters.
Formatters map Persistable subclasses into an appropriate form for output to FormatterStorage subclasses and vice versa upon retrieval. They also may use an additional piece of data to select the appropriate data for retrieval.
Subclasses of Formatter must register themselves by creating a static instance of the FormatterRegistration class with the name and type_info of the Persistable class they are formatting and a factory method to create instances of the subclass using a Policy. If they are to be used with boost::serialization, subclasses of Formatter must also implement a public static delegateSerialize() template (or a set of static delegateSerialize() functions for each supported archive type).
Definition at line 79 of file Formatter.h.
typedef Ptr(* lsst::daf::persistence::Formatter::FactoryPtr) (lsst::pex::policy::Policy::Ptr) |
Pointer to a (static) factory function for a Formatter subclass.
Definition at line 85 of file Formatter.h.
Definition at line 81 of file Formatter.h.
|
virtual |
Minimal destructor.
Definition at line 74 of file Formatter.cc.
|
explicitprotected |
|
static |
Lookup Formatter subclass by name of Persistable subclass.
[in] | name | Name of Persistable subclass |
[in] | policy | Policy for configuring the Formatter |
Returned pointer is not owned and should not be deleted.
Definition at line 84 of file Formatter.cc.
|
static |
Lookup Formatter subclass by its type_info from typeid().
[in] | type | std::type_info of Formatter subclass from typeid() |
[in] | policy | Policy for configuring the Formatter |
Definition at line 94 of file Formatter.cc.
|
pure virtual |
Read a Persistable instance from a FormatterStorage instance.
[in] | storage | Pointer to the FormatterStorage instance. |
[in] | additionalData | Additional data used to find the proper instance within the FormatterStorage. |
|
pure virtual |
Update an existing Persistable instance with information from an additional FormatterStorage instance.
[in,out] | persistable | Pointer to the Persistable instance. |
[in] | storage | Shared pointer to the additional FormatterStorage instance. |
[in] | additionalData | Additional data used to find the proper instance within the FormatterStorage. |
|
pure virtual |
Write a Persistable instance to a FormatterStorage instance.
[in] | persistable | Pointer to the Persistable instance. |
[in] | storage | Shared pointer to the FormatterStorage instance. |
[in] | additionalData | Additional data used to find the proper place to put the instance into the FormatterStorage. |