openshot-audio
0.1.4
|
#include <juce_core.h>
Public Member Functions | |
SparseSet () | |
SparseSet (const SparseSet< Type > &other) | |
void | clear () |
bool | isEmpty () const noexcept |
Type | size () const |
Type | operator[] (Type index) const |
bool | contains (const Type valueToLookFor) const |
int | getNumRanges () const noexcept |
const Range< Type > | getRange (const int rangeIndex) const |
Range< Type > | getTotalRange () const |
void | addRange (const Range< Type > range) |
void | removeRange (const Range< Type > rangeToRemove) |
void | invertRange (const Range< Type > range) |
bool | overlapsRange (const Range< Type > range) |
bool | containsRange (const Range< Type > range) |
bool | operator== (const SparseSet< Type > &other) noexcept |
bool | operator!= (const SparseSet< Type > &other) noexcept |
Holds a set of primitive values, storing them as a set of ranges.
This container acts like an array, but can efficiently hold large contiguous ranges of values. It's quite a specialised class, mostly useful for things like keeping the set of selected rows in a listbox.
The type used as a template parameter must be an integer type, such as int, short, int64, etc.
|
inline |
Creates a new empty set.
|
inline |
Creates a copy of another SparseSet.
|
inline |
Adds a range of contiguous values to the set. e.g. addRange (Range <int> (10, 14)) will add (10, 11, 12, 13) to the set.
|
inline |
Clears the set.
|
inline |
Checks whether a particular value is in the set.
|
inline |
Checks whether the whole of a given range is contained within this one.
|
inlinenoexcept |
Returns the number of contiguous blocks of values.
|
inline |
Returns one of the contiguous ranges of values stored.
rangeIndex | the index of the range to look up, between 0 and (getNumRanges() - 1) |
|
inline |
Returns the range between the lowest and highest values in the set.
|
inline |
Does an XOR of the values in a given range.
|
inlinenoexcept |
Checks whether the set is empty.
This is much quicker than using (size() == 0).
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Returns one of the values in the set.
index | the index of the value to retrieve, in the range 0 to (size() - 1). |
|
inline |
Checks whether any part of a given range overlaps any part of this set.
|
inline |
Removes a range of values from the set. e.g. removeRange (Range<int> (10, 14)) will remove (10, 11, 12, 13) from the set.
|
inline |
Returns the number of values in the set.
Because of the way the data is stored, this method can take longer if there are a lot of items in the set. Use isEmpty() for a quick test of whether there are any items.