openPMD-api
|
Layer to manage storage of attributes associated with file objects. More...
#include <Attributable.hpp>
Classes | |
struct | MyPath |
String serialization to describe an Attributable. More... | |
Public Types | |
enum | ReadMode { IgnoreExisting, OverrideExisting, FullyReread } |
Public Member Functions | |
Attribute | getAttribute (std::string const &key) const |
Retrieve value of Attribute stored with provided key. More... | |
bool | deleteAttribute (std::string const &key) |
Remove Attribute of provided value both logically and physically. More... | |
std::vector< std::string > | attributes () const |
List all currently stored Attributes' keys. More... | |
size_t | numAttributes () const |
Count all currently stored Attributes. More... | |
bool | containsAttribute (std::string const &key) const |
Check whether am Attribute with a given key exists. More... | |
std::string | comment () const |
Retrieve a user-supplied comment associated with the object. More... | |
Attributable & | setComment (std::string const &comment) |
Populate Attribute corresponding to a comment with the user-supplied comment. More... | |
void | seriesFlush (std::string backendConfig="{}") |
Flush the corresponding Series object. More... | |
MyPath | myPath () const |
The path to this object within its containing Series. More... | |
protected Series | retrieveSeries () const |
void | seriesFlush (internal::FlushParams) |
void | flushAttributes (internal::FlushParams const &) |
void | readAttributes (ReadMode) |
template<typename T > | |
T | readFloatingpoint (std::string const &key) const |
Retrieve the value of a floating point Attribute of user-defined precision with ensured type-safety. More... | |
template<typename T > | |
std::vector< T > | readVectorFloatingpoint (std::string const &key) const |
Retrieve a vector of values of a floating point Attributes of user-defined precision with ensured type-safety. More... | |
AbstractIOHandler * | IOHandler () |
AbstractIOHandler const * | IOHandler () const |
Writable *& | parent () |
Writable const * | parent () const |
Writable & | writable () |
Writable const & | writable () const |
void | setData (std::shared_ptr< internal::AttributableData > attri) |
internal::AttributableData & | get () |
internal::AttributableData const & | get () const |
bool | dirty () const |
bool & | dirty () |
bool | written () const |
bool & | written () |
template<typename T > | |
bool | setAttribute (std::string const &key, T value) |
Populate Attribute of provided name with provided value. More... | |
bool | setAttribute (std::string const &key, char const value[]) |
Iteration const & | containingIteration () const |
Returns the corresponding Iteration. More... | |
Iteration & | containingIteration () |
Protected Member Functions | |
Attributable (std::shared_ptr< internal::AttributableData >) | |
Protected Attributes | |
std::shared_ptr< internal::AttributableData > | m_attri |
Friends | |
template<typename T_elem > | |
class | BaseRecord |
template<typename T_elem > | |
class | BaseRecordInterface |
template<typename > | |
class | internal::BaseRecordData |
template<typename T , typename T_key , typename T_container > | |
class | Container |
template<typename T > | |
struct | traits::GenerationPolicy |
class | Iteration |
class | Series |
class | Writable |
class | WriteIterations |
Writable * | getWritable (Attributable *) |
Layer to manage storage of attributes associated with file objects.
Mandatory and user-defined Attributes and their data for every object in the openPMD hierarchy are stored and managed through this class.
std::vector< std::string > openPMD::Attributable::attributes | ( | ) | const |
List all currently stored Attributes' keys.
std::string openPMD::Attributable::comment | ( | ) | const |
Retrieve a user-supplied comment associated with the object.
no_such_attribute_error | If no comment is currently stored. |
Iteration const & openPMD::Attributable::containingIteration | ( | ) | const |
Returns the corresponding Iteration.
Return the openPMD::iteration that this Attributable is contained in. This walks up the linked parents until it finds the Iteration object. Throws an error otherwise, e.g., for Series objects.
bool openPMD::Attributable::containsAttribute | ( | std::string const & | key | ) | const |
bool openPMD::Attributable::deleteAttribute | ( | std::string const & | key | ) |
Attribute openPMD::Attributable::getAttribute | ( | std::string const & | key | ) | const |
auto openPMD::Attributable::myPath | ( | ) | const |
The path to this object within its containing Series.
size_t openPMD::Attributable::numAttributes | ( | ) | const |
Count all currently stored Attributes.
|
inline |
Retrieve the value of a floating point Attribute of user-defined precision with ensured type-safety.
no_such_attribute_error | If no Attribute is currently stored with the provided key. |
T | Floating point type of user-defined precision to retrieve the value as. |
key | Key (i.e. name) of the floating-point Attribute to retrieve value for. |
|
inline |
Retrieve a vector of values of a floating point Attributes of user-defined precision with ensured type-safety.
no_such_attribute_error | If no Attribute is currently stored with the provided key. |
T | Floating point type of user-defined precision to retrieve the values as. |
key | Key (i.e. name) of the floating-point Attribute to retrieve values for. |
void openPMD::Attributable::seriesFlush | ( | std::string | backendConfig = "{}" | ) |
Flush the corresponding Series object.
Writable connects all objects of an openPMD series through a linked list of parents. This method will walk up the parent list until it reaches an object that has no parent, which is the Series object, and flush()-es it.
backendConfig | Further backend-specific instructions on how to implement this flush call. Must be provided in-line, configuration is not read from files. |
|
inline |
Populate Attribute of provided name with provided value.
T | Type of the object to be stored. Only types contained in Datatype can be handled. |
key | Key (i.e. name) to identify and store an Attributes value by. |
value | Value of Attribute stored with the provided key. |
Attributable & openPMD::Attributable::setComment | ( | std::string const & | comment | ) |
Populate Attribute corresponding to a comment with the user-supplied comment.
comment | String value to be stored as a comment. |
|
protected |