Savepoint implemenation of the gridtools frontend. More...
#include <Savepoint.h>
Public Member Functions | |
savepoint (const std::string &name) | |
Construct a savepoint. More... | |
savepoint (const std::string &name, meta_info_map meta_info) | |
Construct savepoint with name and metaInfo More... | |
savepoint (const savepoint &other)=default | |
Copy constructor. More... | |
savepoint (savepoint &&)=default | |
Move constructor. | |
savepoint & | operator= (const savepoint &other)=default |
Copy assignment. More... | |
savepoint & | operator= (savepoint &&)=default |
Move assignment. | |
savepoint | clone () const |
Clone the current savepoint object by performing a deep copy. More... | |
savepoint (const std::shared_ptr< SavepointImpl > &savepoint_impl) | |
Construct with SavepointImpl (internal use) | |
template<class StringType , class ValueType > | |
void | add_meta_info (StringType &&key, ValueType &&value) |
Add a new key = value or key = {value1, ..., valueN} pair to the meta-information of the savepoint. More... | |
bool | operator== (const savepoint &right) const |
Test for equality. | |
bool | operator!= (const savepoint &right) const |
Test for inequality. | |
void | swap (savepoint &other) noexcept |
Swap with other. | |
const std::string & | name () const noexcept |
Access name. | |
meta_info_map | meta_info () const noexcept |
Access meta-info. | |
bool | empty () const noexcept |
Returns a bool value indicating whether the savepoint is empty (i.e has no meta-information attached) | |
std::string | to_string () const |
Convert savepoint to string. | |
const std::shared_ptr< SavepointImpl > & | impl () const |
Get implementation pointer. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const savepoint &s) |
Convert to stream. | |
Savepoint implemenation of the gridtools frontend.
Savepoints are primarily identified by their name
and further distinguished by their meta_info
. Savepoints are used within the serializer to discriminate fields at different points in time.
Definition at line 34 of file Savepoint.h.
|
inlineexplicit |
Construct a savepoint.
This method prepares the savepoint for usage and gives a name, which is the only required information for the savepoint to be usable. Meta-information can be added after the initialization has been performed.
name | Name of the savepoint |
Definition at line 43 of file Savepoint.h.
|
inline |
Construct savepoint with name
and metaInfo
name | Name of the savepoint |
meta_info | Arguments forwarded to the constructor of meta_info_map |
Definition at line 50 of file Savepoint.h.
|
default |
Copy constructor.
This performs a shallow copy, meaning the objects share the same underlying SavepointImpl. To deep copy the object call meta_info_map::clone().
Example
|
inline |
Add a new key = value
or key = {value1, ..., valueN}
pair to the meta-information of the savepoint.
key | Key of the new element |
value | Object to be copied to (or moved as) the value of the new element |
exception | Value cannot be inserted as it already exists |
Definition at line 121 of file Savepoint.h.
|
inline |
Clone the current savepoint object by performing a deep copy.
Example
Definition at line 106 of file Savepoint.h.
Copy assignment.
This performs a shallow copy, meaning the objects share the same underlying SavepointImpl. To deep copy the object call meta_info_map::clone().
Example