A range queue.
More...
#include <rangequeue.h>
|
void | clear () |
| Clears the queue. More...
|
|
bool | contains (uint32_t index) const |
| Checks if the given index is contained in the queue. More...
|
|
void | copy (RangeQueue< T > &destination, T start, T end) |
| Copy all ranges within the given limits [start, end]. If the limit falls in a certain range, that range is split and included from the start until the limit. More...
|
|
T | count () const |
| Returns the total number of indices captured by the ranges in the queue. More...
|
|
bool | empty () const |
| Returns true if the queue is empty. More...
|
|
T | first () const |
| Returns the first index of the first range in the queue. More...
|
|
T | last () const |
| Returns the last (highest) index in the queue. More...
|
|
const T | operator[] (std::size_t index) const |
|
void | popBack (T upto) |
| Removes all the indices upto and including upto from the queue. More...
|
|
void | popFront (T upto) |
| Removes all the indices upto and including upto from the queue. More...
|
|
void | pushBack (T start, T end) |
| Adds a range to the back of the queue Only a range newer than the most recent range in the queue is added. Older (also partial) are ignored Also end must be larger or equal than start. More...
|
|
| RangeQueue () |
| Default constructor. More...
|
|
T | recount () |
| Returns the recounted total number of indices captured by the ranges in the queue. More...
|
|
void | remove (T index) |
| Removes a specific index from the queue. More...
|
|
virtual | ~RangeQueue () |
|
template<class T>
class RangeQueue< T >
A range queue.
Definition at line 75 of file rangequeue.h.
◆ RangeQueue()
◆ ~RangeQueue()
◆ clear()
◆ contains()
Checks if the given index is contained in the queue.
Definition at line 259 of file rangequeue.h.
◆ copy()
Copy all ranges within the given limits [start, end]. If the limit falls in a certain range, that range is split and included from the start until the limit.
Definition at line 307 of file rangequeue.h.
◆ count()
Returns the total number of indices captured by the ranges in the queue.
Definition at line 272 of file rangequeue.h.
◆ empty()
Returns true if the queue is empty.
Definition at line 290 of file rangequeue.h.
◆ first()
Returns the first index of the first range in the queue.
Definition at line 206 of file rangequeue.h.
◆ illegalIndex()
Returns the value for an illegal index.
Definition at line 297 of file rangequeue.h.
◆ last()
Returns the last (highest) index in the queue.
Definition at line 216 of file rangequeue.h.
◆ operator[]()
template<class T >
const T RangeQueue< T >::operator[] |
( |
std::size_t |
index | ) |
const |
|
inline |
- Returns
- a range limit.
- Parameters
-
index | start or end limit to return. |
Concatenating the start and end points for each range will generate a list of limits, this function gives access to such a list. For example:
- index 0: start of the first range
- index 1: end of the first range
- index 2: start of the second range
- ...
Definition at line 236 of file rangequeue.h.
◆ popBack()
Removes all the indices upto and including upto from the queue.
Definition at line 179 of file rangequeue.h.
◆ popFront()
Removes all the indices upto and including upto from the queue.
Definition at line 152 of file rangequeue.h.
◆ pushBack()
Adds a range to the back of the queue Only a range newer than the most recent range in the queue is added. Older (also partial) are ignored Also end must be larger or equal than start.
- Parameters
-
start | : The first index of the range |
end | The last index of the range |
Definition at line 103 of file rangequeue.h.
◆ recount()
Returns the recounted total number of indices captured by the ranges in the queue.
Definition at line 279 of file rangequeue.h.
◆ remove()
Removes a specific index from the queue.
- Parameters
-
This function removes the given index from the queue by splitting the containing range at the index
Definition at line 122 of file rangequeue.h.
◆ m_count
◆ m_mutex
◆ m_queue
The documentation for this class was generated from the following file: