echelon  0.8.0
scalar_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_SCALAR_DATASET_HPP
7 #define ECHELON_SCALAR_DATASET_HPP
8 
9 #include <echelon/object.hpp>
10 
11 #include <echelon/type.hpp>
12 #include <echelon/hdf5/group.hpp>
13 #include <echelon/hdf5/scalar_dataset.hpp>
14 
15 #include <echelon/object_reference.hpp>
16 #include <echelon/attribute_repository.hpp>
17 
18 namespace echelon
19 {
20 
24 {
25 public:
29 
32  scalar_dataset() = default;
33 
34  explicit scalar_dataset(native_handle_type native_handle_);
35 
43  template <typename T>
44  friend inline void operator<<=(scalar_dataset& sink, const T& value)
45  {
46  sink.scalar_dataset_handle_ <<= value;
47  }
48 
56  template <typename T>
57  friend inline void operator<<=(T& value, const scalar_dataset& source)
58  {
59  value <<= source.scalar_dataset_handle_;
60  }
61 
64  type datatype() const;
65 
68  object_reference ref() const;
69 
73 
76  explicit operator bool() const;
77 private:
78  hdf5::group group_handle_;
79  hdf5::scalar_dataset scalar_dataset_handle_;
80 
81 public:
85 };
86 }
87 
88 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10
A handle to an HDF5 scalar dataset.
Definition: scalar_dataset.hpp:23
Attribute manager, which should be embedded into a parent object, which supports attributes.
Definition: attribute_repository.hpp:27
object_reference ref() const
A HDF5 object reference to this scalar dataset.
Definition: scalar_dataset.cpp:25
A handle to an HDF5 type.
Definition: type.hpp:21
A handle to an HDF5 group object.
Definition: hdf5/group.hpp:161
friend void operator<<=(scalar_dataset &sink, const T &value)
Writes the content of a variable into the scalar dataset.
Definition: scalar_dataset.hpp:44
type datatype() const
The value type of the scalar dataset.
Definition: scalar_dataset.cpp:20
native_handle_type native_handle() const
The underlying HDF5 low-level handle.
Definition: scalar_dataset.cpp:30
friend void operator<<=(T &value, const scalar_dataset &source)
Reads the content of the scalar dataset into a variable.
Definition: scalar_dataset.hpp:57
attribute_repository< scalar_dataset > attributes() const
The attributes, which are attached to the scalar dataset.
Definition: scalar_dataset.cpp:40
A handle to an HDF5 scalar dataset.
Definition: hdf5/scalar_dataset.hpp:27
A reference to an HDF5 object.
Definition: object_reference.hpp:24
scalar_dataset()=default
Initializes the handle with its null state.