GCS::GIDRange Class Reference

A range of element IDs. More...

#include <GElementID.h>

Collaboration diagram for GCS::GIDRange:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GIDRange ()
 GIDRange (unsigned long lower_bound, unsigned long upper_bound)
unsigned long takeID ()
bool isEmpty () const
unsigned long count () const
void setRange (unsigned long low, unsigned long high)
unsigned long getLowerBound () const
unsigned long getUpperBound () const

Private Attributes

unsigned long LowerBound
unsigned long UpperBound

Detailed Description

A range of element IDs.

Represents a range of element IDs, usually used to store available free element IDs. The range itself includes the bounds, that means for example a range of 1 to 1 counts 1 while 2 to 5 counts 5-2+1 = 4 possible IDs. A range is considered to be empty as soon as lower bound > upper bound.


Constructor & Destructor Documentation

GCS::GIDRange::GIDRange (  ) 

Constructor (only for QValueList), initializes to 1 - 0.

GCS::GIDRange::GIDRange ( unsigned long  lower_bound,
unsigned long  upper_bound 
)

Constructor.


Member Function Documentation

unsigned long GCS::GIDRange::count (  )  const

Returns:
number of available IDs

unsigned long GCS::GIDRange::getLowerBound (  )  const

Returns:
lower bound of the range.

unsigned long GCS::GIDRange::getUpperBound (  )  const

Returns:
upper bound of the range.

bool GCS::GIDRange::isEmpty (  )  const

Returns:
true when ID Range is empty.

void GCS::GIDRange::setRange ( unsigned long  low,
unsigned long  high 
)

Sets the range of IDs.

unsigned long GCS::GIDRange::takeID (  ) 

Returns:
ID between LowerBound and UpperBound.

0 when no ID is available.


Member Data Documentation

unsigned long GCS::GIDRange::LowerBound [private]

Lower bound of the ID range. The range includes the bounds themselves as well.

unsigned long GCS::GIDRange::UpperBound [private]

Upper bound of the ID range. The range includes the bounds themselves as well.


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:33 2006 for G System by  doxygen 1.4.7