Go to the documentation of this file.
9 #ifndef H5ATTRIBUTE_MISC_HPP
10 #define H5ATTRIBUTE_MISC_HPP
19 #include <boost/multi_array.hpp>
22 #include <H5Apublic.h>
23 #include <H5Ppublic.h>
32 return H5Aget_name(
_hid, length, buffer);
37 return static_cast<size_t>(H5Aget_storage_size(
_hid));
48 if ((space.
_hid = H5Aget_space(
_hid)) < 0) {
49 HDF5ErrMapper::ToException<AttributeException>(
50 "Unable to get DataSpace out of Attribute");
59 static_assert(!std::is_const<
typename std::remove_reference<T>::type>::value,
60 "read() requires a non-const array to read into");
67 std::ostringstream ss;
68 ss <<
"Impossible to read attribute of dimensions "
74 const DataType mem_datatype = create_and_check_datatype<element_type>();
81 HDF5ErrMapper::ToException<AttributeException>(
82 "Error during HDF5 Read: ");
91 static_assert(!std::is_const<T>::value,
92 "read() requires a non-const structure to read data into");
96 const DataType mem_datatype = create_and_check_datatype<element_type>();
99 static_cast<void*
>(array)) < 0) {
100 HDF5ErrMapper::ToException<AttributeException>(
101 "Error during HDF5 Read: ");
105 template <
typename T>
113 std::ostringstream ss;
114 ss <<
"Impossible to write buffer of dimensions " << dim_buffer
115 <<
" into attribute of dimensions "
120 const DataType mem_datatype = create_and_check_datatype<element_type>();
125 HDF5ErrMapper::ToException<DataSetException>(
126 "Error during HDF5 Write: ");
130 template <
typename T>
135 const DataType mem_datatype = create_and_check_datatype<element_type>();
140 HDF5ErrMapper::ToException<DataSetException>(
141 "Error during HDF5 Write: ");
147 #endif // H5ATTRIBUTE_MISC_HPP
DataSpace getSpace() const
getSpace
Definition: H5Attribute_misc.hpp:46
std::string get_name(T fct)
Definition: H5Utils.hpp:252
HDF5 Data Type.
Definition: H5DataType.hpp:42
void read(T &array) const
Definition: H5Attribute_misc.hpp:58
Definition: H5Utils.hpp:44
DataSpace getMemSpace() const
getMemSpace
Definition: H5Attribute_misc.hpp:55
const Scalar * transform_write(const Scalar &datamem) const noexcept
Definition: H5Converter_misc.hpp:137
hid_t getId() const noexcept
getId
Definition: H5Object_misc.hpp:55
void process_result(Scalar &) const noexcept
Definition: H5Converter_misc.hpp:141
void write_raw(const T &buffer)
Definition: H5Attribute_misc.hpp:131
unqualified_t< T > type
Definition: H5Utils.hpp:137
Scalar * transform_read(Scalar &datamem) const noexcept
Definition: H5Converter_misc.hpp:133
size_t getStorageSize() const
Definition: H5Attribute_misc.hpp:36
hid_t _hid
Definition: H5Object.hpp:81
DataType getDataType() const
getDataType
Definition: H5Attribute_misc.hpp:40
Class representing the space (dimensions) of a dataset.
Definition: H5DataSpace.hpp:37
std::string getName() const
return the name of the current attribute
Definition: H5Attribute_misc.hpp:30
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
Definition: H5_definitions.hpp:57
bool checkDimensions(const DataSpace &mem_space, size_t input_dims)
dimension checks
Definition: H5Dataspace_misc.hpp:227
size_t getNumberDimensions() const
getNumberDimensions
Definition: H5Dataspace_misc.hpp:90
Definition: H5_definitions.hpp:15
Exception specific to HighFive DataSpace interface.
Definition: H5Exception.hpp:99
void write(const T &buffer)
Definition: H5Attribute_misc.hpp:106