23template <
typename Derivate>
27 auto attr_id = detail::h5a_create2(
static_cast<Derivate*
>(
this)->getId(),
28 attribute_name.c_str(),
33 return detail::make_attribute(attr_id);
36template <
typename Derivate>
37template <
typename Type>
43template <
typename Derivate>
48 createAttribute(attribute_name,
55template <
typename Derivate>
57 detail::h5a_delete(
static_cast<const Derivate*
>(
this)->getId(), attribute_name.c_str());
60template <
typename Derivate>
62 const auto attr_id = detail::h5a_open(
static_cast<const Derivate*
>(
this)->getId(),
63 attribute_name.c_str(),
65 return detail::make_attribute(attr_id);
68template <
typename Derivate>
70 int res = detail::h5a_get_num_attrs(
static_cast<const Derivate*
>(
this)->getId());
71 return static_cast<size_t>(res);
74template <
typename Derivate>
76 std::vector<std::string> names;
77 details::HighFiveIterateData iterateData(names);
79 size_t num_objs = getNumberAttributes();
80 names.reserve(num_objs);
82 detail::h5a_iterate2(
static_cast<const Derivate*
>(
this)->getId(),
86 &details::internal_high_five_iterate<H5A_info_t>,
87 static_cast<void*
>(&iterateData));
92template <
typename Derivate>
94 return detail::h5a_exists(
static_cast<const Derivate*
>(
this)->getId(), attr_name.c_str()) > 0;
Attribute createAttribute(const std::string &attribute_name, const DataSpace &space, const DataType &type)
create a new attribute with the name attribute_name
Definition H5Annotate_traits_misc.hpp:24
std::vector< std::string > listAttributeNames() const
list all attribute name of the node / group
Definition H5Annotate_traits_misc.hpp:75
void deleteAttribute(const std::string &attribute_name)
deleteAttribute let you delete an attribute by its name.
Definition H5Annotate_traits_misc.hpp:56
Attribute getAttribute(const std::string &attribute_name) const
open an existing attribute with the name attribute_name
Definition H5Annotate_traits_misc.hpp:61
bool hasAttribute(const std::string &attr_name) const
checks an attribute exists
Definition H5Annotate_traits_misc.hpp:93
size_t getNumberAttributes() const
return the number of attributes of the node / group
Definition H5Annotate_traits_misc.hpp:69
Class representing an Attribute of a DataSet or Group.
Definition H5Attribute.hpp:46
void write(const T &value)
Write the value into the Attribute.
Definition H5Attribute_misc.hpp:131
Class representing the space (dimensions) of a DataSet.
Definition H5DataSpace.hpp:39
static DataSpace From(const T &value)
Automatically deduce the DataSpace from a container/value.
Definition H5Dataspace_misc.hpp:128
HDF5 Data Type.
Definition H5DataType.hpp:61
hid_t getId() const noexcept
getId
Definition H5Object_misc.hpp:69
Definition H5_definitions.hpp:22
DataType create_and_check_datatype()
Create a DataType instance representing type T and perform a sanity check on its size.
Definition H5DataType_misc.hpp:486