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 implementing object persistence. More...
#include <Persistence.h>
Public Types | |
typedef boost::shared_ptr < Persistence > | Ptr |
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) |
Public Member Functions | |
virtual | ~Persistence (void) |
virtual Storage::Ptr | getPersistStorage (std::string const &storageType, LogicalLocation const &location) |
virtual Storage::Ptr | getRetrieveStorage (std::string const &storageType, LogicalLocation const &location) |
virtual void | persist (lsst::daf::base::Persistable const &persistable, Storage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData) |
virtual lsst::daf::base::Persistable::Ptr | retrieve (std::string const &persistableType, Storage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData) |
virtual lsst::daf::base::Persistable * | unsafeRetrieve (std::string const &persistableType, Storage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData) |
lsst::pex::policy::Policy::Ptr | getPolicy () const |
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 Ptr | getPersistence (lsst::pex::policy::Policy::Ptr policy) |
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 Member Functions | |
Persistence (lsst::pex::policy::Policy::Ptr policy) | |
Persistence (Persistence const &) | |
Persistence & | operator= (Persistence const &) |
Storage::Ptr | _getStorage (std::string const &storageType, LogicalLocation const &location, bool persist) |
Private Attributes | |
lsst::pex::policy::Policy::Ptr | _policy |
Pointer to Policy used to configure Persistence. More... | |
Class implementing object persistence.
This class persists and retrieves objects by calling Formatter subclasses with a sequence of Storage subclasses that have been configured with LogicalLocations. This class handles all transaction semantics by starting per-Storage transactions, detecting failures, and causing the Storage subclasses to roll back if necessary.
Definition at line 68 of file Persistence.h.
typedef boost::shared_ptr<Persistence> lsst::daf::persistence::Persistence::Ptr |
Definition at line 70 of file Persistence.h.
|
virtual |
|
explicitprivate |
Constructor.
[in] | policy | Policy to configure the Persistence object |
Definition at line 60 of file Persistence.cc.
|
private |
|
private |
Create a Storage subclass configured for a particular access.
[in] | storageType | Name of Storage subclass as registered in StorageRegistry |
[in] | location | Location to persist to or retrieve from (subclass-specific) |
[in] | persist | True if persisting, false if retrieving |
Definition at line 76 of file Persistence.cc.
|
static |
Create a Persistence object.
[in] | policy | Policy to configure the Persistence object |
Definition at line 196 of file Persistence.cc.
|
virtual |
Create a Storage subclass configured to persist to a location.
[in] | storageType | Name of Storage subclass as registered in StorageRegistry |
[in] | location | Location to persist to (subclass-specific) |
Definition at line 91 of file Persistence.cc.
lsst::pex::policy::Policy::Ptr lsst::daf::persistence::Persistence::getPolicy | ( | ) | const |
Return the policy used to configure the Persistence object
Definition at line 205 of file Persistence.cc.
|
virtual |
Create a Storage subclass configured to retrieve from a location.
[in] | storageType | Name of Storage subclass as registered in StorageRegistry |
[in] | location | Location to retrieve from (subclass-specific) |
Definition at line 101 of file Persistence.cc.
|
private |
|
virtual |
Persist a Persistable instance.
[in] | persistable | The Persistable instance |
[in] | storageList | List of storages to persist to (in order) |
[in] | additionalData | Additional information needed to determine the correct place to put data in any of the Storages |
Definition at line 112 of file Persistence.cc.
|
virtual |
Retrieve a Persistable instance.
[in] | persistableType | Name of Persistable type to be retrieved as registered by its Formatter |
[in] | storageList | List of storages to retrieve from (in order) |
[in] | additionalData | Additional information needed to select the correct data from any of the Storages |
Definition at line 185 of file Persistence.cc.
|
virtual |
Retrieve a Persistable instance, returning an unsafe bare pointer. Intended for use by SWIG/Python only.
[in] | persistableType | Name of Persistable type to be retrieved as registered by its Formatter |
[in] | storageList | List of storages to retrieve from (in order) |
[in] | additionalData | Additional information needed to select the correct data from any of the Storages |
Definition at line 147 of file Persistence.cc.
|
private |
Pointer to Policy used to configure Persistence.
Definition at line 103 of file Persistence.h.