Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
serialbox::stella::Savepoint Class Reference

Implementation of the STELLA Savepoint. More...

#include <Savepoint.h>

Public Member Functions

 Savepoint ()
 Construct empty savepoint with name name
 
void Init (const std::string &name)
 Initialize the savepoint. More...
 
 Savepoint (const boost::shared_ptr< SavepointImpl > &savepointImpl)
 Construct with SavepointImpl.
 
 Savepoint (const Savepoint &other)
 Copy constructor.
 
Savepointoperator= (const Savepoint &other)
 Copy assignment.
 
const std::string & name () const
 Access to the name.
 
const MetainfoSetmetainfo () const
 Access to the metainfo. More...
 
bool operator== (const Savepoint &other) const
 Compare equal.
 
bool operator!= (const Savepoint &other) const
 Compare unequal.
 
std::string ToString () const
 Convert to string.
 
void setImpl (const boost::shared_ptr< SavepointImpl > &savepointImpl)
 Set implementation pointer.
 
boost::shared_ptr< SavepointImpl > & getImpl ()
 Get implementation pointer.
 
const boost::shared_ptr< SavepointImpl > & getImpl () const
 
void AddMetainfo (const std::string &key, const bool &value)
 Add metainformation to the savepoint. More...
 
void AddMetainfo (const std::string &key, const int &value)
 
void AddMetainfo (const std::string &key, const float &value)
 
void AddMetainfo (const std::string &key, const double &value)
 
void AddMetainfo (const std::string &key, const std::string &value)
 
void AddMetainfo (const std::string &key, const char *value)
 

Friends

std::ostream & operator<< (std::ostream &out, const Savepoint &sp)
 Convert to stream.
 

Detailed Description

Implementation of the STELLA Savepoint.

Definition at line 30 of file Savepoint.h.

Member Function Documentation

◆ AddMetainfo()

void serialbox::stella::Savepoint::AddMetainfo ( const std::string &  key,
const bool &  value 
)

Add metainformation to the savepoint.

After this call a new key-value pair is registered as metainformation in the savepoint. The order in which the metainformation is added is irrelevant.

Parameters
keyThe key of the new metainformation
valueThe value of the new metainformaiton
Exceptions
SerializationExceptionThe key exists already

Definition at line 65 of file Savepoint.cpp.

◆ Init()

void serialbox::stella::Savepoint::Init ( const std::string &  name)

Initialize the savepoint.

This method prepares the savepoint for usage and gives a name, which is the only required information for the savepoint to be usable. Metainformation can be added after the initialization has been performed.

A savepoint can be initialized multiple times. In this case, every initialization removes all metainformation and sets a new name.

Parameters
nameThe name of the savepoint

Definition at line 40 of file Savepoint.cpp.

◆ metainfo()

const MetainfoSet& serialbox::stella::Savepoint::metainfo ( ) const
inline

Access to the metainfo.

The meta-information is constructed from the underlying MetainfoMapImpl of the SavepointImpl.

Definition at line 82 of file Savepoint.h.


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