Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::cb_details::iterator< Buff, Traits > Struct Template Reference

Random access iterator for the circular buffer. More...

#include <details.hpp>

Inheritance diagram for boost::cb_details::iterator< Buff, Traits >:
Collaboration diagram for boost::cb_details::iterator< Buff, Traits >:

Public Types

typedef boost::iterator
< std::random_access_iterator_tag,
typename Traits::value_type,
typename
Traits::difference_type,
typename Traits::pointer,
typename Traits::reference > 
base_iterator
 Base iterator. More...
 
typedef iterator< Buff,
typename Traits::nonconst_self > 
nonconst_self
 Non-const iterator. More...
 
typedef base_iterator::value_type value_type
 The type of the elements stored in the circular buffer. More...
 
typedef base_iterator::pointer pointer
 Pointer to the element. More...
 
typedef base_iterator::reference reference
 Reference to the element. More...
 
typedef Traits::size_type size_type
 Size type. More...
 
typedef
base_iterator::difference_type 
difference_type
 Difference type. More...
 

Public Member Functions

 iterator ()
 Default constructor. More...
 
 iterator (const nonconst_self &it)
 
 iterator (const Buff *cb, const pointer p)
 
iteratoroperator= (const iterator &it)
 Assign operator. More...
 
reference operator* () const
 Dereferencing operator. More...
 
pointer operator-> () const
 Dereferencing operator. More...
 
template<class Traits0 >
difference_type operator- (const iterator< Buff, Traits0 > &it) const
 Difference operator. More...
 
iteratoroperator++ ()
 Increment operator (prefix). More...
 
iterator operator++ (int)
 Increment operator (postfix). More...
 
iteratoroperator-- ()
 Decrement operator (prefix). More...
 
iterator operator-- (int)
 Decrement operator (postfix). More...
 
iteratoroperator+= (difference_type n)
 Iterator addition. More...
 
iterator operator+ (difference_type n) const
 Iterator addition. More...
 
iteratoroperator-= (difference_type n)
 Iterator subtraction. More...
 
iterator operator- (difference_type n) const
 Iterator subtraction. More...
 
reference operator[] (difference_type n) const
 Element access operator. More...
 
template<class Traits0 >
bool operator== (const iterator< Buff, Traits0 > &it) const
 Equality. More...
 
template<class Traits0 >
bool operator!= (const iterator< Buff, Traits0 > &it) const
 Inequality. More...
 
template<class Traits0 >
bool operator< (const iterator< Buff, Traits0 > &it) const
 Less. More...
 
template<class Traits0 >
bool operator> (const iterator< Buff, Traits0 > &it) const
 Greater. More...
 
template<class Traits0 >
bool operator<= (const iterator< Buff, Traits0 > &it) const
 Less or equal. More...
 
template<class Traits0 >
bool operator>= (const iterator< Buff, Traits0 > &it) const
 Greater or equal. More...
 
template<class Traits0 >
Traits0::pointer linearize_pointer (const iterator< Buff, Traits0 > &it) const
 Get a pointer which would point to the same element as the iterator in case the circular buffer is linearized. More...
 

Public Attributes

const Buff * m_buff
 The circular buffer where the iterator points to. More...
 
pointer m_it
 An internal iterator. More...
 

Detailed Description

template<class Buff, class Traits>
struct boost::cb_details::iterator< Buff, Traits >

Random access iterator for the circular buffer.

Parameters
BuffThe type of the underlying circular buffer.
TraitsBasic iterator types.
Note
This iterator is not circular. It was designed for iterating from begin() to end() of the circular buffer.

Member Typedef Documentation

template<class Buff, class Traits>
typedef boost::iterator< std::random_access_iterator_tag, typename Traits::value_type, typename Traits::difference_type, typename Traits::pointer, typename Traits::reference> boost::cb_details::iterator< Buff, Traits >::base_iterator

Base iterator.

template<class Buff, class Traits>
typedef base_iterator::difference_type boost::cb_details::iterator< Buff, Traits >::difference_type

Difference type.

template<class Buff, class Traits>
typedef iterator<Buff, typename Traits::nonconst_self> boost::cb_details::iterator< Buff, Traits >::nonconst_self

Non-const iterator.

template<class Buff, class Traits>
typedef base_iterator::pointer boost::cb_details::iterator< Buff, Traits >::pointer

Pointer to the element.

template<class Buff, class Traits>
typedef base_iterator::reference boost::cb_details::iterator< Buff, Traits >::reference

Reference to the element.

template<class Buff, class Traits>
typedef Traits::size_type boost::cb_details::iterator< Buff, Traits >::size_type

Size type.

template<class Buff, class Traits>
typedef base_iterator::value_type boost::cb_details::iterator< Buff, Traits >::value_type

The type of the elements stored in the circular buffer.

Constructor & Destructor Documentation

