lsst.daf.persistence  16.0-2-g311bfd2
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst::daf::persistence::PropertySetFormatter Class Referenceabstract

Formatter for persistence of PropertySet instances. More...

#include <PropertySetFormatter.h>

Inheritance diagram for lsst::daf::persistence::PropertySetFormatter:
lsst::daf::persistence::Formatter lsst::daf::base::Citizen

Public Types

typedef std::shared_ptr< FormatterPtr
 
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 ~PropertySetFormatter (void)
 Minimal destructor. More...
 
virtual void write (dafBase::Persistable const *persistable, dafPersist::FormatterStorage::Ptr storage, dafBase::PropertySet::Ptr additionalData)
 
virtual dafBase::Persistableread (dafPersist::FormatterStorage::Ptr storage, dafBase::PropertySet::Ptr additionalData)
 
virtual void update (dafBase::Persistable *persistable, dafPersist::FormatterStorage::Ptr storage, dafBase::PropertySet::Ptr additionalData)
 
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::Persistableread (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

template<class Archive >
static void delegateSerialize (Archive &ar, unsigned int const version, dafBase::Persistable *persistable)
 Serialize a PropertySet to a Boost archive. More...
 
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
 

Detailed Description

Formatter for persistence of PropertySet instances.

Definition at line 58 of file PropertySetFormatter.h.

Member Typedef Documentation

◆ FactoryPtr

typedef Ptr(* lsst::daf::persistence::Formatter::FactoryPtr) (lsst::pex::policy::Policy::Ptr)
inherited

Pointer to a (static) factory function for a Formatter subclass.

Definition at line 85 of file Formatter.h.

◆ Ptr

Definition at line 81 of file Formatter.h.

Constructor & Destructor Documentation

◆ ~PropertySetFormatter()

lsst::daf::persistence::PropertySetFormatter::~PropertySetFormatter ( void  )
virtual

Minimal destructor.

Definition at line 92 of file PropertySetFormatter.cc.

Member Function Documentation

◆ delegateSerialize()

template<class Archive >
void lsst::daf::persistence::PropertySetFormatter::delegateSerialize ( Archive &  ar,
unsigned int const  version,
dafBase::Persistable persistable 
)
static

Serialize a PropertySet to a Boost archive.

Handles text or XML archives, input or output.

Parameters
[in,out]arBoost archive
[in]versionVersion of the PropertySet class
[in,out]persistablePointer to the PropertySet as a Persistable

Definition at line 114 of file PropertySetFormatter.cc.

◆ lookupFormatter() [1/2]

Formatter::Ptr lsst::daf::persistence::Formatter::lookupFormatter ( std::string const &  name,
lsst::pex::policy::Policy::Ptr  policy 
)
staticinherited

Lookup Formatter subclass by name of Persistable subclass.

Parameters
[in]nameName of Persistable subclass
[in]policyPolicy for configuring the Formatter
Returns
Shared pointer to Formatter instance

Returned pointer is not owned and should not be deleted.

Definition at line 84 of file Formatter.cc.

◆ lookupFormatter() [2/2]

Formatter::Ptr lsst::daf::persistence::Formatter::lookupFormatter ( std::type_info const &  type,
lsst::pex::policy::Policy::Ptr  policy 
)
staticinherited

Lookup Formatter subclass by its type_info from typeid().

Parameters
[in]typestd::type_info of Formatter subclass from typeid()
[in]policyPolicy for configuring the Formatter
Returns
Shared pointer to Formatter instance

Definition at line 94 of file Formatter.cc.

◆ read() [1/2]

dafBase::Persistable * lsst::daf::persistence::PropertySetFormatter::read ( dafPersist::FormatterStorage::Ptr  storage,
dafBase::PropertySet::Ptr  additionalData 
)
virtual

Definition at line 125 of file PropertySetFormatter.cc.

◆ read() [2/2]

virtual lsst::daf::base::Persistable* lsst::daf::persistence::Formatter::read ( FormatterStorage::Ptr  storage,
lsst::daf::base::PropertySet::Ptr  additionalData 
)
pure virtualinherited

Read a Persistable instance from a FormatterStorage instance.

Parameters
[in]storagePointer to the FormatterStorage instance.
[in]additionalDataAdditional data used to find the proper instance within the FormatterStorage.
Returns
Shared pointer to the new Persistable instance.

◆ update() [1/2]

void lsst::daf::persistence::PropertySetFormatter::update ( dafBase::Persistable persistable,
dafPersist::FormatterStorage::Ptr  storage,
dafBase::PropertySet::Ptr  additionalData 
)
virtual

Definition at line 148 of file PropertySetFormatter.cc.

◆ update() [2/2]

virtual void lsst::daf::persistence::Formatter::update ( lsst::daf::base::Persistable persistable,
FormatterStorage::Ptr  storage,
lsst::daf::base::PropertySet::Ptr  additionalData 
)
pure virtualinherited

Update an existing Persistable instance with information from an additional FormatterStorage instance.

Parameters
[in,out]persistablePointer to the Persistable instance.
[in]storageShared pointer to the additional FormatterStorage instance.
[in]additionalDataAdditional data used to find the proper instance within the FormatterStorage.

◆ write() [1/2]

void lsst::daf::persistence::PropertySetFormatter::write ( dafBase::Persistable const *  persistable,
dafPersist::FormatterStorage::Ptr  storage,
dafBase::PropertySet::Ptr  additionalData 
)
virtual

Definition at line 95 of file PropertySetFormatter.cc.

◆ write() [2/2]

virtual void lsst::daf::persistence::Formatter::write ( lsst::daf::base::Persistable const *  persistable,
FormatterStorage::Ptr  storage,
lsst::daf::base::PropertySet::Ptr  additionalData 
)
pure virtualinherited

Write a Persistable instance to a FormatterStorage instance.

Parameters
[in]persistablePointer to the Persistable instance.
[in]storageShared pointer to the FormatterStorage instance.
[in]additionalDataAdditional data used to find the proper place to put the instance into the FormatterStorage.

The documentation for this class was generated from the following files: