retdec
|
#include <range.h>
Public Types | |
using | RangeType = T |
Public Member Functions | |
Range () | |
Range (const RangeType &start, const RangeType &end) | |
Range (const Range< RangeType > &range) | |
Range (Range< RangeType > &&range) noexcept(std::is_nothrow_move_constructible< RangeType >::value) | |
virtual | ~Range ()=default |
Range & | operator= (const Range< RangeType > &rhs)=default |
Range & | operator= (Range< RangeType > &&rhs)=default |
const RangeType & | getStart () const |
const RangeType & | getEnd () const |
void | setStart (const RangeType &start) |
void | setEnd (const RangeType &end) |
void | setStartEnd (const RangeType &start, const RangeType &end) |
RangeType | getSize () const |
bool | contains (const RangeType &value) const |
bool | contains (const Range< RangeType > &o) const |
bool | overlaps (const Range< RangeType > &o) const |
bool | operator== (const Range< RangeType > &rhs) const |
bool | operator< (const Range< RangeType > &rhs) const |
bool | operator!= (const Range< RangeType > &rhs) const |
Protected Attributes | |
RangeType | _start |
RangeType | _end |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Range< RangeType > &r) |
Range <start, end) – including start, excluding end.
Range class can be used to represent the range defined by two specific values, one starting and one ending value. These values can be of any type, but this type must provide subtraction operator and must have relational operators defined.
Parametrized | type of the range. |
using retdec::common::Range< T >::RangeType = T |
|
inline |
Default constructor.
|
inline |
Constructor for specific range.
start | The starting value of the range. |
end | The ending value of the range. |
|
inline |
Copy constructor.
range | Range to copy. |
|
inlinenoexcept |
Move constructor.
range | Range to move. |
|
virtualdefault |
Destructor.
|
inline |
Checks whether range fully contains given range, i.e. it contains both its start and end.
o | Range to check. |
|
inline |
Checks whether range contains given value. It checks for non-strict order.
value | Value to check. |
|
inline |
Returns the ending value of the range.
|
inline |
Returns the size of the range.
|
inline |
Returns the starting value of the range.
|
inline |
Return whether two ranges are not equal. They are equal if their starting and ending values are the same.
|
inline |
Return whether this range less than rhs
. It is less if its starting value is less than rhs starting value.
|
default |
Assign operator.
rhs | Right-hand side of the assignment. |
|
default |
Move-assign operator.
rhs | Right-hand side of the assignment. |
|
inline |
Return whether two ranges are equal. They are equal if their starting and ending values are the same.
|
inline |
Check whether range overlaps with the given range, i.e. there exists some value that which is in both ranges.
|
inline |
Sets the ending value of the range.
end | The ending value of the range. |
|
inline |
Sets the starting value of the range.
start | The starting value of the range. |
|
inline |
Sets the starting value of the range.
start | The starting value of the range. |
end | The ending value of the range. |
|
friend |
|
protected |
|
protected |