irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_linked_list_iterator.hpp
Go to the documentation of this file.
1 #ifndef IRODS_LINKED_LIST_ITERATOR_HPP
2 #define IRODS_LINKED_LIST_ITERATOR_HPP
3 
4 #include <iterator>
5 #include <type_traits>
6 #include <utility>
7 
8 namespace irods
9 {
10  template <typename T>
11  using has_next_pointer = std::enable_if_t<std::is_same<T*, decltype(std::declval<T>().next)>::value>;
12 
13  template <typename T>
14  using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
15 
16  template <typename T,
19  {
20  public:
22  using value_type = T;
23  using pointer = value_type*;
25  using iterator_category = std::forward_iterator_tag;
26 
27  linked_list_iterator() = default;
28 
29  explicit linked_list_iterator(pointer _node)
30  : node_{_node}
31  {
32  }
33 
35  {
36  if (node_)
37  {
38  node_ = node_->next;
39  }
40 
41  return *this;
42  }
43 
45  {
46  auto it{*this};
47  ++(*this);
48  return it;
49  }
50 
51  bool operator==(const linked_list_iterator& _other) const noexcept
52  {
53  return node_ == _other.node_;
54  }
55 
56  bool operator!=(const linked_list_iterator& _other) const noexcept
57  {
58  return !(*this == _other);
59  }
60 
62  {
63  return *node_;
64  }
65 
67  {
68  return node_;
69  }
70 
71  private:
73  }; // linked_list_iterator
74 } // namespace irods
75 
76 #endif // IRODS_LINKED_LIST_ITERATOR_HPP
77 
irods::linked_list_iterator::operator*
reference operator*() const
Definition: irods_linked_list_iterator.hpp:61
irods::linked_list_iterator::node_
pointer node_
Definition: irods_linked_list_iterator.hpp:72
irods::linked_list_iterator::operator==
bool operator==(const linked_list_iterator &_other) const noexcept
Definition: irods_linked_list_iterator.hpp:51
pointer
Definition: parser.hpp:34
irods::linked_list_iterator
Definition: irods_linked_list_iterator.hpp:19
irods::linked_list_iterator::linked_list_iterator
linked_list_iterator()=default
irods::linked_list_iterator::operator->
pointer operator->() const
Definition: irods_linked_list_iterator.hpp:66
irods.pypyodbc.long
long
Definition: pypyodbc.py:43
irods::linked_list_iterator::operator++
linked_list_iterator operator++(int) noexcept
Definition: irods_linked_list_iterator.hpp:44
irods::remove_cvref_t
std::remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
Definition: irods_linked_list_iterator.hpp:14
irods
Definition: apiHandler.hpp:35
irods::linked_list_iterator::operator!=
bool operator!=(const linked_list_iterator &_other) const noexcept
Definition: irods_linked_list_iterator.hpp:56
irods::linked_list_iterator::difference_type
long difference_type
Definition: irods_linked_list_iterator.hpp:21
get_irods_version.value
dictionary value
Definition: get_irods_version.py:27
irods::has_next_pointer
std::enable_if_t< std::is_same< T *, decltype(std::declval< T >().next)>::value > has_next_pointer
Definition: irods_linked_list_iterator.hpp:11
irods::linked_list_iterator::reference
value_type & reference
Definition: irods_linked_list_iterator.hpp:24
irods::linked_list_iterator::value_type
T value_type
Definition: irods_linked_list_iterator.hpp:22
irods::linked_list_iterator::linked_list_iterator
linked_list_iterator(pointer _node)
Definition: irods_linked_list_iterator.hpp:29
irods::linked_list_iterator::operator++
linked_list_iterator & operator++() noexcept
Definition: irods_linked_list_iterator.hpp:34
irods::linked_list_iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: irods_linked_list_iterator.hpp:25