26 template <
class KeyType,
class ValueType>
27 void insertHelper(boost::shared_ptr<SavepointImpl>& savepointImpl, KeyType&& key,
30 savepointImpl->addMetainfo(key, value);
31 }
catch(Exception& e) {
32 internal::throwSerializationException(
"Error: metainfo with key = %s exists already", key);
41 savepointImpl_ = boost::make_shared<SavepointImpl>(
name);
42 metainfo_.
setImpl(internal::make_shared_ptr<MetainfoMapImpl>(savepointImpl_->metaInfoPtr()));
46 : savepointImpl_(savepointImpl),
50 savepointImpl_ = other.savepointImpl_;
51 metainfo_.
setImpl(internal::make_shared_ptr<MetainfoMapImpl>(savepointImpl_->metaInfoPtr()));
60 *savepointImpl_ = *other.savepointImpl_;
61 metainfo_.
setImpl(internal::make_shared_ptr<MetainfoMapImpl>(savepointImpl_->metaInfoPtr()));
66 internal::insertHelper(savepointImpl_, key, value);
70 internal::insertHelper(savepointImpl_, key, value);
74 internal::insertHelper(savepointImpl_, key, value);
78 internal::insertHelper(savepointImpl_, key, value);
82 internal::insertHelper(savepointImpl_, key, value);
86 return (*savepointImpl_ == *other.savepointImpl_);
90 return (*savepointImpl_ != *other.savepointImpl_);
100 savepointImpl_ = savepointImpl;
101 metainfo_.
setImpl(internal::make_shared_ptr<MetainfoMapImpl>(savepointImpl_->metaInfoPtr()));
106 const boost::shared_ptr<SavepointImpl>&
Savepoint::getImpl()
const {
return savepointImpl_; }
void setImpl(const boost::shared_ptr< SavepointImpl > &savepointImpl)
Set implementation pointer.
Namespace of the STELLA frontend.
Namespace of the serialbox library.
bool operator==(const Savepoint &other) const
Compare equal.
void Init(const std::string &name)
Initialize the savepoint.
Implementation of the STELLA Savepoint.
Savepoint & operator=(const Savepoint &other)
Copy assignment.
void AddMetainfo(const std::string &key, const bool &value)
Add metainformation to the savepoint.
Savepoint()
Construct empty savepoint with name name
const std::string & name() const
Access to the name.
boost::shared_ptr< SavepointImpl > & getImpl()
Get implementation pointer.
friend std::ostream & operator<<(std::ostream &out, const Savepoint &sp)
Convert to stream.
bool operator!=(const Savepoint &other) const
Compare unequal.
std::string ToString() const
Convert to string.