echelon  0.8.0
object.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_OBJECT_HPP
7 #define ECHELON_OBJECT_HPP
8 
9 #include <echelon/hdf5/object.hpp>
10 #include <exception>
11 #include <string>
12 #include <utility>
13 
14 namespace echelon
15 {
16 
17 class group;
18 class dataset;
19 class scalar_dataset;
20 
21 class object_reference;
22 
25 class object
26 {
27 public:
31 
34  object() = default;
35 
36  explicit object(native_handle_type native_handle_);
37 
42  object(const group& object_);
43 
48  object(const dataset& object_);
49 
54  object(const scalar_dataset& object_);
55 
60  object& operator=(const group& object_);
61 
66  object& operator=(const dataset& object_);
67 
72  object& operator=(const scalar_dataset& object_);
73 
85  operator group() const;
86 
98  operator dataset() const;
99 
111  operator scalar_dataset() const;
112 
115  object_reference ref() const;
116 
120 
123  explicit operator bool() const;
124 private:
125  hdf5::object object_handle_;
126 };
127 }
128 
129 #endif
echelon&#39;s core namespace
Definition: attribute.cpp:10
A handle to a group object.
Definition: group.hpp:125
A handle to an HDF5 scalar dataset.
Definition: scalar_dataset.hpp:23
object & operator=(const group &object_)
Changes the object, which is referenced by the handle.
Definition: object.cpp:35
Polymorphic handle to an HDF5 object.
Definition: hdf5/object.hpp:57
Polymorphic handle to an HDF5 object.
Definition: object.hpp:25
object()=default
Initializes the handle with its null state.
A reference to an HDF5 object.
Definition: object_reference.hpp:24
A handle to an echelon dataset.
Definition: dataset.hpp:33
native_handle_type native_handle() const
The underlying HDF5 low-level handle.
Definition: object.cpp:89
object_reference ref() const
A HDF5 object reference to this object.
Definition: object.cpp:84