echelon  0.8.0
hdf5/precursor/dimension_scale.hpp
1 // Copyright (c) 2013-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_DIMENSION_SCALE_HPP
7 #define ECHELON_HDF5_PRECURSOR_DIMENSION_SCALE_HPP
8 
9 #include <echelon/hdf5/precursor/dataset.hpp>
10 
11 #include <string>
12 
13 #include <hdf5.h>
14 #include <hdf5_hl.h>
15 
16 namespace echelon
17 {
18 namespace hdf5
19 {
20 namespace precursor
21 {
22 class dimension_scale
23 {
24 public:
25  dimension_scale() = default;
26  dimension_scale(hid_t loc_id, const std::string& dataset_name, const type& dtype,
27  const dataspace& space, const std::string& scale_name);
28 
29  void write(const type& mem_type, const dataspace& mem_space, const dataspace& file_space,
30  const property_list& xfer_plist, const void* buf);
31  void read(const type& mem_type, const dataspace& mem_space, const dataspace& file_space,
32  const property_list& xfer_plist, void* buf) const;
33 
34  void write(const void* value);
35  void read(void* value) const;
36 
37  dataspace get_space() const;
38  type datatype() const;
39 
40  hid_t id() const;
41 
42 private:
43  dataset underlying_dataset_;
44 };
45 
46 void attach_dimension_scale(const dimension_scale& dim_scale, const dataset& to,
47  unsigned int dimension);
48 }
49 }
50 }
51 
52 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10