Main Page | Class List | File List | Class Members

clip::irange Class Reference

Represents a range of integers with constant spacing, e.g. 2, 5, 8, .., 32. More...

#include <picture.h>

List of all members.

Public Member Functions

 irange (const int &first, const int &second, const int &last)
 irange (const int &solevalue)
 irange r(5); means that the range is just the single integer 5.
 irange (const irange &other)
 Conventional copy constructor.
irangeoperator= (const irange &other)
 Conventional assignment.
 irange ()
 Instantiates range containing just the integer 0.
 ~irange ()
 Destructor.
int length ()
 Returns number of integers in the range.
int operator[] (const int &i) const
int operator== (const irange &other) const
 Test for ranges identical.
int operator!= (const irange &other) const
 Test for ranges different.
irangeoperator+= (const int &i)
 Example: irange r(0,2,10); r+=3; Then r is 3,5,7,9,11,13.
irangeoperator-= (const int &i)
 Other inc and dec operators are analogous to +=.


Detailed Description

Represents a range of integers with constant spacing, e.g. 2, 5, 8, .., 32.

iranges are used chiefly to index picture_of_ints and colour_picture_of_ints to define subimages.


Constructor & Destructor Documentation

clip::irange::irange const int &  first,
const int &  second,
const int &  last
 

irange r(0,1,7); means r represents the range of ints 0,1,2,3,4,5,6,7. Similarly, irange s(3,7,31); means s represents 3,7,11,15,19,23,27,31.


Member Function Documentation

int clip::irange::operator[] const int &  i  )  const
 

Example: If we declared irange r(0,2,10); then the numbers in the range are 0,2,4,6,8,10 and r[3] equals 6.


The documentation for this class was generated from the following file:
Generated on Sun Mar 13 20:59:22 2005 for clip by doxygen 1.3.8