std::set of util::Range, which does not allow any overlap in contained element. std::set<Range> w/ modified insert/emplace function. Original std::set does not allow
modification of element. I assume what we're interested in is "find if the range already \n
exists, and merge if it exists". The insert function does that by recursively looking up
overlapping elements w.r.t. input argument of insert function.
More...
#include <Range.h>
Public Member Functions | |
UniqueRangeSet () | |
default ctor More... | |
~UniqueRangeSet () | |
default dtor More... | |
void | Merge (const UniqueRangeSet< T > &in) |
Merge two UniqueRangeSet<T> More... | |
const T & | Start () const |
Very first "start" of all contained range. More... | |
const T & | End () const |
Very last "end" of all contained range. More... | |
UniqueRangeSet< T > | Exclusive (const T start, const T end) const |
size_t | emplace (const T &start, const T &end) |
Modified emplace that merges overlapping range. Return = # merged range. More... | |
size_t | insert (const Range< T > &a) |
Modified insert that merges overlapping range. Return = # merged range. More... | |
Additional Inherited Members | |
Public Attributes inherited from std::set< K > | |
K | keys |
STL member. More... | |
std::set of util::Range, which does not allow any overlap in contained element. std::set<Range> w/ modified insert/emplace function. Original std::set does not allow
modification of element. I assume what we're interested in is "find if the range already \n
exists, and merge if it exists". The insert function does that by recursively looking up
overlapping elements w.r.t. input argument of insert function.
One important function worth noting is util::UniqueRangeSet::Exclusive which takes two
input arguments, "start" and "end", and returns util::UniqueRangeSet of all exclusive
regions between "start" and "end". By definition, merging this return with the original
instance will result in 1 huge util::Range.
|
inline |
|
inline |
|
inline |
Modified emplace that merges overlapping range. Return = # merged range.
Definition at line 94 of file UniqueRangeSet.h.
|
inline |
Very last "end" of all contained range.
Definition at line 55 of file UniqueRangeSet.h.
|
inline |
It takes two input arguments, "start" and "end", and returns util::UniqueRangeSet
of all exclusive regions between "start" and "end". By definition, merging this
return with the original instance will result in 1 huge util::Range.
Definition at line 66 of file UniqueRangeSet.h.
|
inline |
Modified insert that merges overlapping range. Return = # merged range.
Definition at line 113 of file UniqueRangeSet.h.
|
inline |
Merge two UniqueRangeSet<T>
Definition at line 44 of file UniqueRangeSet.h.
|
inline |
Very first "start" of all contained range.
Definition at line 48 of file UniqueRangeSet.h.