#include <trace-tools/tool/iterator_base.hh>
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_type & | get () const |
const value_type * | get_ptr () const |
Equality checks | |
bool | operator== (const exact_type &) const |
bool | operator!= (const exact_type &) const |
Increment operators | |
const exact_type & | operator++ () |
exact_type | operator++ (int) |
Indirections | |
const value_type & | operator * () const |
const value_type * | operator-> () const |
Downcast methods | |
const exact_type & | exact () const |
exact_type & | exact () |
const exact_type * | exact_ptr () const |
exact_type * | exact_ptr () |
Protected Types | |
typedef boost::optional < value_type > | optional_value |
Protected Member Functions | |
~iterator_base () | |
Protected Attributes | |
iterable_type * | i_ |
optional_value | v_ |
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.
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 >.
typedef HIDDEN tool::iterator_base< Bottom >::value_type |
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 >.
typedef boost::optional<value_type> tool::iterator_base< Bottom >::optional_value [protected] |
Type for v_.
typedef size_t tool::iterator< Bottom >::difference_type [inherited] |
This iterator's difference type.
tool::iterator_base< B >::iterator_base | ( | iterable_type & | i, | |
bool | end | |||
) | [inline] |
iterable -compatible constructor.
tool::iterator_base< B >::~iterator_base | ( | ) | [inline, protected] |
Protected destructor: iterator_base is abstract.
bool tool::iterator_base< B >::equal | ( | const iterator_base< Bottom > & | rhs | ) | const [inline] |
const iterator_base< B >::value_type & tool::iterator_base< B >::get | ( | ) | const [inline] |
const iterator_base< B >::value_type * tool::iterator_base< B >::get_ptr | ( | ) | const [inline] |
const static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact | ( | ) | const [inline, inherited] |
Safely downcast to the exact type as a const reference.
static_base< Bottom >::exact_type & tool::static_base< Bottom >::exact | ( | ) | [inline, inherited] |
Safely downcast to the exact type as a non-const reference.
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.
static_base< Bottom >::exact_type * tool::static_base< Bottom >::exact_ptr | ( | ) | [inline, inherited] |
Safely downcast to the exact type as a non-const pointer.
iterable_type* tool::iterator_base< Bottom >::i_ [protected] |
Pointer to the iterable object.
optional_value tool::iterator_base< Bottom >::v_ [protected] |
Current value, or boost::none_t
.