Layer to manage storage of attributes associated with file objects.
More...
#include <Attributable.hpp>
|
void | flushAttributes () |
|
void | readAttributes () |
|
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...
|
|
bool & | dirty () const |
|
bool & | written () const |
|
|
template<typename T_elem > |
class | BaseRecord |
|
template<typename T , typename T_key , typename T_container > |
class | Container |
|
template<typename T > |
struct | traits::GenerationPolicy |
|
class | Iteration |
|
class | Series |
|
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.
◆ attributes()
std::vector< std::string > openPMD::Attributable::attributes |
( |
| ) |
const |
List all currently stored Attributes' keys.
- Returns
- Vector of keys (i.e. names) of all currently stored Attributes.
◆ comment()
std::string openPMD::Attributable::comment |
( |
| ) |
const |
Retrieve a user-supplied comment associated with the object.
- Exceptions
-
- Returns
- String containing the user-supplied comment.
◆ containsAttribute()
bool openPMD::Attributable::containsAttribute |
( |
std::string const & |
key | ) |
const |
Check whether am Attribute with a given key exists.
- Parameters
-
- Returns
- true if provided key was present, false otherwise.
◆ deleteAttribute()
bool openPMD::Attributable::deleteAttribute |
( |
std::string const & |
key | ) |
|
Remove Attribute of provided value both logically and physically.
- Parameters
-
key | Key (i.e. name) of the Attribute to remove. |
- Returns
- true if provided key was present and removal succeeded, false otherwise.
◆ getAttribute()
Attribute openPMD::Attributable::getAttribute |
( |
std::string const & |
key | ) |
const |
Retrieve value of Attribute stored with provided key.
- Exceptions
-
- Parameters
-
key | Key (i.e. name) of the Attribute to retrieve value for. |
- Returns
- Stored Attribute in Variant form.
◆ numAttributes()
size_t openPMD::Attributable::numAttributes |
( |
| ) |
const |
Count all currently stored Attributes.
- Returns
- Number of currently stored Attributes.
◆ readFloatingpoint()
template<typename T >
T openPMD::Attributable::readFloatingpoint |
( |
std::string const & |
key | ) |
const |
|
inlineprotected |
Retrieve the value of a floating point Attribute of user-defined precision with ensured type-safety.
- Note
- Since the precision of certain Attributes is intentionally left unspecified in the openPMD standard, this provides a mechanism to retrieve those values without giving up type-safety.
- See also
- https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#conventions-throughout-these-documents
- Note
- If the supplied and stored floating point precision are not the same, the value is cast to the desired precision unconditionally.
- Exceptions
-
- Template Parameters
-
T | Floating point type of user-defined precision to retrieve the value as. |
- Parameters
-
key | Key (i.e. name) of the floating-point Attribute to retrieve value for. |
- Returns
- Value of stored Attribute as supplied floating point type.
◆ readVectorFloatingpoint()
template<typename T >
std::vector< T > openPMD::Attributable::readVectorFloatingpoint |
( |
std::string const & |
key | ) |
const |
|
inlineprotected |
Retrieve a vector of values of a floating point Attributes of user-defined precision with ensured type-safety.
- Note
- Since the precision of certain Attributes is intentionally left unspecified in the openPMD standard, this provides a mechanism to retrieve those values without giving up type-safety.
- See also
- https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md#conventions-throughout-these-documents
- Note
- If the supplied and stored floating point precision are not the same, the values are cast to the desired precision unconditionally.
- Exceptions
-
- Template Parameters
-
T | Floating point type of user-defined precision to retrieve the values as. |
- Parameters
-
key | Key (i.e. name) of the floating-point Attribute to retrieve values for. |
- Returns
- Vector of values of stored Attribute as supplied floating point type.
◆ setAttribute()
template<typename T >
bool openPMD::Attributable::setAttribute |
( |
std::string const & |
key, |
|
|
T const & |
value |
|
) |
| |
|
inline |
Populate Attribute of provided name with provided value.
- Note
- If the provided Attribute already exists, the value is replaced. If it does not exist, a new Attribute is created.
- Template Parameters
-
T | Type of the object to be stored. Only types contained in Datatype can be handled. |
- Parameters
-
key | Key (i.e. name) to identify and store an Attributes value by. |
value | Value of Attribute stored with the provided key. |
- Returns
- true if key was already present, false otherwise
◆ setComment()
Attributable & openPMD::Attributable::setComment |
( |
std::string const & |
comment | ) |
|
Populate Attribute corresponding to a comment with the user-supplied comment.
- Parameters
-
comment | String value to be stored as a comment. |
- Returns
- Reference to modified Attributable.
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/openpmd-api/checkouts/0.12.0-alpha/include/openPMD/backend/Attributable.hpp
- /home/docs/checkouts/readthedocs.org/user_builds/openpmd-api/checkouts/0.12.0-alpha/src/backend/Attributable.cpp