h5cpp  0.3.3
A modern C++ wrapper for the HDF5 C library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 // Created on: Oct 09, 2017
26 //
27 #pragma once
28 
30 
31 namespace hdf5 {
32 namespace property {
33 
34 class CopyFlags;
35 
36 enum class CopyFlag : unsigned {
37  SHALLOW_HIERARCHY = H5O_COPY_SHALLOW_HIERARCHY_FLAG,
38  EXPAND_SOFT_LINKS = H5O_COPY_EXPAND_SOFT_LINK_FLAG,
39  EXPAND_EXTERNAL_LINKS = H5O_COPY_EXPAND_EXT_LINK_FLAG,
40  EXPAND_REFERENCES = H5O_COPY_EXPAND_REFERENCE_FLAG,
41  WITHOUT_ATTRIBUTES = H5O_COPY_WITHOUT_ATTR_FLAG,
42  MERGE_COMMITTED_TYPES = H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG
43 };
44 
45 DLL_EXPORT std::ostream &operator<<(std::ostream &stream, const CopyFlag &flag);
46 
47 DLL_EXPORT CopyFlags operator|(const CopyFlag &lhs, const CopyFlag &rhs);
48 
56  private:
57  unsigned value_;
58  public:
64  CopyFlags() noexcept;
65 
72  explicit CopyFlags(unsigned flags) noexcept;
73 
79  CopyFlags(const CopyFlags &flags) = default;
80 
84  CopyFlags &operator|=(const CopyFlag &flag) noexcept;
85 
89  CopyFlags &operator|=(const CopyFlags &flags) noexcept;
90 
94  explicit operator unsigned() const noexcept {
95  return value_;
96  }
97 
101  bool shallow_hierarchy() const noexcept;
102 
106  void shallow_hierarchy(bool flag) noexcept;
107 
111  bool expand_soft_links() const noexcept;
112 
116  void expand_soft_links(bool flag) noexcept;
117 
121  bool expand_external_links() const noexcept;
122 
126  void expand_external_links(bool flag) noexcept;
127 
131  bool expand_references() const noexcept;
132 
136  void expand_references(bool flag) noexcept;
137 
141  bool without_attributes() const noexcept;
142 
146  void without_attributes(bool flag) noexcept;
147 
151  bool merge_committed_types() const noexcept;
152 
156  void merge_committed_types(bool flag) noexcept;
157 
158 };
159 
163 DLL_EXPORT CopyFlags operator|(const CopyFlags &flags, const CopyFlags &rhs) noexcept;
164 
168 DLL_EXPORT CopyFlags operator|(const CopyFlags &flags, const CopyFlag &flag) noexcept;
169 
173 DLL_EXPORT CopyFlags operator|(const CopyFlag &flag, const CopyFlags &flags) noexcept;
174 
176  public:
177  ObjectCopyList();
178 
179  explicit ObjectCopyList(ObjectHandle &&handle);
180 
181  void flags(const CopyFlags &flags) const;
182  void flags(const CopyFlag &flag) const;
183 
184  CopyFlags flags() const;
185 
186 };
187 
188 } // namespace property
189 } // namespace hdf5
encapsulate copy flags
Definition: object_copy.hpp:55
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:66
Definition: attribute.hpp:43
CopyFlag
Definition: object_copy.hpp:36
DLL_EXPORT std::ostream & operator<<(std::ostream &stream, const DatasetFillValueStatus &status)
Definition: object_copy.hpp:175
#define DLL_EXPORT
Definition: windows.hpp:35
base class for property lists
Definition: property_list.hpp:45
DLL_EXPORT CopyFlags operator|(const CopyFlag &lhs, const CopyFlag &rhs)