h5cpp  0.5.0
A modern C++ wrapper for the HDF5 C library
node_iterator.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 // Created on: Sep 13, 2017
24 //
25 #pragma once
26 
27 #include <functional>
28 #include <h5cpp/core/iterator.hpp>
29 #include <h5cpp/node/group.hpp>
30 #include <h5cpp/node/node.hpp>
31 #include <h5cpp/core/windows.hpp>
32 
33 namespace hdf5 {
34 namespace node {
35 
48 #ifdef __clang__
49 #pragma clang diagnostic push
50 #pragma clang diagnostic ignored "-Wweak-vtables"
51 #endif
53 {
54  public:
55  using value_type = Node;
56  using pointer = value_type*;
58  using difference_type = ssize_t;
59  using iterator_category = std::bidirectional_iterator_tag;
60 
66  NodeIterator() = delete;
67 
77  static NodeIterator begin(const Group &group);
78 
88  static NodeIterator end(const Group &group);
89 
90 
91  Node operator*() const;
92  Node *operator->();
93  NodeIterator &operator++();
94  NodeIterator operator++(int);
95  NodeIterator &operator--();
96  NodeIterator operator--(int);
97 
98  bool operator==(const NodeIterator &a) const;
99  bool operator!=(const NodeIterator &a) const;
100 
101  private:
105  NodeIterator(const Group &group,ssize_t index);
106 #ifdef _MSC_VER
107 #pragma warning(push)
108 #pragma warning(disable: 4251)
109 #endif
110  Group group_;
111 #ifdef _MSC_VER
112 #pragma warning(pop)
113 #endif
114  mutable Node current_node_;
121 
122 };
123 #ifdef __clang__
124 #pragma clang diagnostic pop
125 #endif
126 
127 } // namespace node
128 } // namespace hdf5
hdf5::node::NodeIterator
bidirectional NodeIterator
Definition: node_iterator.hpp:52
hdf5::Iterator
Definition: iterator.hpp:32
iterator.hpp
node.hpp
group.hpp
hdf5::node::Node
Definition: node.hpp:39
hdf5::node::Group
Definition: group.hpp:50
windows.hpp
hdf5::node::operator!=
bool operator!=(const Link &lhs, const Link &rhs)
DLL_EXPORT
#define DLL_EXPORT
Definition: windows.hpp:29
hdf5::node::NodeIterator::difference_type
ssize_t difference_type
Definition: node_iterator.hpp:58
hdf5::node::NodeIterator::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition: node_iterator.hpp:59
hdf5
top-level namespace of the entire library
Definition: attribute.hpp:45
hdf5::node::operator==
bool operator==(const Node &lhs, const Node &rhs)