wpl::tool::iterable< Bottom > Struct Template Reference

Base class to represent iterable objects. More...

#include <wipal/tool/iterable.hh>

Inheritance diagram for wpl::tool::iterable< Bottom >:
wpl::tool::static_base< Bottom > wpl::filter::fast_intersector< InputIterator1, InputIterator2, Bottom > wpl::filter::linear_regression_synchronizer< InputIterator, Bottom > wpl::filter::non_noisy_prism< InputIterator, Bottom > wpl::filter::time_adjuster< InputIterator1, InputIterator2, HeaderType, Bottom > wpl::filter::timetracker< InputIterator, HeaderType, Bottom > wpl::filter::uniquely_identifiable< UniqueId, InputIterator, HeaderType, Bottom > wpl::filter::windowed_merge< HeaderType, InputIterator1, InputIterator2, Bottom > wpl::pkt::stream< Bottom > wpl::tool::list_of_iterables< T, Bottom > wpl::tool::window_maker< InputIterator, WSize, Step, Bottom >

List of all members.

Public Types

typedef HIDDEN exact_type
Iterator types

typedef HIDDEN iterator
typedef iterator const_iterator

Public Member Functions

iterator begin () const
iterator end () const
template<class OutputIterator >
void operator() (const OutputIterator &output) const
template<class O >
void operator() (const O &o) const
template<class F >
void for_each (F &f) const
template<class F >
void for_each (const F &f) const
Apply a function/functor to each element

template<class Functor >
void for_each (Functor &f) const
template<class Functor >
void for_each (const Functor &f) const
Downcast methods

const exact_typeexact () const
exact_typeexact ()
const exact_typeexact_ptr () const
exact_typeexact_ptr ()

Detailed Description

template<class Bottom = bottom>
struct wpl::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 the iterable::iterator and iterable::const_iterator types, 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(const 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

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

Generated by  doxygen 1.6.2