ESA JPIP server
0.1
|
Represents a range of integer values, defined by two values, first and last, which are assumed to be included in the range. More...
#include <range.h>
Public Member Functions | |
Range () | |
Initializes the object. More... | |
Range (int first, int last) | |
Initializes the object. More... | |
Range (const Range &range) | |
Copy constructor. More... | |
Range & | operator= (const Range &range) |
Copy assignment. More... | |
bool | IsValid () const |
Returns true if the first value if greater or equal to zero, and it is less or equal to the last value. More... | |
int | GetItem (int i) const |
Returns an item of the range, starting at the first value. More... | |
int | GetIndex (int item) const |
Returns the index of an item of the range. More... | |
int | Length () const |
Returns the length of the range (last - first + 1). More... | |
virtual | ~Range () |
Public Attributes | |
int | first |
First value of the range. More... | |
int | last |
Last value of the range. More... | |
Friends | |
bool | operator== (const Range &a, const Range &b) |
bool | operator!= (const Range &a, const Range &b) |
ostream & | operator<< (ostream &out, const Range &range) |
Represents a range of integer values, defined by two values, first and last, which are assumed to be included in the range.
Some basic operations are defined for easing the work with ranges.
|
inline |
Initializes the object.
|
inline |
Initializes the object.
first | First value. |
last | Last value. |
|
inline |
Copy constructor.
|
inlinevirtual |
|
inline |
Returns the index of an item of the range.
item | Item of the range. |
|
inline |
Returns an item of the range, starting at the first value.
i | Item index. |
|
inline |
Returns true
if the first value if greater or equal to zero, and it is less or equal to the last value.
|
inline |
Returns the length of the range (last - first + 1).
|
friend |
int jpeg2000::Range::first |
First value of the range.
int jpeg2000::Range::last |
Last value of the range.