h5cpp  0.6.0
A modern C++ wrapper for the HDF5 C library
node.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 
29 #include <h5cpp/core/path.hpp>
30 #include <h5cpp/node/types.hpp>
31 #include <h5cpp/node/link.hpp>
32 #include <h5cpp/core/windows.hpp>
33 #include <h5cpp/core/object_id.hpp>
35 
36 namespace hdf5 {
37 namespace node {
38 
40 {
41  public:
48  Node(ObjectHandle &&handle,const Link &link);
49 
61  Node();
62 
68  Node(const Node &);
69 
73  Node &operator=(const Node &node);
74 
81  virtual ~Node();
82 
83 
87  NodeType type() const;
88 
98  ObjectId id() const;
99 
100  explicit operator hid_t() const
101  {
102  return static_cast<hid_t>(handle_);
103  }
104 
111  bool is_valid() const;
112 
118  void close();
119 
125  const Link &link() const;
126 
131 
132  private:
133  ObjectHandle handle_;
134  Link link_;
135 };
136 
137 DLL_EXPORT bool operator==(const Node &lhs, const Node &rhs);
138 DLL_EXPORT bool operator!=(const Node &lhs, const Node &rhs);
139 
140 } // namespace node
141 } // namespace hdf5
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:67
Unique ID of an HDF5 object.
Definition: object_id.hpp:51
provides STL interface for attributes
Definition: attribute_manager.hpp:63
Definition: node.hpp:40
ObjectId id() const
get unique ID
Node()
default constructor
bool is_valid() const
true if an object is valid
attribute::AttributeManager attributes
access to the attribute manager
Definition: node.hpp:130
virtual ~Node()
destructor
void close()
close the node
Node(const Node &)
copy constructor
NodeType type() const
return the node type
Node(ObjectHandle &&handle, const Link &link)
constructor
const Link & link() const
return link to object
Node & operator=(const Node &node)
copy assignment
bool operator==(const Node &lhs, const Node &rhs)
void link(const Node &target, const Group &link_base, const Path &link_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
Create a soft or external link.
bool operator!=(const Link &lhs, const Link &rhs)
NodeType
enumeration for node type
Definition: types.hpp:38
top-level namespace of the entire library
Definition: attribute.hpp:45
#define DLL_EXPORT
Definition: windows.hpp:29