lsst.daf.persistence  15.0-9-g1e7c341+3
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst::daf::persistence::Persistence Class Reference

Class implementing object persistence. More...

#include <Persistence.h>

Inheritance diagram for lsst::daf::persistence::Persistence:
lsst::daf::base::Citizen

Public Types

typedef std::shared_ptr< PersistencePtr
 
typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

virtual ~Persistence (void)
 Destructor. More...
 
virtual FormatterStorage::Ptr getPersistStorage (std::string const &storageType, LogicalLocation const &location)
 Create a FormatterStorage subclass configured to persist to a location. More...
 
virtual FormatterStorage::Ptr getRetrieveStorage (std::string const &storageType, LogicalLocation const &location)
 Create a FormatterStorage subclass configured to retrieve from a location. More...
 
virtual void persist (lsst::daf::base::Persistable const &persistable, FormatterStorage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData)
 Persist a Persistable instance. More...
 
virtual lsst::daf::base::Persistable::Ptr retrieve (std::string const &persistableType, FormatterStorage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData)
 Retrieve a Persistable instance. More...
 
virtual lsst::daf::base::PersistableunsafeRetrieve (std::string const &persistableType, FormatterStorage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData)
 Retrieve a Persistable instance, returning an unsafe bare pointer. More...
 
lsst::pex::policy::Policy::Ptr getPolicy () const
 Return the policy used to configure the Persistence object. More...
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 

Static Public Member Functions

static Ptr getPersistence (lsst::pex::policy::Policy::Ptr policy)
 Create a Persistence object. 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

Class implementing object persistence.

This class persists and retrieves objects by calling Formatter subclasses with a sequence of FormatterStorage subclasses that have been configured with LogicalLocations. This class handles all transaction semantics by starting per-FormatterStorage transactions, detecting failures, and causing the FormatterStorage subclasses to roll back if necessary.

Definition at line 68 of file Persistence.h.

Member Typedef Documentation

◆ Ptr

Definition at line 70 of file Persistence.h.

Constructor & Destructor Documentation

◆ ~Persistence()

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

Destructor.

Definition at line 66 of file Persistence.cc.

Member Function Documentation

◆ getPersistence()

Persistence::Ptr lsst::daf::persistence::Persistence::getPersistence ( lsst::pex::policy::Policy::Ptr  policy)
static

Create a Persistence object.

Parameters
[in]policyPolicy to configure the Persistence object
Returns
Pointer to a Persistence instance

Definition at line 196 of file Persistence.cc.

◆ getPersistStorage()

FormatterStorage::Ptr lsst::daf::persistence::Persistence::getPersistStorage ( std::string const &  storageType,
LogicalLocation const &  location 
)
virtual

Create a FormatterStorage subclass configured to persist to a location.

Parameters
[in]storageTypeName of FormatterStorage subclass as registered in StorageRegistry
[in]locationLocation to persist to (subclass-specific)

Definition at line 91 of file Persistence.cc.

◆ getPolicy()

lsst::pex::policy::Policy::Ptr lsst::daf::persistence::Persistence::getPolicy ( ) const

Return the policy used to configure the Persistence object.

Returns
Pointer to Policy

Definition at line 205 of file Persistence.cc.

◆ getRetrieveStorage()

FormatterStorage::Ptr lsst::daf::persistence::Persistence::getRetrieveStorage ( std::string const &  storageType,
LogicalLocation const &  location 
)
virtual

Create a FormatterStorage subclass configured to retrieve from a location.

Parameters
[in]storageTypeName of FormatterStorage subclass as registered in StorageRegistry
[in]locationLocation to retrieve from (subclass-specific)

Definition at line 101 of file Persistence.cc.

◆ persist()

void lsst::daf::persistence::Persistence::persist ( lsst::daf::base::Persistable const &  persistable,
FormatterStorage::List const &  storageList,
lsst::daf::base::PropertySet::Ptr  additionalData 
)
virtual

Persist a Persistable instance.

Parameters
[in]persistableThe Persistable instance
[in]storageListList of storages to persist to (in order)
[in]additionalDataAdditional information needed to determine the correct place to put data in any of the Storages

Definition at line 112 of file Persistence.cc.

◆ retrieve()

lsst::daf::base::Persistable::Ptr lsst::daf::persistence::Persistence::retrieve ( std::string const &  persistableType,
FormatterStorage::List const &  storageList,
lsst::daf::base::PropertySet::Ptr  additionalData 
)
virtual

Retrieve a Persistable instance.

Parameters
[in]persistableTypeName of Persistable type to be retrieved as registered by its Formatter
[in]storageListList of storages to retrieve from (in order)
[in]additionalDataAdditional information needed to select the correct data from any of the FormatterStorages
Returns
Shared pointer to new Persistable instance

Definition at line 185 of file Persistence.cc.

◆ unsafeRetrieve()

lsst::daf::base::Persistable * lsst::daf::persistence::Persistence::unsafeRetrieve ( std::string const &  persistableType,
FormatterStorage::List const &  storageList,
lsst::daf::base::PropertySet::Ptr  additionalData 
)
virtual

Retrieve a Persistable instance, returning an unsafe bare pointer.

Intended for use by SWIG/Python only.

Parameters
[in]persistableTypeName of Persistable type to be retrieved as registered by its Formatter
[in]storageListList of storages to retrieve from (in order)
[in]additionalDataAdditional information needed to select the correct data from any of the Storages
Returns
Bare pointer to new Persistable instance

Definition at line 147 of file Persistence.cc.


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