h5cpp  0.5.1
A modern C++ wrapper for the HDF5 C library
group.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5cpp.
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 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
23 // Author: Martin Shetty <martin.shetty@esss.se>
24 // Created on: Aug 24, 2017
25 //
26 #pragma once
27 
28 #include <h5cpp/node/node.hpp>
29 #include <h5cpp/node/link_view.hpp>
30 #include <h5cpp/node/node_view.hpp>
31 #include <h5cpp/node/dataset.hpp>
41 
42 
43 namespace hdf5 {
44 namespace node {
45 
46 #ifdef __clang__
47 #pragma clang diagnostic push
48 #pragma clang diagnostic ignored "-Wweak-vtables"
49 #endif
50 class DLL_EXPORT Group : public Node
51 {
52  public:
55 
62  Group();
63 
67  Group(const Group &group);
68 
76  Group(const Node &node);
77 
87  Group(const Group &parent,const Path &path,
91 
92  virtual ~Group() override {}
93 
97  Group &operator=(const Group &group);
98 
99 #if (defined(_DOXYGEN_) || H5_VERSION_GE(1,10,0))
105  void flush() const;
106 #endif
107 
115  {
116  return iter_config_;
117  }
118 
125  const IteratorConfig &iterator_config() const noexcept
126  {
127  return iter_config_;
128  }
129 
137  bool exists(const std::string &name,
138  const property::LinkAccessList &lapl = property::LinkAccessList()) const;
139 
140 
144  Group create_group(const std::string &name,
148 
152  Dataset create_dataset(const std::string &name,
153  const datatype::Datatype &type,
154  const dataspace::Dataspace &space,
158  ) const;
159 
160 
170  Node operator[](const Path &path) const;
171 
193  void create_link(const Path &link_path,
194  const fs::path &target_file,
195  const Path &target_path,
198 
215  void create_link(const Path &link_path,
216  const Path &target_path,
219 
237  void create_link(const Path &link_path,
238  const Node &target,
241 
257  void copy_here(const Path &link_path,
258  const Node &target,
261 
276  void copy_here(const Node &target,
279 
294  void move_here(const Path &link_path,
295  const Node &target,
298 
310  void move_here(const Node &target,
313 
325  void remove(const Path &path,
327 
328 
336  bool has_group(const Path &path,
337  const property::LinkAccessList &lapl = property::LinkAccessList()) const noexcept;
338 
346  bool has_dataset(const Path &path,
347  const property::LinkAccessList &lapl = property::LinkAccessList()) const noexcept;
348 
349 
373  Group get_group(const Path &path,
374  const property::LinkAccessList &lapl = property::LinkAccessList()) const;
375 
396  Dataset get_dataset(const Path &path,
397  const property::LinkAccessList &lapl = property::LinkAccessList()) const;
398 
399 
400  private:
401  IteratorConfig iter_config_;
402 
403 };
404 #ifdef __clang__
405 #pragma clang diagnostic pop
406 #endif
407 
408 
409 } // namespace node
410 } // namespace hdf5
iterator configuration
Definition: iterator_config.hpp:72
path to a node object
Definition: path.hpp:54
dataspace base class
Definition: dataspace.hpp:41
base class for all data types
Definition: datatype.hpp:42
Definition: dataset.hpp:60
Definition: group.hpp:51
bool has_group(const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList()) const noexcept
reports if group has a link to a valid group at specified path
void copy_here(const Node &target, const property::ObjectCopyList &ocpl=property::ObjectCopyList(), const property::LinkCreationList &lcpl=property::LinkCreationList())
copy node object
LinkView links
Definition: group.hpp:53
void create_link(const Path &link_path, const fs::path &target_file, const Path &target_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
Create an external link.
void create_link(const Path &link_path, const Path &target_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
Create a soft link.
virtual ~Group() override
Definition: group.hpp:92
Node operator[](const Path &path) const
get node
Dataset create_dataset(const std::string &name, const datatype::Datatype &type, const dataspace::Dataspace &space, const property::DatasetCreationList &dcpl=property::DatasetCreationList(), const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::DatasetAccessList &dapl=property::DatasetAccessList()) const
create a new dataset
Group & operator=(const Group &group)
copy assignment operator
IteratorConfig & iterator_config() noexcept
get reference to the iterator configuration
Definition: group.hpp:114
NodeView nodes
Definition: group.hpp:54
const IteratorConfig & iterator_config() const noexcept
get reference to the interator configuration
Definition: group.hpp:125
void copy_here(const Path &link_path, const Node &target, const property::ObjectCopyList &ocpl=property::ObjectCopyList(), const property::LinkCreationList &lcpl=property::LinkCreationList())
copy node object
bool exists(const std::string &name, const property::LinkAccessList &lapl=property::LinkAccessList()) const
checks existence of a node
Group(const Group &group)
copy constructor
void remove(const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList())
remove node from group
Group(const Group &parent, const Path &path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::GroupCreationList &gcpl=property::GroupCreationList(), const property::GroupAccessList &gapl=property::GroupAccessList())
constructor
Group(const Node &node)
constructor
Group()
default constructor
Group create_group(const std::string &name, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::GroupCreationList &gcpl=property::GroupCreationList(), const property::GroupAccessList &gapl=property::GroupAccessList()) const
create a new group
void flush() const
flush the group (since hdf5 1.10.0)
void move_here(const Path &link_path, const Node &target, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
move node object
void create_link(const Path &link_path, const Node &target, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
Create a soft or external link.
void move_here(const Node &target, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
move node object
Definition: link_view.hpp:41
Definition: node_view.hpp:39
Definition: node.hpp:40
dataset access property list
Definition: dataset_access.hpp:76
dataset creation property list
Definition: dataset_creation.hpp:111
Definition: group_access.hpp:35
Definition: group_creation.hpp:36
link access property list
Definition: link_access.hpp:43
Definition: link_creation.hpp:35
Definition: object_copy.hpp:207
Group get_group(const Group &base, const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList())
get group
Dataset get_dataset(const Group &base, const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList())
get dataset
top-level namespace of the entire library
Definition: attribute.hpp:45
#define DLL_EXPORT
Definition: windows.hpp:29