tool::iterator_base< Bottom > Struct Template Reference

Common implementation for most iterators. More...

#include <trace-tools/tool/iterator_base.hh>

Inheritance diagram for tool::iterator_base< Bottom >:

tool::iterator< Bottom > tool::static_base< Bottom > pcapxx::internals::frame_iterator< Desc, Bottom > wifi::frame::filter::internals::ui_iterator< U, I, H, B, Bottom >

List of all members.

Public Types

typedef HIDDEN exact_type
typedef HIDDEN value_type
typedef HIDDEN iterable_type
typedef size_t difference_type

Public Member Functions

 iterator_base (iterable_type &i, bool end)
bool equal (const iterator_base &) const
const value_typeget () const
const value_typeget_ptr () const
Equality checks
bool operator== (const exact_type &) const
bool operator!= (const exact_type &) const
Increment operators
const exact_typeoperator++ ()
exact_type operator++ (int)
Indirections
const value_typeoperator * () const
const value_typeoperator-> () const
Downcast methods
const exact_typeexact () const
exact_typeexact ()
const exact_typeexact_ptr () const
exact_typeexact_ptr ()

Protected Types

typedef
boost::optional
< value_type
optional_value

Protected Member Functions

 ~iterator_base ()

Protected Attributes

iterable_typei_
optional_value v_


Detailed Description

template<class Bottom>
struct tool::iterator_base< Bottom >

Common implementation for most iterators.

iterator_base implements equal(), get(), and get_ptr() from iterator. iterator_base embeds its value inside a boost::optional<value_type> attribute. To subclass it, just implement the increment() method and define the value_type and iterable_type virtual types. increment() shall retrieve the iterator's next value and store it into v_ . Store boost::none_t() into v_ to indicate the end.

You may access the iterator's iterable object through the i_ attribute.


Member Typedef Documentation

template<class Bottom>
typedef HIDDEN tool::iterator_base< Bottom >::exact_type

Exact type for this template instantiation.

Reimplemented from tool::iterator< Bottom >.

Reimplemented in pcapxx::internals::frame_iterator< Desc, Bottom >, and wifi::frame::filter::internals::ui_iterator< U, I, H, B, Bottom >.

template<class Bottom>
typedef HIDDEN tool::iterator_base< Bottom >::value_type

This iterator's value type.

Reimplemented from tool::iterator< Bottom >.

template<class Bottom>
typedef HIDDEN tool::iterator_base< Bottom >::iterable_type

Type of the iterable structure the iterator is obtained from.

Reimplemented in wifi::frame::filter::internals::ui_iterator< U, I, H, B, Bottom >.

template<class Bottom>
typedef boost::optional<value_type> tool::iterator_base< Bottom >::optional_value [protected]

Type for v_.

template<class Bottom>
typedef size_t tool::iterator< Bottom >::difference_type [inherited]

This iterator's difference type.


Constructor & Destructor Documentation

template<class B>
tool::iterator_base< B >::iterator_base ( iterable_type i,
bool  end 
) [inline]

iterable -compatible constructor.

template<class B>
tool::iterator_base< B >::~iterator_base (  )  [inline, protected]

Protected destructor: iterator_base is abstract.


Member Function Documentation

template<class B>
bool tool::iterator_base< B >::equal ( const iterator_base< Bottom > &  rhs  )  const [inline]

Equality check.

See also:
iterator

template<class B>
const iterator_base< B >::value_type & tool::iterator_base< B >::get (  )  const [inline]

Indirection as a reference.

See also:
iterator

template<class B>
const iterator_base< B >::value_type * tool::iterator_base< B >::get_ptr (  )  const [inline]

Indirection as a pointer.

See also:
iterator

template<class Bottom>
const static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact (  )  const [inline, inherited]

Safely downcast to the exact type as a const reference.

template<class Bottom>
static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact (  )  [inline, inherited]

Safely downcast to the exact type as a non-const reference.

template<class Bottom>
const static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr (  )  const [inline, inherited]

Safely downcast to the exact type as a const pointer.

template<class Bottom>
static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr (  )  [inline, inherited]

Safely downcast to the exact type as a non-const pointer.


Member Data Documentation

template<class Bottom>
iterable_type* tool::iterator_base< Bottom >::i_ [protected]

Pointer to the iterable object.

template<class Bottom>
optional_value tool::iterator_base< Bottom >::v_ [protected]

Current value, or boost::none_t.


The documentation for this struct was generated from the following files:
Generated on Wed Sep 12 16:02:47 2007 for trace-tools by  doxygen 1.5.3