annotate DEPENDENCIES/generic/include/boost/intrusive/detail/iiterator.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents f46d142149f5
children
rev   line source
Chris@102 1 /////////////////////////////////////////////////////////////////////////////
Chris@102 2 //
Chris@102 3 // (C) Copyright Ion Gaztanaga 2006-2014
Chris@102 4 //
Chris@102 5 // Distributed under the Boost Software License, Version 1.0.
Chris@102 6 // (See accompanying file LICENSE_1_0.txt or copy at
Chris@102 7 // http://www.boost.org/LICENSE_1_0.txt)
Chris@102 8 //
Chris@102 9 // See http://www.boost.org/libs/intrusive for documentation.
Chris@102 10 //
Chris@102 11 /////////////////////////////////////////////////////////////////////////////
Chris@102 12
Chris@102 13 #ifndef BOOST_INTRUSIVE_DETAIL_IITERATOR_HPP
Chris@102 14 #define BOOST_INTRUSIVE_DETAIL_IITERATOR_HPP
Chris@102 15
Chris@102 16 #ifndef BOOST_CONFIG_HPP
Chris@102 17 # include <boost/config.hpp>
Chris@102 18 #endif
Chris@102 19
Chris@102 20 #if defined(BOOST_HAS_PRAGMA_ONCE)
Chris@102 21 # pragma once
Chris@102 22 #endif
Chris@102 23
Chris@102 24 #include <boost/intrusive/detail/iterator.hpp>
Chris@102 25 #include <boost/intrusive/pointer_traits.hpp>
Chris@102 26 #include <boost/intrusive/detail/mpl.hpp>
Chris@102 27 #include <boost/intrusive/detail/is_stateful_value_traits.hpp>
Chris@102 28
Chris@102 29 namespace boost {
Chris@102 30 namespace intrusive {
Chris@102 31
Chris@102 32 template<class ValueTraits>
Chris@102 33 struct value_traits_pointers
Chris@102 34 {
Chris@102 35 typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
Chris@102 36 (boost::intrusive::detail::
Chris@102 37 , ValueTraits, value_traits_ptr
Chris@102 38 , typename boost::intrusive::pointer_traits<typename ValueTraits::node_traits::node_ptr>::template
Chris@102 39 rebind_pointer<ValueTraits>::type) value_traits_ptr;
Chris@102 40
Chris@102 41 typedef typename boost::intrusive::pointer_traits<value_traits_ptr>::template
Chris@102 42 rebind_pointer<ValueTraits const>::type const_value_traits_ptr;
Chris@102 43 };
Chris@102 44
Chris@102 45 template<class ValueTraits, bool IsConst, class Category>
Chris@102 46 struct iiterator
Chris@102 47 {
Chris@102 48 typedef ValueTraits value_traits;
Chris@102 49 typedef typename value_traits::node_traits node_traits;
Chris@102 50 typedef typename node_traits::node node;
Chris@102 51 typedef typename node_traits::node_ptr node_ptr;
Chris@102 52 typedef ::boost::intrusive::pointer_traits<node_ptr> nodepointer_traits_t;
Chris@102 53 typedef typename nodepointer_traits_t::template
Chris@102 54 rebind_pointer<void>::type void_pointer;
Chris@102 55 typedef typename ValueTraits::value_type value_type;
Chris@102 56 typedef typename ValueTraits::pointer nonconst_pointer;
Chris@102 57 typedef typename ValueTraits::const_pointer yesconst_pointer;
Chris@102 58 typedef typename ::boost::intrusive::pointer_traits
Chris@102 59 <nonconst_pointer>::reference nonconst_reference;
Chris@102 60 typedef typename ::boost::intrusive::pointer_traits
Chris@102 61 <yesconst_pointer>::reference yesconst_reference;
Chris@102 62 typedef typename nodepointer_traits_t::difference_type difference_type;
Chris@102 63 typedef typename detail::if_c
Chris@102 64 <IsConst, yesconst_pointer, nonconst_pointer>::type pointer;
Chris@102 65 typedef typename detail::if_c
Chris@102 66 <IsConst, yesconst_reference, nonconst_reference>::type reference;
Chris@102 67 typedef iterator
Chris@102 68 < Category
Chris@102 69 , value_type
Chris@102 70 , difference_type
Chris@102 71 , pointer
Chris@102 72 , reference
Chris@102 73 > iterator_traits;
Chris@102 74 typedef typename value_traits_pointers
Chris@102 75 <ValueTraits>::value_traits_ptr value_traits_ptr;
Chris@102 76 typedef typename value_traits_pointers
Chris@102 77 <ValueTraits>::const_value_traits_ptr const_value_traits_ptr;
Chris@102 78 static const bool stateful_value_traits =
Chris@102 79 detail::is_stateful_value_traits<value_traits>::value;
Chris@102 80 };
Chris@102 81
Chris@102 82 template<class NodePtr, class StoredPointer, bool StatefulValueTraits = true>
Chris@102 83 struct iiterator_members
Chris@102 84 {
Chris@102 85
Chris@102 86 iiterator_members()
Chris@102 87 : nodeptr_()//Value initialization to achieve "null iterators" (N3644)
Chris@102 88 {}
Chris@102 89
Chris@102 90 iiterator_members(const NodePtr &n_ptr, const StoredPointer &data)
Chris@102 91 : nodeptr_(n_ptr), ptr_(data)
Chris@102 92 {}
Chris@102 93
Chris@102 94 StoredPointer get_ptr() const
Chris@102 95 { return ptr_; }
Chris@102 96
Chris@102 97 NodePtr nodeptr_;
Chris@102 98 StoredPointer ptr_;
Chris@102 99 };
Chris@102 100
Chris@102 101 template<class NodePtr, class StoredPointer>
Chris@102 102 struct iiterator_members<NodePtr, StoredPointer, false>
Chris@102 103 {
Chris@102 104 iiterator_members()
Chris@102 105 : nodeptr_()//Value initialization to achieve "null iterators" (N3644)
Chris@102 106 {}
Chris@102 107
Chris@102 108 iiterator_members(const NodePtr &n_ptr, const StoredPointer &)
Chris@102 109 : nodeptr_(n_ptr)
Chris@102 110 {}
Chris@102 111
Chris@102 112 StoredPointer get_ptr() const
Chris@102 113 { return StoredPointer(); }
Chris@102 114
Chris@102 115 NodePtr nodeptr_;
Chris@102 116 };
Chris@102 117
Chris@102 118 } //namespace intrusive
Chris@102 119 } //namespace boost
Chris@102 120
Chris@102 121 #endif //BOOST_INTRUSIVE_DETAIL_IITERATOR_HPP