HighFive  2.2.2
HighFive - Header-only C++ HDF5 interface
H5Attribute.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c), 2017, Ali Can Demiralp <ali.demiralp@rwth-aachen.de>
3  *
4  * Distributed under the Boost Software License, Version 1.0.
5  * (See accompanying file LICENSE_1_0.txt or copy at
6  * http://www.boost.org/LICENSE_1_0.txt)
7  *
8  */
9 #ifndef H5ATTRIBUTE_HPP
10 #define H5ATTRIBUTE_HPP
11 
12 #include <vector>
13 
14 #include "H5DataSpace.hpp"
15 #include "H5DataType.hpp"
16 #include "H5Object.hpp"
17 
18 namespace HighFive {
19 
23 class Attribute : public Object {
24  public:
25 
27 
31  std::string getName() const;
32 
33  size_t getStorageSize() const;
34 
39  DataType getDataType() const;
40 
45  DataSpace getSpace() const;
46 
52  DataSpace getMemSpace() const;
53 
61  template <typename T>
62  void read(T& array) const;
63 
67  template <typename T>
68  void read(T* array) const;
69 
77  template <typename T>
78  void write(const T& buffer);
79 
83  template <typename T>
84  void write_raw(const T& buffer);
85 
86  private:
87  Attribute() = default;
88 
89  template <typename Derivate> friend class ::HighFive::AnnotateTraits;
90 };
91 
92 } // namespace HighFive
93 
94 
95 #endif // H5ATTRIBUTE_HPP
Class representing an attribute of a dataset or group.
Definition: H5Attribute.hpp:23
void write_raw(const T &buffer)
Definition: H5Attribute_misc.hpp:131
DataSpace getSpace() const
getSpace
Definition: H5Attribute_misc.hpp:46
DataType getDataType() const
getDataType
Definition: H5Attribute_misc.hpp:40
std::string getName() const
return the name of the current attribute
Definition: H5Attribute_misc.hpp:30
void write(const T &buffer)
Definition: H5Attribute_misc.hpp:106
static const ObjectType type
Definition: H5Attribute.hpp:26
DataSpace getMemSpace() const
getMemSpace
Definition: H5Attribute_misc.hpp:55
size_t getStorageSize() const
Definition: H5Attribute_misc.hpp:36
void read(T &array) const
Definition: H5Attribute_misc.hpp:58
Class representing the space (dimensions) of a dataset.
Definition: H5DataSpace.hpp:37
HDF5 Data Type.
Definition: H5DataType.hpp:42
Definition: H5Object.hpp:36
Definition: H5_definitions.hpp:15
ObjectType
Enum of the types of objects (H5O api)
Definition: H5Object.hpp:25