19#ifndef INCLUDED_SW_INC_RING_HXX
20#define INCLUDED_SW_INC_RING_HXX
26#include <boost/iterator/iterator_facade.hpp>
27#include <boost/intrusive/circular_list_algorithms.hpp>
31 template <
typename value_type>
class RingContainer;
32 template <
typename value_type>
class RingIterator;
37 template <
typename value_type>
44 virtual ~Ring() COVERITY_NOEXCEPT_FALSE
61 void MoveTo( value_type* pDestRing );
85 {
return static_cast<value_type *
>(m_pNext); }
88 {
return static_cast<value_type *
>(m_pPrev); }
91 {
return static_cast<value_type *
>(m_pNext); }
94 {
return static_cast<value_type *
>(m_pPrev); }
117 friend class boost::iterator_core_access;
118 typedef boost::intrusive::circular_list_algorithms<Ring_node_traits>
algo;
123 template <
typename value_type>
130 algo::link_before(pObj,
this);
134 template <
typename value_type>
137 value_type* pThis =
static_cast< value_type*
>(
this);
142 algo::link_before(pDestRing, pThis);
149 template <
typename value_type>
174 {
return std::distance(
begin(),
end()); }
186 assert(m_pStart->m_pPrev != aDestRing.
m_pStart);
187 assert(m_pStart != aDestRing.
m_pStart->m_pPrev);
188 std::swap(m_pStart->m_pPrev->m_pNext, aDestRing.
m_pStart->m_pPrev->m_pNext);
189 std::swap(m_pStart->m_pPrev, aDestRing.
m_pStart->m_pPrev);
193 template <
typename value_type>
195 RingIterator<value_type>
197 , boost::forward_traversal_tag
239 template <
typename value_type>
243 template <
typename value_type>
247 template <
typename value_type>
251 template <
typename value_type>
255 template <
typename value_type>
259 template <
typename value_type>
helper class that provides Svalue_typeL-style container iteration to the ring
value_type * m_pStart
the item in the ring where iteration starts
void merge(RingContainer< value_type > aDestRing)
Merges two ring containers.
std::remove_const< value_type >::type nonconst_value_type
RingIterator< const value_type > const_iterator
RingIterator< value_type > iterator
RingContainer(value_type *pRing)
iterator begin()
iterator access
bool equal(RingIterator const &other) const
std::remove_const< value_type >::type nonconst_value_type
RingIterator(nonconst_value_type *pRing, bool bStart=true)
value_type & dereference() const
nonconst_value_type * m_pStart
the first item of the iteration
nonconst_value_type * m_pCurrent
value_type is:
friend class boost::iterator_core_access
const_value_type * GetNextInRing() const
friend const_ring_container
boost::intrusive::circular_list_algorithms< Ring_node_traits > algo
virtual ~Ring() COVERITY_NOEXCEPT_FALSE
std::add_const< value_type >::type const_value_type
void MoveTo(value_type *pDestRing)
Removes this item from its current ring container and adds it to another ring container.
void unlink()
algo::unlink is buggy! don't call it directly!
RingContainer< value_type > ring_container
Ring()
Creates a new item in a ring container all by itself.
Ring(value_type *pRing)
Creates a new item and add it to an existing ring container.
ring_container GetRingContainer()
value_type * GetPrevInRing()
RingContainer< const_value_type > const_ring_container
const_ring_container GetRingContainer() const
const_value_type * GetPrevInRing() const
value_type * GetNextInRing()
enumrange< T >::Iterator begin(enumrange< T >)
Dialog to specify the properties of date form field.
internal implementation class – not for external use
static node_ptr get_previous(const_node_ptr n)
const Ring * const_node_ptr
static node_ptr get_next(const_node_ptr n)
static void set_next(node_ptr n, node_ptr next)
static void set_previous(node_ptr n, node_ptr previous)