182 [[nodiscard]]
inline size_type getStart()
const;
187 [[nodiscard]]
inline size_type getStop()
const;
197 [[nodiscard]]
inline size_type getSize()
const;
202 [[nodiscard]]
inline bool isEmpty()
const;
263 [[nodiscard]]
inline bool isInRange(
size_type idx)
const;
268 const RANGE& getBase()
const;
273 explicit inline operator bool()
const;
286 cmpError = std::numeric_limits<int>::max(),
318 cmpOverlapsOther = 2,
326 cmpOverlapsSelf = -2,
384 [[nodiscard]]
inline id_type getId()
const;
409 inline bool operator!=(
const Range& r)
const;
417 inline bool operator<(
const Range& r)
const;
590 return split(seg_sz, *
this, rl_dst);
615inline Range::operator bool()
const
Type to contain and manipulate range lists.
Definition Range.h:67
Vector sort() const
Sorts the vector according the Range operator '<'.
Vector & rearrange()
Rearranges vector of ranges which means the vector is sorted and ranges are merged if possible.
Vector extract(const Vector &rl, Vector &rl_ex) const
Extracts the covered ranges in the vector using the 'rl' vector and puts them in the 'rl_ex' vector.
Vector & sort()
Sorts the vector according the Range operator '<'.
Vector & merge(const Vector &rl_add)
Adds the passed list to this vector and rearranges it.
Class to manage 64-bit integer ranges.
Definition Range.h:52
ECompare compare(const Range &other) const
Base function for comparing ranges.
bool operator>=(const Range &r)=delete
Not allowed operator.
RANGE::size_type size_type
Integer type used for start and stop.
Definition Range.h:57
Range & set(const RANGE &r)
InitializeBase instance with other instance.
const Range & copyTo(RANGE &dst) const
Definition Range.h:662
bool isOverlapped(const Range &r) const
Returns if the passed range have some overlap.
void clear()
Clears the range to an empty state.
Definition Range.h:570
size_type getStop() const
Const function to access the stop of the range.
Definition Range.h:554
Range operator+(const Range &r) const
Returns a new range which is a super Set of the two ranges.
static size_type split(size_type seg_sz, const Range &req, Vector &rl_dst)
Splits a range into segments bounded ranges according to the passed segment size.
bool operator>(const Range &r)=delete
Not allowed operator.
friend std::istream & operator>>(std::istream &is, Range &r)
Input stream operator for a range.
Range & assign(size_type start, size_type stop, id_type id=0)
Assigns the data members.
Range & setId(id_type id)
Set the owner id of this range.
Definition Range.h:564
bool operator>=(const Range &r) const =delete
Not allowed operator.
const RANGE & getBase() const
Gets the underlying base structure.
Definition Range.h:610
Range & operator=(Range &&)=default
Move assignment operator is default.
id_type getId() const
Returns the owner id of this range.
Definition Range.h:559
RANGE::id_type id_type
Integer type used for the ID.
Definition Range.h:61
void normalize()
Swaps start and stop if the order is wrong.
bool operator==(const Range &r) const
Tests if the range start and stop members are the same.
Definition Range.h:620
Range operator&(const Range &r) const
And operator which is a subset of both range where elements of the one also exist in the other range.
bool operator<=(const Range &r) const =delete
Not allowed operator.
bool operator>(const Range &r) const =delete
Not allowed operator.
size_type split(size_type seg_sz, Vector &rl_dst) const
Splits this range into segments bounded ranges according to the passed segment size.
Definition Range.h:588
size_type getSize() const
Returns the size of the range minimum is 1.
Definition Range.h:583
static size_type split(size_type seg_sz, const Vector &req, Vector &rl)
Same as split but now for a complete vector of ranges.
Vector::iter_type Iterator
Iteration type for lists of ranges.
Definition Range.h:119
bool operator<=(const Range &r)=delete
Not allowed operator.
bool operator<(const Range &r) const
Operator used for sorting. Depends only on the start position first and then the stop position....
Definition Range.h:630
bool isInRange(size_type idx) const
Check if idx is within this range.
Definition Range.h:657
friend std::ostream & operator<<(std::ostream &os, const Range &r)
Output stream operator for a range.
bool isWithinOther(const Range &r) const
Returns true if the passed range is part of this range.
ECompare
All possible comparison results.
Definition Range.h:282
@ cmpSame
Definition Range.h:294
Range()
Default constructor.
Definition Range.h:525
Range & operator+=(const Range &r)
Returns a new range which is a super Set of the two ranges.
Definition Range.h:635
bool isWithinSelf(const Range &r) const
Returns true if this range is part of the passed range.
bool isEmpty() const
Return true if the range is empty.
Definition Range.h:593
size_type getStart() const
Const function to access the start of the range.
Definition Range.h:549
Range offset(size_type ofs) const
Shifts the range using the passed offset.
Definition Range.h:652
int exclude(const Range &r, Range &rest, Range::ECompare *cmp=nullptr)
Exclude the range in the other which could result in an single range (0), an additional second range ...
bool operator!=(const Range &r) const
Tests if the range start and stop members are not the same.
Definition Range.h:625
Range & offsetBy(size_type ofs)
Shifts this range using the passed offset.
Definition Range.h:645
Range & operator&=(const Range &r)
And operator which is a subset of both range where elements of the one also exist in the other range.
Definition Range.h:640
bool isExtension(const Range &r) const
Returns if the passed range an extension of this one.
bool isMergeable(const Range &r) const
Returns true if the passed range can be combined to this range without having to bridge a gap.
Counted vector having function names compatible with Borland C++ templates.
Definition TVector.h:398
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
#define _MISC_FUNC
Definition misc/global.h:39
#define _MISC_CLASS
Definition misc/global.h:40
#define _MISC_DATA
Definition misc/global.h:38
Definition Application.h:10
_GII_FUNC std::istream & operator>>(std::istream &is, ResultData &)
Stream operator for setting up this instance with a setup std::string.
_MISC_DATA bool RangeCompareExact
_GII_FUNC std::ostream & operator<<(std::ostream &os, const ResultData &)
Stream operator for the setup std::string.
_MISC_FUNC bool operator==(const Md5Hash::hash_type &h1, const Md5Hash::hash_type &h2)
Compare operator for storing an MD5 hash.
QRect operator+=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:66
uint64_t size_type
Integer type used for start and stop.
Definition Range.h:27
id_type _id
Identifier of this range.
Definition Range.h:43
int64_t id_type
Integer type used for the ID.
Definition Range.h:31
size_type _start
Start position of the range or interval.
Definition Range.h:35
size_type _stop
Stop position of the range or interval.
Definition Range.h:39