Mirror reflection library - Lagoon run-time layer 0.5.13

lagoon::range_base< MetaObject, Iterator > Class Template Reference

The base template for the implementation of ranges. More...

#include <lagoon/utils.hpp>

List of all members.

Public Member Functions

 range_base (const iterator &b, const iterator &e)
 Constructor taking two iterators.
bool empty (void) const
 Returns true if the range is empty.
size_t size (void) const
 Returns the size of the range i.e. the number of items.
void step_front (void)
 Moves the front of the range one item forward.
size_t leap_front (size_t leap)
 Moves the front of the range n items forward.
const shared< MetaObject > & front (void) const
 Returns the (pointer to the) item at the front of the range.
shared< MetaObjectat (size_t offs) const
 Returns the (pointer to the) item offs steps from the front.

Protected Types

typedef Iterator iterator

Protected Attributes

iterator current
iterator end

Friends

bool same_position (const range_base &a, const range_base &b)
 Checks if the front of both ranges points to the same elem.

Detailed Description

template<typename MetaObject, class Iterator>
class lagoon::range_base< MetaObject, Iterator >

The base template for the implementation of ranges.

This is a more flexible variant of the range<> template, allowing to specify the underlying item container to traverse.


Constructor & Destructor Documentation

template<typename MetaObject, class Iterator>
lagoon::range_base< MetaObject, Iterator >::range_base ( const iterator &  b,
const iterator &  e 
) [inline]

Constructor taking two iterators.

this constructor should NOT be used directly. Ranges are instantiated by Lagoon's internal code.


Member Function Documentation

template<typename MetaObject, class Iterator>
size_t lagoon::range_base< MetaObject, Iterator >::leap_front ( size_t  leap) [inline]

Moves the front of the range n items forward.

This member function moves the front of the range leap items forward. The leap parameter may be greater than size() resulting in an empty range. Returns the number of items actually leaped through.


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

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.