39 # define __attribute__(x)
45 #include <boost/regex.hpp>
55 namespace persistence {
61 lsst::daf::base::Citizen(typeid(*this)), _policy(policy) {
81 policyPtr =
_policy->getPolicy(storageType);
116 std::string policyName =
"Formatter";
119 policyPtr =
_policy->getPolicy(policyName);
127 for (Storage::List::const_iterator it = storageList.begin();
128 it != storageList.end(); ++it) {
129 (*it)->startTransaction();
130 f->write(&persistable, *it, additionalData);
132 for (Storage::List::const_iterator it = storageList.begin();
133 it != storageList.end(); ++it) {
134 (*it)->endTransaction();
148 std::string
const& persistableType,
Storage::List const& storageList,
151 std::string policyName =
"Formatter";
154 policyPtr =
_policy->getPolicy(policyName);
161 for (Storage::List::const_iterator it = storageList.begin();
162 it != storageList.end(); ++it) {
163 (*it)->startTransaction();
165 persistable = f->read(*it, additionalData);
167 f->update(persistable, *it, additionalData);
170 for (Storage::List::const_iterator it = storageList.begin();
171 it != storageList.end(); ++it) {
172 (*it)->endTransaction();
186 std::string
const& persistableType,
Storage::List const& storageList,
Persistence(lsst::pex::policy::Policy::Ptr policy)
static Ptr getPersistence(lsst::pex::policy::Policy::Ptr policy)
virtual lsst::daf::base::Persistable * unsafeRetrieve(std::string const &persistableType, Storage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData)
Class for logical location of a persisted Persistable instance.
virtual Storage::Ptr getRetrieveStorage(std::string const &storageType, LogicalLocation const &location)
boost::shared_ptr< PropertySet > Ptr
boost::shared_ptr< Policy > Ptr
Storage::Ptr _getStorage(std::string const &storageType, LogicalLocation const &location, bool persist)
virtual lsst::daf::base::Persistable::Ptr retrieve(std::string const &persistableType, Storage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData)
Interface for Storage abstract base class.
virtual ~Persistence(void)
static Ptr createInstance(std::string const &name, LogicalLocation const &location, bool persist, lsst::pex::policy::Policy::Ptr policy)
Interface for Persistence class.
lsst::pex::policy::Policy::Ptr _policy
Pointer to Policy used to configure Persistence.
virtual Storage::Ptr getPersistStorage(std::string const &storageType, LogicalLocation const &location)
boost::shared_ptr< Persistable > Ptr
boost::shared_ptr< Persistence > Ptr
Interface for Persistable base class.
virtual void persist(lsst::daf::base::Persistable const &persistable, Storage::List const &storageList, lsst::daf::base::PropertySet::Ptr additionalData)
boost::shared_ptr< Storage > Ptr
Base class for all persistable classes.
Interface for LogicalLocation class.
lsst::pex::policy::Policy::Ptr getPolicy() const