39 # define __attribute__(x)
45 #include <boost/format.hpp>
53 namespace persistence {
58 _ostream{}, _istream{}, _oarchive{}, _iarchive{} {
77 _ostream.reset(
new std::ofstream(location.
locString().c_str()));
78 _oarchive.reset(
new boost::archive::text_oarchive(*_ostream));
85 char const* fname = location.
locString().c_str();
86 if (::access(fname, R_OK | F_OK) != 0) {
87 throw LSST_EXCEPT(pexExcept::NotFoundError,
88 (boost::format(
"Unable to access file: %1%")
91 _istream.reset(
new std::ifstream(fname));
92 _iarchive.reset(
new boost::archive::text_iarchive(*_istream));
Class for logical location of a persisted Persistable instance.
virtual boost::archive::text_iarchive & getIArchive(void)
Get a boost::serialization archive suitable for input.
virtual void setRetrieveLocation(LogicalLocation const &location)
Set the source of the serialization file for retrieval.
std::string const & locString(void) const
Accessor.
virtual ~BoostStorage(void)
Destructor.
BoostStorage(void)
Constructor.
virtual void startTransaction(void)
Start a transaction.
virtual boost::archive::text_oarchive & getOArchive(void)
Get a boost::serialization archive suitable for output.
virtual void endTransaction(void)
End a transaction.
Interface for LogicalLocation class.
virtual void setPolicy(lsst::pex::policy::Policy::Ptr policy)
Allow a Policy to be used to configure the BoostStorage.
virtual void setPersistLocation(LogicalLocation const &location)
Set the destination of the serialization file for persistence.
Interface for BoostStorage class.