21 #ifndef __DOLFIN_HDF5ATTRIBUTE_H 22 #define __DOLFIN_HDF5ATTRIBUTE_H 29 #include<dolfin/common/Array.h> 30 #include "HDF5Interface.h" 46 : hdf5_file_id(hdf5_file_id), dataset_name(dataset_name) {}
52 bool exists(
const std::string attribute_name)
const;
55 void set(
const std::string attribute_name,
const double value);
58 void set(
const std::string attribute_name,
const std::size_t value);
61 void set(
const std::string attribute_name,
62 const std::vector<double>& value);
65 void set(
const std::string attribute_name,
66 const std::vector<std::size_t>& value);
69 void set(
const std::string attribute_name,
const std::string value);
72 void get(
const std::string attribute_name,
double& value)
const;
75 void get(
const std::string attribute_name,
76 std::vector<double>& value)
const;
79 void get(
const std::string attribute_name, std::size_t& value)
const;
82 void get(
const std::string attribute_name,
83 std::vector<std::size_t>& value)
const;
86 void get(
const std::string attribute_name, std::string& value)
const;
90 const std::string
str(
const std::string attribute_name)
const;
94 const std::string
type_str(
const std::string attribute_name)
const;
97 const std::string
str()
const;
105 const hid_t hdf5_file_id;
106 const std::string dataset_name;
109 template <
typename T>
110 void set_value(
const std::string attribute_name,
const T& value);
113 template <
typename T>
114 void get_value(
const std::string attribute_name, T& value)
const;
116 template <
typename T>
118 vector_to_string(
const std::vector<T>& vector_value)
const;
const std::string type_str(const std::string attribute_name) const
Definition: HDF5Attribute.cpp:212
const std::string str() const
Get the names of all the attributes on this dataset.
Definition: HDF5Attribute.cpp:193
Definition: HDF5Attribute.h:38
HDF5Attribute(const hid_t hdf5_file_id, std::string dataset_name)
Constructor.
Definition: HDF5Attribute.h:45
~HDF5Attribute()
Destructor.
Definition: HDF5Attribute.h:49
bool exists(const std::string attribute_name) const
Check for the existence of an attribute on a dataset.
Definition: HDF5Attribute.cpp:180
const std::vector< std::string > list_attributes() const
Definition: HDF5Attribute.cpp:206