lsst.daf.persistence
13.0-11-gfc17871
|
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... | |
Public Member Functions | |
virtual | ~Formatter (void) |
Minimal destructor. More... | |
virtual void | write (lsst::daf::base::Persistable const *persistable, Storage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Write a Persistable instance to a Storage instance. More... | |
virtual lsst::daf::base::Persistable * | read (Storage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Read a Persistable instance from a Storage instance. More... | |
virtual void | update (lsst::daf::base::Persistable *persistable, Storage::Ptr storage, lsst::daf::base::PropertySet::Ptr additionalData)=0 |
Update an existing Persistable instance with information from an additional Storage instance. More... | |
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... | |
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 Storage 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.
typedef std::shared_ptr<Formatter> lsst::daf::persistence::Formatter::Ptr |
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 |
|
pure virtual |
|
pure virtual |
Update an existing Persistable instance with information from an additional Storage instance.
|
pure virtual |