6 #ifndef ECHELON_ATTRIBUTE_REPOSITORY_HPP 7 #define ECHELON_ATTRIBUTE_REPOSITORY_HPP 9 #include <echelon/type.hpp> 10 #include <echelon/attribute.hpp> 26 template <
typename Parent>
31 : native_parent_(std::move(handle_))
59 return attribute(native_parent_.attributes().template create<T>(name));
75 return attribute(native_parent_.attributes().create(name, value));
86 return attribute(native_parent_.attributes()[name]);
95 bool exists(
const std::string& name)
const 97 return native_parent_.attributes().exists(name);
151 template <
typename T>
154 return attribute(native_parent_.attributes().template require<T>(name));
183 template <
typename T>
186 return attribute(native_parent_.attributes().require(name, value));
190 typename Parent::native_handle_type native_parent_;
echelon's core namespace
Definition: attribute.cpp:10
Attribute manager, which should be embedded into a parent object, which supports attributes.
Definition: attribute_repository.hpp:27
attribute create(const std::string &name, const type &datatype)
Creates a new attribute.
Definition: attribute_repository.hpp:42
A handle to an HDF5 type.
Definition: type.hpp:21
attribute create(const std::string &name)
Creates a new attribute.
Definition: attribute_repository.hpp:57
attribute require(const std::string &name, const T &value)
Returns the requested attribute, if it already exists, otherwise a new attribute is created...
Definition: attribute_repository.hpp:184
attribute require(const std::string &name, const type &datatype)
Returns the requested attribute, if it already exists, otherwise a new attribute is created...
Definition: attribute_repository.hpp:122
bool exists(const std::string &name) const
Tests, if an attribute exists.
Definition: attribute_repository.hpp:95
A handle to an echelon attribute.
Definition: attribute.hpp:21
attribute create(const std::string &name, const T &value)
Creates a new attribute and initializes it with a given value.
Definition: attribute_repository.hpp:73
attribute require(const std::string &name)
Returns the requested attribute, if it already exists, otherwise the attribute is created...
Definition: attribute_repository.hpp:152
attribute operator[](const std::string &name) const
Accessor function for this attribute repository.
Definition: attribute_repository.hpp:84
const native_handle_type & native_handle() const
The underlying HDF5 low-level handle.
Definition: type.cpp:107