template<class Buff, class Traits>
boost::cb_details::iterator< Buff, Traits >::iterator ( )
inline

Default constructor.

template<class Buff, class Traits>
boost::cb_details::iterator< Buff, Traits >::iterator ( const nonconst_self it)
inline
template<class Buff, class Traits>
boost::cb_details::iterator< Buff, Traits >::iterator ( const Buff *  cb,
const pointer  p 
)
inline

Member Function Documentation

template<class Buff, class Traits>
template<class Traits0 >
Traits0::pointer boost::cb_details::iterator< Buff, Traits >::linearize_pointer ( const iterator< Buff, Traits0 > &  it) const
inline

Get a pointer which would point to the same element as the iterator in case the circular buffer is linearized.

References boost::cb_details::iterator< Buff, Traits >::m_it.

Referenced by boost::cb_details::iterator< Buff, Traits >::operator-(), and boost::cb_details::iterator< Buff, Traits >::operator<().

template<class Buff, class Traits>
template<class Traits0 >
bool boost::cb_details::iterator< Buff, Traits >::operator!= ( const iterator< Buff, Traits0 > &  it) const
inline
template<class Buff, class Traits>
reference boost::cb_details::iterator< Buff, Traits >::operator* ( ) const
inline
template<class Buff, class Traits>
iterator boost::cb_details::iterator< Buff, Traits >::operator+ ( difference_type  n) const
inline

Iterator addition.

References boost::n.

template<class Buff, class Traits>
iterator& boost::cb_details::iterator< Buff, Traits >::operator++ ( )
inline

Increment operator (prefix).

References BOOST_CB_ASSERT, and boost::spirit::support::detail::is_valid().

template<class Buff, class Traits>
iterator boost::cb_details::iterator< Buff, Traits >::operator++ ( int  )
inline

Increment operator (postfix).

template<class Buff, class Traits>
iterator& boost::cb_details::iterator< Buff, Traits >::operator+= ( difference_type  n)
inline
template<class Buff, class Traits>
template<class Traits0 >
difference_type boost::cb_details::iterator< Buff, Traits >::operator- ( const iterator< Buff, Traits0 > &  it) const
inline
template<class Buff, class Traits>
iterator boost::cb_details::iterator< Buff, Traits >::operator- ( difference_type  n) const
inline

Iterator subtraction.

References boost::n.

template<class Buff, class Traits>
iterator& boost::cb_details::iterator< Buff, Traits >::operator-- ( )
inline

Decrement operator (prefix).

References BOOST_CB_ASSERT, and boost::spirit::support::detail::is_valid().

template<class Buff, class Traits>
iterator boost::cb_details::iterator< Buff, Traits >::operator-- ( int  )
inline

Decrement operator (postfix).

template<class Buff, class Traits>
iterator& boost::cb_details::iterator< Buff, Traits >::operator-= ( difference_type  n)
inline

Iterator subtraction.

References BOOST_CB_ASSERT, boost::spirit::support::detail::is_valid(), and boost::n.

template<class Buff, class Traits>
pointer boost::cb_details::iterator< Buff, Traits >::operator-> ( ) const
inline

Dereferencing operator.

References boost::cb_details::iterator< Buff, Traits >::operator*().

template<class Buff, class Traits>
template<class Traits0 >
bool boost::cb_details::iterator< Buff, Traits >::operator< ( const iterator< Buff, Traits0 > &  it) const
inline
template<class Buff, class Traits>
template<class Traits0 >
bool boost::cb_details::iterator< Buff, Traits >::operator<= ( const iterator< Buff, Traits0 > &  it) const
inline

Less or equal.

References boost::it.

template<class Buff, class Traits>
iterator& boost::cb_details::iterator< Buff, Traits >::operator= ( const iterator< Buff, Traits > &  it)
inline
template<class Buff, class Traits>
template<class Traits0 >
bool boost::cb_details::iterator< Buff, Traits >::operator== ( const iterator< Buff, Traits0 > &  it) const
inline
template<class Buff, class Traits>
template<class Traits0 >
bool boost::cb_details::iterator< Buff, Traits >::operator> ( const iterator< Buff, Traits0 > &  it) const
inline

Greater.

template<class Buff, class Traits>
template<class Traits0 >
bool boost::cb_details::iterator< Buff, Traits >::operator>= ( const iterator< Buff, Traits0 > &  it) const
inline

Greater or equal.

References boost::it.

template<class Buff, class Traits>
reference boost::cb_details::iterator< Buff, Traits >::operator[] ( difference_type  n) const
inline

Element access operator.

References boost::n.

Member Data Documentation

template<class Buff, class Traits>
const Buff* boost::cb_details::iterator< Buff, Traits >::m_buff

The circular buffer where the iterator points to.

Referenced by boost::cb_details::iterator< Buff, Traits >::operator=().


The documentation for this struct was generated from the following file: