Fabcoin Core
0.16.2
P2P Digital Currency
|
Set of elements of a certain "ground range" representable by unions of ranges inside this ground range. More...
#include <RangeMask.h>
Classes | |
class | const_iterator |
Public Types | |
using | Range = std::pair< T, T > |
using | Ranges = std::vector< Range > |
Public Member Functions | |
RangeMask () | |
Constructs an empty range mask with empty ground range. More... | |
RangeMask (T _begin, T _end) | |
Constructs an empty range mask with ground range [_begin, _end). More... | |
RangeMask (Range const &_c) | |
Constructs an empty range mask with ground range _c. More... | |
RangeMask | unionedWith (RangeMask const &_m) const |
RangeMask | operator+ (RangeMask const &_m) const |
RangeMask | lowest (decltype(T{}-T{}) _items) const |
RangeMask | operator~ () const |
RangeMask | inverted () const |
RangeMask & | invert () |
Changes the range mask to its complement relative to the ground range and returns a reference to itself. More... | |
template<class S > | |
RangeMask | operator- (S const &_m) const |
template<class S > | |
RangeMask & | operator-= (S const &_m) |
RangeMask & | operator+= (RangeMask const &_m) |
RangeMask & | unionWith (RangeMask const &_m) |
RangeMask & | operator+= (Range const &_m) |
RangeMask & | unionWith (Range const &_m) |
Modifies this range mask to also include the range _m, which has to be a subset of the ground range. More... | |
RangeMask & | operator+= (T _m) |
Adds the single element _i to the range mask. More... | |
RangeMask & | unionWith (T _i) |
Adds the single element _i to the range mask. More... | |
bool | contains (T _i) const |
bool | empty () const |
bool | full () const |
void | clear () |
void | reset () |
std::pair< T, T > const & | all () const |
void | extendAll (T _i) |
Extends the ground range to include _i. More... | |
const_iterator | begin () const |
const_iterator | end () const |
T | next (T _t) const |
size_t | size () const |
size_t | firstOut () const |
size_t | lastIn () const |
Private Attributes | |
UnsignedRange | m_all |
The ground range. More... | |
std::map< T, T > | m_ranges |
Mapping begin -> end containing the ranges. More... | |
Friends | |
template<class U > | |
std::ostream & | operator<< (std::ostream &_out, RangeMask< U > const &_r) |
Set of elements of a certain "ground range" representable by unions of ranges inside this ground range.
Ranges are given as pairs (begin, end), denoting the interval [begin, end), i.e. end is excluded. Supports set-theoretic operators, size and iteration.
Definition at line 46 of file RangeMask.h.
using dev::RangeMask< T >::Range = std::pair<T, T> |
Definition at line 51 of file RangeMask.h.
using dev::RangeMask< T >::Ranges = std::vector<Range> |
Definition at line 52 of file RangeMask.h.
|
inline |
Constructs an empty range mask with empty ground range.
Definition at line 55 of file RangeMask.h.
|
inline |
Constructs an empty range mask with ground range [_begin, _end).
Definition at line 57 of file RangeMask.h.
|
inline |
Constructs an empty range mask with ground range _c.
Definition at line 59 of file RangeMask.h.
|
inline |
Definition at line 153 of file RangeMask.h.
|
inline |
|
inline |
Definition at line 141 of file RangeMask.h.
|
inline |
Definition at line 123 of file RangeMask.h.
|
inline |
Definition at line 131 of file RangeMask.h.
|
inline |
|
inline |
Extends the ground range to include _i.
Definition at line 155 of file RangeMask.h.
|
inline |
Definition at line 203 of file RangeMask.h.
|
inline |
Definition at line 136 of file RangeMask.h.
|
inline |
Changes the range mask to its complement relative to the ground range and returns a reference to itself.
Definition at line 95 of file RangeMask.h.
|
inline |
Definition at line 78 of file RangeMask.h.
|
inline |
Definition at line 210 of file RangeMask.h.
|
inline |
Definition at line 66 of file RangeMask.h.
|
inline |
Definition at line 183 of file RangeMask.h.
|
inline |
Definition at line 63 of file RangeMask.h.
|
inline |
Definition at line 100 of file RangeMask.h.
|
inline |
|
inline |
Adds the single element _i to the range mask.
Definition at line 116 of file RangeMask.h.
|
inline |
Definition at line 97 of file RangeMask.h.
|
inline |
|
inline |
Definition at line 75 of file RangeMask.h.
|
inline |
Definition at line 146 of file RangeMask.h.
|
inline |
Definition at line 195 of file RangeMask.h.
|
inline |
Definition at line 62 of file RangeMask.h.
|
inline |
Definition at line 102 of file RangeMask.h.
RangeMask& dev::RangeMask< T >::unionWith | ( | Range const & | _m | ) |
Modifies this range mask to also include the range _m, which has to be a subset of the ground range.
|
inline |
Adds the single element _i to the range mask.
Definition at line 118 of file RangeMask.h.
|
friend |
|
private |
The ground range.
Definition at line 219 of file RangeMask.h.
|
private |
Mapping begin -> end containing the ranges.
Definition at line 221 of file RangeMask.h.