Mirror reflection library - Lagoon run-time layer 0.5.13
|
The base template for the implementation of ranges. More...
#include <lagoon/utils.hpp>
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< MetaObject > | at (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. |
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.
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.
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.