h5cpp  0.6.1
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 
64  NodeIterator() = default;
65 
75  static NodeIterator begin(const Group &group);
76 
86  static NodeIterator end(const Group &group);
87 
88 
89  Node operator*() const;
95 
96  bool operator==(const NodeIterator &a) const;
97  bool operator!=(const NodeIterator &a) const;
98 
99  private:
103  NodeIterator(const Group &group,ssize_t index);
104 #ifdef _MSC_VER
105 #pragma warning(push)
106 #pragma warning(disable: 4251)
107 #endif
108  Group group_;
109 #ifdef _MSC_VER
110 #pragma warning(pop)
111 #endif
118  mutable Node current_node_;
119 
120 };
121 #ifdef __clang__
122 #pragma clang diagnostic pop
123 #endif
124 
125 } // namespace node
126 } // namespace hdf5
Definition: iterator.hpp:34
Definition: group.hpp:51
bidirectional NodeIterator
Definition: node_iterator.hpp:53
std::bidirectional_iterator_tag iterator_category
Definition: node_iterator.hpp:59
static NodeIterator end(const Group &group)
get iterator to last+1 element
NodeIterator & operator++()
NodeIterator()=default
default constructor
NodeIterator & operator--()
ssize_t difference_type
Definition: node_iterator.hpp:58
static NodeIterator begin(const Group &group)
get iterator to first element
NodeIterator operator--(int)
bool operator!=(const NodeIterator &a) const
bool operator==(const NodeIterator &a) const
NodeIterator operator++(int)
Definition: node.hpp:40
top-level namespace of the entire library
Definition: attribute.hpp:45
#define DLL_EXPORT
Definition: windows.hpp:29