echelon  0.8.0
hdf5/precursor/attribute.hpp
1 // Copyright (c) 2012-2014 Christopher Hinz
2 //
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef ECHELON_HDF5_PRECURSOR_ATTRIBUTE_HPP
7 #define ECHELON_HDF5_PRECURSOR_ATTRIBUTE_HPP
8 
9 #include <echelon/hdf5/precursor/object_reference.hpp>
10 #include <echelon/hdf5/precursor/object.hpp>
11 #include <echelon/hdf5/precursor/property_list.hpp>
12 #include <echelon/hdf5/precursor/type.hpp>
13 #include <echelon/hdf5/precursor/dataspace.hpp>
14 #include <echelon/hdf5/precursor/property_list.hpp>
15 
16 #include <hdf5.h>
17 #include <string>
18 #include <type_traits>
19 
20 namespace echelon
21 {
22 namespace hdf5
23 {
24 namespace precursor
25 {
26 class attribute
27 {
28 public:
29  attribute();
30  explicit attribute(hid_t attribute_id_);
31  attribute(hid_t loc_id_, const std::string& name_, const type& attr_type_,
32  const property_list& acpl, const property_list& aapl);
33  attribute(hid_t loc_id_, const std::string& name_);
34  ~attribute();
35  attribute(const attribute& other);
36  attribute(attribute&& other);
37 
38  attribute& operator=(const attribute& other);
39  attribute& operator=(attribute&& other);
40 
41  void write(const void* value);
42  void read(void* value) const;
43 
44  type datatype() const;
45 
46  hid_t id() const;
47 
48  explicit operator bool() const;
49 private:
50  hid_t attribute_id_;
51 };
52 
53 bool is_attribute_existing(const object& loc, const std::string& name);
54 }
55 }
56 }
57 
58 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10