Range iterator for array of ranges More...
#include <ranges-array.hpp>
Classes | |
class | Range |
Ranges for array More... | |
Protected Attributes | |
Range * | r |
Array for ranges. More... | |
int | c |
Current range. More... | |
int | n |
Number of ranges in array. More... | |
Constructors and initialization | |
Array (void) | |
Default constructor. More... | |
Array (Range *r, int n) | |
Initialize with n ranges from r. More... | |
void | init (Range *r, int n) |
Initialize with n ranges from r. More... | |
Iteration control | |
bool | operator() (void) const |
Test whether iterator is still at a range or done. More... | |
void | operator++ (void) |
Move iterator to next range (if possible) More... | |
void | reset (void) |
Reset iterator to start from beginning. More... | |
Range access | |
int | min (void) const |
Return smallest value of range. More... | |
int | max (void) const |
Return largest value of range. More... | |
unsigned int | width (void) const |
Return width of range (distance between minimum and maximum) More... | |
Range iterator for array of ranges
Allows to iterate the ranges as defined by an array where the ranges must be increasing and non-overlapping. The ranges can be iterated several times provided the iterator is reset by the reset member function.
Definition at line 50 of file ranges-array.hpp.
|
inline |
Default constructor.
Definition at line 98 of file ranges-array.hpp.
|
inline |
Initialize with n ranges from r.
Definition at line 101 of file ranges-array.hpp.
|
inline |
Initialize with n ranges from r.
Definition at line 105 of file ranges-array.hpp.
|
inline |
Test whether iterator is still at a range or done.
Definition at line 114 of file ranges-array.hpp.
|
inline |
Move iterator to next range (if possible)
Definition at line 110 of file ranges-array.hpp.
|
inline |
Reset iterator to start from beginning.
Definition at line 119 of file ranges-array.hpp.
|
inline |
Return smallest value of range.
Definition at line 124 of file ranges-array.hpp.
|
inline |
Return largest value of range.
Definition at line 128 of file ranges-array.hpp.
|
inline |
Return width of range (distance between minimum and maximum)
Definition at line 132 of file ranges-array.hpp.
|
protected |
Array for ranges.
Definition at line 59 of file ranges-array.hpp.
|
protected |
Current range.
Definition at line 61 of file ranges-array.hpp.
|
protected |
Number of ranges in array.
Definition at line 63 of file ranges-array.hpp.