h5cpp  0.6.1
A modern C++ wrapper for the HDF5 C library
attribute_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 14, 2017
24 //
25 #pragma once
26 
27 #include <h5cpp/core/iterator.hpp>
28 #include <h5cpp/core/windows.hpp>
31 
32 namespace hdf5 {
33 namespace attribute {
34 
35 #ifdef __clang__
36 #pragma clang diagnostic push
37 #pragma clang diagnostic ignored "-Wweak-vtables"
38 #endif
40 {
41  public:
43  using pointer = value_type*;
45  using difference_type = ssize_t;
46  using iterator_category = std::random_access_iterator_tag;
47 
48  AttributeIterator() = delete;
50  AttributeIterator(const AttributeManager &manager,ssize_t index);
51 
52  explicit operator bool() const
53  {
54  return !(index()<0 || index()>=static_cast<ssize_t>(manager_.get().size()));
55  }
56 
58 
60 
65 
68 
69  bool operator==(const AttributeIterator &a) const;
70 
71  bool operator!=(const AttributeIterator &a) const;
72 
73  private:
74 #ifdef _MSC_VER
75 #pragma warning(push)
76 #pragma warning(disable: 4251)
77 #endif
78  std::reference_wrapper<const AttributeManager> manager_;
79 #ifdef _MSC_VER
80 #pragma warning(pop)
81 #endif
82  Attribute current_attribute_;
83 
84 };
85 #ifdef __clang__
86 #pragma clang diagnostic pop
87 #endif
88 
89 } // namespace attribute
90 } // namespace hdf5
Definition: iterator.hpp:34
Definition: attribute_iterator.hpp:40
AttributeIterator operator++(int)
AttributeIterator operator--(int)
AttributeIterator(const AttributeIterator &)=default
bool operator!=(const AttributeIterator &a) const
AttributeIterator & operator-=(ssize_t i)
ssize_t difference_type
Definition: attribute_iterator.hpp:45
AttributeIterator & operator+=(ssize_t i)
AttributeIterator & operator--()
bool operator==(const AttributeIterator &a) const
AttributeIterator & operator++()
AttributeIterator(const AttributeManager &manager, ssize_t index)
std::random_access_iterator_tag iterator_category
Definition: attribute_iterator.hpp:46
provides STL interface for attributes
Definition: attribute_manager.hpp:63
Definition: attribute.hpp:49
top-level namespace of the entire library
Definition: attribute.hpp:45
#define DLL_EXPORT
Definition: windows.hpp:29