h5cpp  0.5.1
A modern C++ wrapper for the HDF5 C library
object_copy.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5pp.
5 //
6 // This library is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 2.1 of the License, or
9 // (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the
18 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
19 // Boston, MA 02110-1301 USA
20 // ===========================================================================
21 //
22 // Authors:
23 // Eugen Wintersberger <eugen.wintersberger@desy.de>
24 // Martin Shetty <martin.shetty@esss.se>
25 // Jan Kotanski <jan.kotanski@desy.de>
26 // Created on: Oct 09, 2017
27 //
28 #pragma once
29 
31 
32 namespace hdf5 {
33 namespace property {
34 
35 class CopyFlags;
36 
37 enum class CopyFlag : unsigned {
38  ShallowHierarchy = H5O_COPY_SHALLOW_HIERARCHY_FLAG,
39  ExpandSoftLinks = H5O_COPY_EXPAND_SOFT_LINK_FLAG,
40  ExpandExternalLinks = H5O_COPY_EXPAND_EXT_LINK_FLAG,
41  ExpandReferences = H5O_COPY_EXPAND_REFERENCE_FLAG,
42  WithoutAttributes = H5O_COPY_WITHOUT_ATTR_FLAG,
43  MergeCommittedTypes = H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG
44 };
45 
46 DLL_EXPORT std::ostream &operator<<(std::ostream &stream, const CopyFlag &flag);
47 
49 
51 
59  private:
60  unsigned value_;
61  public:
67  CopyFlags() noexcept;
68 
75  explicit CopyFlags(unsigned flags) noexcept;
76 
82  CopyFlags(const CopyFlags &flags) = default;
83 
87  CopyFlags &operator|=(const CopyFlag &flag) noexcept;
88 
92  CopyFlags &operator|=(const CopyFlags &flags) noexcept;
93 
97  CopyFlags &operator&=(const CopyFlag &flag) noexcept;
98 
102  CopyFlags &operator&=(const CopyFlags &flags) noexcept;
103 
107  explicit operator unsigned() const noexcept {
108  return value_;
109  }
110 
114  bool shallow_hierarchy() const noexcept;
115 
119  void shallow_hierarchy(bool flag) noexcept;
120 
124  bool expand_soft_links() const noexcept;
125 
129  void expand_soft_links(bool flag) noexcept;
130 
134  bool expand_external_links() const noexcept;
135 
139  void expand_external_links(bool flag) noexcept;
140 
144  bool expand_references() const noexcept;
145 
149  void expand_references(bool flag) noexcept;
150 
154  bool without_attributes() const noexcept;
155 
159  void without_attributes(bool flag) noexcept;
160 
164  bool merge_committed_types() const noexcept;
165 
169  void merge_committed_types(bool flag) noexcept;
170 
171 };
172 
176 DLL_EXPORT CopyFlags operator|(const CopyFlags &flags, const CopyFlags &rhs) noexcept;
177 
181 DLL_EXPORT CopyFlags operator|(const CopyFlags &flags, const CopyFlag &flag) noexcept;
182 
186 DLL_EXPORT CopyFlags operator|(const CopyFlag &flag, const CopyFlags &flags) noexcept;
187 
188 #ifdef __clang__
189 #pragma clang diagnostic push
190 #pragma clang diagnostic ignored "-Wweak-vtables"
191 #endif
195 DLL_EXPORT CopyFlags operator&(const CopyFlags &flags, const CopyFlags &rhs) noexcept;
196 
200 DLL_EXPORT CopyFlags operator&(const CopyFlags &flags, const CopyFlag &flag) noexcept;
201 
205 DLL_EXPORT CopyFlags operator&(const CopyFlag &flag, const CopyFlags &flags) noexcept;
206 
208  public:
210 
211  explicit ObjectCopyList(ObjectHandle &&handle);
212 
213  void flags(const CopyFlags &flags) const;
214  void flags(const CopyFlag &flag) const;
215 
216  CopyFlags flags() const;
217 
218 };
219 #ifdef __clang__
220 #pragma clang diagnostic pop
221 #endif
222 
223 } // namespace property
224 } // namespace hdf5
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:67
encapsulate copy flags
Definition: object_copy.hpp:58
bool shallow_hierarchy() const noexcept
get state of the shallow hierarchy flag
CopyFlags() noexcept
default constructor
base class for property lists
Definition: property_list.hpp:54
Definition: object_copy.hpp:207
ObjectCopyList(ObjectHandle &&handle)
void flags(const CopyFlag &flag) const
void flags(const CopyFlags &flags) const
CopyFlags operator&(const CopyFlag &lhs, const CopyFlag &rhs)
std::ostream & operator<<(std::ostream &stream, const VirtualDataView &view)
CopyFlags operator|(const CopyFlag &lhs, const CopyFlag &rhs)
CopyFlag
Definition: object_copy.hpp:37
top-level namespace of the entire library
Definition: attribute.hpp:45
#define DLL_EXPORT
Definition: windows.hpp:29