MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class used to specify a span (or subsequence) of indices. More...
#include <mdsRange.h>
Public Member Functions | |
CRange () | |
Default constructor initializes range of a zero length. | |
CRange (tSize First, tSize Last) | |
Index of the first and the last item. | |
int | getBegin () const |
Returns index of the first item. | |
int | getEnd () const |
Returns index of the item just after the last one. | |
int | getFirst () const |
Returns index of the first item. | |
int | getLast () const |
Returns index of the last item. | |
tSize | getSize () const |
Returns length of the range. | |
bool | isEmpty () const |
Returns true if the range is empty. | |
CRange & | operator&= (const CRange &r) |
CRange & | operator+= (tSize d) |
CRange & | operator-= (tSize d) |
CRange & | operator= (const CRange &r) |
Assignment operator. | |
Static Public Member Functions | |
static CRange | all () |
Returns a range representing all posible values. | |
Public Attributes | |
int | m_Begin |
Index of the first item. | |
int | m_End |
Index of the item just after the last one. | |
Friends | |
bool | operator!= (const CRange &a, const CRange &b) |
CRange | operator& (const CRange &a, const CRange &b) |
Operator calculates intersection of two given ranges. | |
CRange | operator+ (const CRange &r, tSize d) |
Shifts the whole range. | |
CRange | operator- (const CRange &r, tSize d) |
Shifts the whole range. | |
bool | operator== (const CRange &a, const CRange &b) |
Comparison operator. |
Class used to specify a span (or subsequence) of indices.
Default constructor initializes range of a zero length.
mds::CRange::CRange | ( | tSize | First, |
tSize | Last | ||
) |
Index of the first and the last item.
static CRange mds::CRange::all | ( | ) | [static] |
Returns a range representing all posible values.
int mds::CRange::getBegin | ( | ) | const |
Returns index of the first item.
int mds::CRange::getEnd | ( | ) | const |
Returns index of the item just after the last one.
int mds::CRange::getFirst | ( | ) | const |
Returns index of the first item.
int mds::CRange::getLast | ( | ) | const |
Returns index of the last item.
tSize mds::CRange::getSize | ( | ) | const |
Returns length of the range.
bool mds::CRange::isEmpty | ( | ) | const |
Returns true if the range is empty.
Operator calculates intersection of two given ranges.
Index of the first item.
Index of the item just after the last one.