tool::iterable< Bottom > Struct Template Reference

Base class to represent iterable objects. More...

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

Inheritance diagram for tool::iterable< Bottom >:

tool::static_base< Bottom > pcapxx::descriptor< Bottom > tool::window_maker< InputIterator, WSize, Step, Bottom > wifi::frame::filter::uniquely_identifiable< UniqueId, InputIterator, HeaderType, Bottom >

List of all members.

Public Types

typedef HIDDEN exact_type
typedef HIDDEN iterator

Public Member Functions

iterator begin ()
iterator end ()
template<class OutputIterator>
void operator() (const OutputIterator &output)
Downcast methods
const exact_typeexact () const
exact_typeexact ()
const exact_typeexact_ptr () const
exact_typeexact_ptr ()


Detailed Description

template<class Bottom = bottom>
struct tool::iterable< Bottom >

Base class to represent iterable objects.

An iterable oject aggregates elements on which iteration is possible. iterable provides basic mechanisms to permorm this iteration. That is, it provides an iterable::iterator type, begin() / end() methods, and operator()().

In order to subclass iterable, you must define an iterator type for your iterable class. This type must have a similar constructor:

 my_iterator::my_iterator(my_iterable& e, bool at_end);

The first argument refers to the object you want to iterate on. The second one indicates whether to point the iterator at the begining or past the end of this object's elements.

Once you defined this iterator type, just declare it as part of your iterable class' virtual types :

 template <MyIterableParams>
 struct types< MyIterable<MyIterableParams> >
 {
   typedef my_iterator iterator;
 };

See also:
iterator

Member Typedef Documentation

template<class Bottom = bottom>
typedef HIDDEN tool::iterable< Bottom >::exact_type

Exact type for this template instantiation.

Reimplemented from tool::static_base< Bottom >.

template<class Bottom = bottom>
typedef HIDDEN tool::iterable< Bottom >::iterator

Iterator type for this template instantiation.


Member Function Documentation

template<class B>
iterable< B >::iterator tool::iterable< B >::begin (  )  [inline]

Get an iterator to the first element.

template<class B>
iterable< B >::iterator tool::iterable< B >::end (  )  [inline]

Get an iterator to the end (past the last element).

template<class B>
template<class O>
void tool::iterable< B >::operator() ( const O &  output  )  [inline]

Copy elements to output .

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.


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