ESA JPIP server  0.1
jpeg2000::Range Class Reference

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>

Collaboration diagram for jpeg2000::Range:

Public Member Functions

 Range ()
 Initializes the object. More...
 
 Range (int first, int last)
 Initializes the object. More...
 
 Range (const Range &range)
 Copy constructor. More...
 
Rangeoperator= (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

jpeg2000::Range::Range ( )
inline

Initializes the object.

jpeg2000::Range::Range ( int  first,
int  last 
)
inline

Initializes the object.

Parameters
firstFirst value.
lastLast value.
jpeg2000::Range::Range ( const Range range)
inline

Copy constructor.

virtual jpeg2000::Range::~Range ( )
inlinevirtual

Member Function Documentation

int jpeg2000::Range::GetIndex ( int  item) const
inline

Returns the index of an item of the range.

Parameters
itemItem of the range.
Returns
item - first.
int jpeg2000::Range::GetItem ( int  i) const
inline

Returns an item of the range, starting at the first value.

Parameters
iItem index.
Returns
first + i.

Here is the caller graph for this function:

bool jpeg2000::Range::IsValid ( ) const
inline

Returns true if the first value if greater or equal to zero, and it is less or equal to the last value.

int jpeg2000::Range::Length ( ) const
inline

Returns the length of the range (last - first + 1).

Here is the caller graph for this function:

Range& jpeg2000::Range::operator= ( const Range range)
inline

Copy assignment.

Friends And Related Function Documentation

bool operator!= ( const Range a,
const Range b 
)
friend
ostream& operator<< ( ostream &  out,
const Range range 
)
friend
bool operator== ( const Range a,
const Range b 
)
friend

Member Data Documentation

int jpeg2000::Range::first

First value of the range.

int jpeg2000::Range::last

Last value of the range.


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