echelon  0.8.0
hdf5/precursor/dataset.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_DATASET_HPP
7 #define ECHELON_HDF5_PRECURSOR_DATASET_HPP
8 
9 #include <echelon/hdf5/precursor/type.hpp>
10 #include <echelon/hdf5/precursor/dataspace.hpp>
11 #include <echelon/hdf5/precursor/property_list.hpp>
12 #include <echelon/hdf5/precursor/object.hpp>
13 #include <echelon/hdf5/precursor/file.hpp>
14 
15 #include <hdf5.h>
16 #include <string>
17 
18 namespace echelon
19 {
20 namespace hdf5
21 {
22 namespace precursor
23 {
24 class object_reference;
25 
26 class dataset
27 {
28 public:
29  dataset();
30  explicit dataset(hid_t dataset_id_);
31  explicit dataset(const object& other);
32  dataset(hid_t loc_id, const std::string& name, const type& dtype, const dataspace& space,
33  const property_list& lcpl, const property_list& dcpl, const property_list& dapl);
34  dataset(hid_t loc_id, const std::string& name, const property_list& dapl);
35  ~dataset();
36 
37  dataset(const dataset& other);
38  dataset(dataset&& other);
39 
40  dataset& operator=(const dataset& other);
41  dataset& operator=(dataset&&);
42 
43  void write(const type& mem_type, const dataspace& mem_space, const dataspace& file_space,
44  const property_list& xfer_plist, const void* buf) const;
45  void read(const type& mem_type, const dataspace& mem_space, const dataspace& file_space,
46  const property_list& xfer_plist, void* buf) const;
47 
48  void write(const void* value) const;
49  void read(void* value) const;
50 
51  void set_extent(const std::vector<hsize_t>& dims) const;
52 
53  dataspace get_space() const;
54 
55  type datatype() const;
56  property_list creation_property_list() const;
57 
58  std::string name() const;
59  file associated_file() const;
60 
61  std::string label(unsigned int index) const;
62  void relabel(unsigned int index, const std::string& new_label) const;
63 
64  hid_t id() const;
65 
66  explicit operator bool() const;
67 private:
68  hid_t dataset_id_;
69 };
70 }
71 }
72 }
73 
74 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10