bidir_node_iterator.hpp
Go to the documentation of this file.
1 /* Copyright 2003-2014 Joaquin M Lopez Munoz.
2  * Distributed under the Boost Software License, Version 1.0.
3  * (See accompanying file LICENSE_1_0.txt or copy at
4  * http://www.boost.org/LICENSE_1_0.txt)
5  *
6  * See http://www.boost.org/libs/multi_index for library home page.
7  */
8 
9 #ifndef BOOST_MULTI_INDEX_DETAIL_BIDIR_NODE_ITERATOR_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_BIDIR_NODE_ITERATOR_HPP
11 
12 #if defined(_MSC_VER)
13 #pragma once
14 #endif
15 
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/operators.hpp>
18 
19 #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
22 #endif
23 
24 namespace boost{
25 
26 namespace multi_index{
27 
28 namespace detail{
29 
30 /* Iterator class for node-based indices with bidirectional
31  * iterators (ordered and sequenced indices.)
32  */
33 
34 template<typename Node>
37  bidir_node_iterator<Node>,
38  typename Node::value_type,
39  std::ptrdiff_t,
40  const typename Node::value_type*,
41  const typename Node::value_type&>
42 {
43 public:
44  /* coverity[uninit_ctor]: suppress warning */
46  explicit bidir_node_iterator(Node* node_):node(node_){}
47 
48  const typename Node::value_type& operator*()const
49  {
50  return node->value();
51  }
52 
54  {
55  Node::increment(node);
56  return *this;
57  }
58 
60  {
61  Node::decrement(node);
62  return *this;
63  }
64 
65 #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
66  /* Serialization. As for why the following is public,
67  * see explanation in safe_mode_iterator notes in safe_mode.hpp.
68  */
69 
71 
72  typedef typename Node::base_type node_base_type;
73 
74  template<class Archive>
75  void save(Archive& ar,const unsigned int)const
76  {
77  node_base_type* bnode=node;
78  ar<<serialization::make_nvp("pointer",bnode);
79  }
80 
81  template<class Archive>
82  void load(Archive& ar,const unsigned int)
83  {
84  node_base_type* bnode;
85  ar>>serialization::make_nvp("pointer",bnode);
86  node=static_cast<Node*>(bnode);
87  }
88 #endif
89 
90  /* get_node is not to be used by the user */
91 
92  typedef Node node_type;
93 
94  Node* get_node()const{return node;}
95 
96 private:
97  Node* node;
98 };
99 
100 template<typename Node>
102  const bidir_node_iterator<Node>& x,
103  const bidir_node_iterator<Node>& y)
104 {
105  return x.get_node()==y.get_node();
106 }
107 
108 } /* namespace multi_index::detail */
109 
110 } /* namespace multi_index */
111 
112 } /* namespace boost */
113 
114 #endif
boost::multi_index::detail::bidir_node_iterator::node_type
Node node_type
Definition: bidir_node_iterator.hpp:92
config.hpp
boost::operators_impl::bidirectional_iterator_helper
Definition: operators.hpp:862
boost::multi_index::detail::bidir_node_iterator::operator--
bidir_node_iterator & operator--()
Definition: bidir_node_iterator.hpp:59
boost::multi_index::detail::bidir_node_iterator::node
Node * node
Definition: bidir_node_iterator.hpp:97
nvp.hpp
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::multi_index::detail::operator==
bool operator==(const bidir_node_iterator< Node > &x, const bidir_node_iterator< Node > &y)
Definition: bidir_node_iterator.hpp:101
boost::multi_index::detail::bidir_node_iterator::node_base_type
Node::base_type node_base_type
Definition: bidir_node_iterator.hpp:72
boost::multi_index::detail::bidir_node_iterator
Definition: bidir_node_iterator.hpp:35
boost::multi_index::detail::bidir_node_iterator::save
void save(Archive &ar, const unsigned int) const
Definition: bidir_node_iterator.hpp:75
BOOST_SERIALIZATION_SPLIT_MEMBER
#define BOOST_SERIALIZATION_SPLIT_MEMBER()
Definition: split_member.hpp:76
split_member.hpp
boost::serialization::make_nvp
const nvp< T > make_nvp(const char *name, T &t)
Definition: nvp.hpp:79
boost::multi_index::detail::bidir_node_iterator::load
void load(Archive &ar, const unsigned int)
Definition: bidir_node_iterator.hpp:82
boost::multi_index::detail::bidir_node_iterator::bidir_node_iterator
bidir_node_iterator()
Definition: bidir_node_iterator.hpp:45
operators.hpp
boost::multi_index::detail::bidir_node_iterator::bidir_node_iterator
bidir_node_iterator(Node *node_)
Definition: bidir_node_iterator.hpp:46
boost::multi_index::detail::bidir_node_iterator::operator*
const Node::value_type & operator*() const
Definition: bidir_node_iterator.hpp:48
boost::multi_index::detail::bidir_node_iterator::operator++
bidir_node_iterator & operator++()
Definition: bidir_node_iterator.hpp:53
boost::multi_index::detail::bidir_node_iterator::get_node
Node * get_node() const
Definition: bidir_node_iterator.hpp:94


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:37:15