NSCL DDAS
1.0
Support for XIA DDAS at the NSCL
|
#include <TrIterator.hpp>
Public Member Functions | |
TrRange (const TrIterator< T > &b=TrIterator< T >(), const TrIterator< T > &e=TrIterator< T >()) | |
Default constructor. More... | |
TrRange (const TrIterator< T > &ref, int range) | |
Range specified constructor. More... | |
TrRange (const TrRange &that) | |
Copy constructor. | |
TrRange & | operator= (const TrRange &that) |
Assignment operator. | |
TrIterator< T > | begin () const |
Get value of begin iterator. | |
TrIterator< T > | end () const |
Get value of end iterator. | |
TrRange & | operator++ () |
++range style incrementation More... | |
TrRange | operator++ (int) |
range++ style incrementation More... | |
TrRange & | operator-- () |
–range style decrementation More... | |
TrRange | operator-- (int) |
Decrementation range–;. More... | |
TrRange | operator+ (int n) const |
range+n style increment More... | |
TrRange | operator- (int n) const |
range-n style decrement More... | |
TrRange & | operator+= (int n) |
range += n support More... | |
TrRange & | operator-= (int n) |
range -=n style decrement More... | |
TrIterator< T >::difference_type | range () const |
Compute distance between begin and end. More... | |
void | invert () |
Swap begin and end iterators. | |
bool | operator== (const TrRange &that) const |
Equality operator. More... | |
bool | operator!= (const TrRange &that) const |
Inequality operator. | |
bool | operator< (const TrRange &that) const |
Less than operator. More... | |
bool | operator> (const TrRange &that) const |
Greater than operator. More... | |
bool | operator<= (const TrRange &that) const |
Greater than or equal operator. | |
bool | operator>= (const TrRange &that) const |
Less than or equal operator. | |
TrRange class.
A convenience class for defining iterator ranges. Most algorithms operate within a bounded region, and this provides a means for defining ranges for use in those algorithms. A strength of this class is the ability to define a range based on a single iterator and integral range specification. Ranges are typically used such that begin() is the first element of a range of valid elements and end() is the first element beyond valid elements, i.e., [begin, end) in mathematical notation.
NOTE: This class cannot determine whether or not the two iterators provided to it are associated with each other. For example, it is possible to construct a range in the following way without any errors.
TrRange<type> range( trace0.begin(), trace1.end() );
|
inline |
Default constructor.
Constructs a range from two iterators. There is no ability to determine whether the two arguments are associated with the same trace. If they are not, then problems are likely to ensue.
b | iterator defining beginning of range |
e | iterator defining ending of range |
|
inline |
Range specified constructor.
Construct a range based on a single iterator and an offset from it. If the range is negative, the range will be generated such that ref is at the end by swapping begin and end. In this way, this constructor will always guarantee that the the beginning and end of the range are in increasing order.
ref | iterator identifying begining (end) of range if range arg is positive (negative) |
range | width of range, can be either positive or negative |
|
inline |
range+n style increment
Increments both the begin and end iterators together.
|
inline |
++range style incrementation
Increments both the begin and end iterators together.
|
inline |
range++ style incrementation
Returns a copy of the current range while also incrementing both the begin and end iterators.
|
inline |
range += n support
Increments both the begin and end iterators together.
|
inline |
range-n style decrement
Decrements both the begin and end iterators together.
|
inline |
–range style decrementation
Decrements both the begin and end iterators together.
|
inline |
Decrementation range–;.
Returns a copy of the current range while also decrementing both the begin and end iterators.
|
inline |
range -=n style decrement
Decrements both the begin and end iterators together.
|
inline |
|
inline |
Equality operator.
Equality implies that both begin and end iterators are the same
|
inline |
|
inline |
Compute distance between begin and end.