A set containing a union of [start,end) ranges that are automatically sorted and merged when possible. More...
Public Types | |
typedef TBoundary | Boundary |
typedef TBoundary | Boundary |
Public Member Functions | |
void | Init () |
Creates an empty set of ranges. | |
void | Init () |
Creates an empty set of ranges. | |
const Range & | operator[] (index_t i) const |
Gets a constant range element. | |
const Range & | operator[] (index_t i) const |
Gets a constant range element. | |
const ArrayList< Range > & | ranges () const |
const ArrayList< Range > & | ranges () const |
void | Reset () |
Reinitializes to an empty set of ranges. | |
void | Reset () |
Reinitializes to an empty set of ranges. | |
index_t | size () const |
Gets the number of discrete ranges. | |
index_t | size () const |
Gets the number of discrete ranges. | |
void | Union (const Boundary &begin, const Boundary &end) |
Unions this with a particular range. | |
void | Union (const Boundary &begin, const Boundary &end) |
Unions this with a particular range. |
A set containing a union of [start,end) ranges that are automatically sorted and merged when possible.
The copy constructor and inequality operators must be defined of the template class.
This is O(N) insertion, so not efficient for large sets.
Definition at line 54 of file rangeset.h.
void RangeSet< TBoundary >::Init | ( | ) | [inline] |
Creates an empty set of ranges.
Definition at line 80 of file rangeset.h.
References ArrayList< TElem >::Init().
void RangeSet< TBoundary >::Init | ( | ) | [inline] |
Creates an empty set of ranges.
Definition at line 80 of file rangeset.h.
References ArrayList< TElem >::Init().
const Range& RangeSet< TBoundary >::operator[] | ( | index_t | i | ) | const [inline] |
Gets a constant range element.
Definition at line 105 of file rangeset.h.
const Range& RangeSet< TBoundary >::operator[] | ( | index_t | i | ) | const [inline] |
Gets a constant range element.
Definition at line 105 of file rangeset.h.
void RangeSet< TBoundary >::Reset | ( | ) | [inline] |
Reinitializes to an empty set of ranges.
Definition at line 87 of file rangeset.h.
References ArrayList< TElem >::Clear().
void RangeSet< TBoundary >::Reset | ( | ) | [inline] |
Reinitializes to an empty set of ranges.
Definition at line 87 of file rangeset.h.
References ArrayList< TElem >::Clear().
index_t RangeSet< TBoundary >::size | ( | ) | const [inline] |
Gets the number of discrete ranges.
Definition at line 112 of file rangeset.h.
References ArrayList< TElem >::size().
index_t RangeSet< TBoundary >::size | ( | ) | const [inline] |
Gets the number of discrete ranges.
Definition at line 112 of file rangeset.h.
References ArrayList< TElem >::size().
void RangeSet< TBoundary >::Union | ( | const Boundary & | begin, | |
const Boundary & | end | |||
) |
Unions this with a particular range.
This will automatically merge with any surrounding ranges.
void RangeSet< TBoundary >::Union | ( | const Boundary & | begin, | |
const Boundary & | end | |||
) | [inline] |
Unions this with a particular range.
This will automatically merge with any surrounding ranges.
Definition at line 119 of file rangeset.h.
References ArrayList< TElem >::begin(), ArrayList< TElem >::end(), ArrayList< TElem >::Init(), ArrayList< TElem >::PushBackCopy(), ArrayList< TElem >::PushBackRaw(), ArrayList< TElem >::size(), and ArrayList< TElem >::Swap().