Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AMOS::Range_t Struct Reference

A gapped coordinate range. More...

#include <datatypes_AMOS.hh>

List of all members.

Public Member Functions

 Range_t ()
 Constructs an empty Range_t object.
 Range_t (const Range_t &source)
 Copy constructor.
 Range_t (Pos_t b, Pos_t e)
 Constructs a Range_t object.
 ~Range_t ()
 Destroys a Range_t object.
void clear ()
 Clears the range to an empty range [0,0).
Pos_t getBegin () const
 Get the beginning of the range.
Pos_t getLo () const
 Get the lo range position, (begin < end ? begin : end).
Pos_t getHi () const
 Get the hi range position, (begin > end ? begin : end).
Pos_t getEnd () const
 Get the end of the range.
Size_t getLength () const
 Get the length of the range.
bool isReverse () const
 Returns true if begin > end, otherwise false.
void setBegin (Pos_t b)
 Set the beginning of the range.
void setEnd (Pos_t e)
 Set the end of the range.
void setRange (Pos_t b, Pos_t e)
 Set the whole range.
void swap ()
 Exchange the beginning and end of the range.

Public Attributes

Pos_t begin
 The begin of the range.
Pos_t end
 The end of the range.


Detailed Description

A gapped coordinate range.

A range of values defined by the start and end gap numbers that bracket the requested values with gap counting starting at 0 (the gap before the first value). The minimum value points to the leftmost value in the list, while the maximum value points to one after the rightmost value in the list. For example, the range [2,5) for the list 0,1,2,3,4,5,6 would define the sublist 2,3,4. Reversed ranges are also allowed, for example (5,2] would define the subset 4,3,2.

Definition at line 120 of file datatypes_AMOS.hh.


Constructor & Destructor Documentation

AMOS::Range_t::Range_t  )  [inline]
 

Constructs an empty Range_t object.

Sets begin and end to zero, thus creating a zero length range Definition at line 132 of file datatypes_AMOS.hh.

References clear().

AMOS::Range_t::Range_t const Range_t source  )  [inline]
 

Copy constructor.

Parameters:
source The range to be copied
Definition at line 143 of file datatypes_AMOS.hh.

AMOS::Range_t::Range_t Pos_t  b,
Pos_t  e
[inline]
 

Constructs a Range_t object.

Sets begin and end to the parameter values

Parameters:
b Construct value of begin
e Construct value of end
Definition at line 157 of file datatypes_AMOS.hh.

References begin, end, and AMOS::Pos_t.

AMOS::Range_t::~Range_t  )  [inline]
 

Destroys a Range_t object.

Definition at line 167 of file datatypes_AMOS.hh.


Member Function Documentation

void AMOS::Range_t::clear  )  [inline]
 

Clears the range to an empty range [0,0).

Definition at line 176 of file datatypes_AMOS.hh.

References begin, and end.

Referenced by Range_t().

Pos_t AMOS::Range_t::getBegin  )  const [inline]
 

Get the beginning of the range.

Definition at line 185 of file datatypes_AMOS.hh.

References begin, and AMOS::Pos_t.

Pos_t AMOS::Range_t::getEnd  )  const [inline]
 

Get the end of the range.

Definition at line 212 of file datatypes_AMOS.hh.

References end, and AMOS::Pos_t.

Pos_t AMOS::Range_t::getHi  )  const [inline]
 

Get the hi range position, (begin > end ? begin : end).

Definition at line 203 of file datatypes_AMOS.hh.

References begin, end, and AMOS::Pos_t.

Size_t AMOS::Range_t::getLength  )  const [inline]
 

Get the length of the range.

Returns:
abs (end - begin)
Definition at line 223 of file datatypes_AMOS.hh.

References begin, end, and AMOS::Size_t.

Pos_t AMOS::Range_t::getLo  )  const [inline]
 

Get the lo range position, (begin < end ? begin : end).

Definition at line 194 of file datatypes_AMOS.hh.

References begin, end, and AMOS::Pos_t.

bool AMOS::Range_t::isReverse  )  const [inline]
 

Returns true if begin > end, otherwise false.

Returns:
true if begin > end, otherwise false
Definition at line 234 of file datatypes_AMOS.hh.

References begin, and end.

void AMOS::Range_t::setBegin Pos_t  b  )  [inline]
 

Set the beginning of the range.

Definition at line 243 of file datatypes_AMOS.hh.

References begin, and AMOS::Pos_t.

void AMOS::Range_t::setEnd Pos_t  e  )  [inline]
 

Set the end of the range.

Definition at line 252 of file datatypes_AMOS.hh.

References end, and AMOS::Pos_t.

void AMOS::Range_t::setRange Pos_t  b,
Pos_t  e
[inline]
 

Set the whole range.

Definition at line 261 of file datatypes_AMOS.hh.

References begin, end, and AMOS::Pos_t.

void AMOS::Range_t::swap  )  [inline]
 

Exchange the beginning and end of the range.

Definition at line 271 of file datatypes_AMOS.hh.

References begin, end, and AMOS::Pos_t.


Member Data Documentation

Pos_t AMOS::Range_t::begin
 

The begin of the range.

Definition at line 123 of file datatypes_AMOS.hh.

Referenced by clear(), getBegin(), getHi(), getLength(), getLo(), isReverse(), AMOS::operator<<(), Range_t(), setBegin(), setRange(), and swap().

Pos_t AMOS::Range_t::end
 

The end of the range.

Definition at line 124 of file datatypes_AMOS.hh.

Referenced by clear(), getEnd(), getHi(), getLength(), getLo(), isReverse(), AMOS::operator<<(), Range_t(), setEnd(), setRange(), and swap().


The documentation for this struct was generated from the following file:
Generated on Tue May 17 15:19:44 2005 for libAMOS by doxygen 1.3.8