5 #include <libutl/SortedCollection.h> 6 #include <libutl/TCollection.h> 28 template <
class T = Object>
64 findFirstIt(
const Object& key,
BidIt& it,
bool insert =
false)
const 70 findFirstIt(
const Object& key,
BidIt& it,
bool insert =
false)
88 findLinear(
const Object& key)
const 94 findLinearSorted(
const Object& key)
const 101 col()->operator+=(rhs);
106 col()->operator-=(rhs);
125 bool multiSet =
false)
const 157 return col()->
merge(rhs, out);
175 return col()->
unique(out);
180 col()->operator&=(rhs);
186 return col()->operator<=(rhs);
191 return col()->operator>=(rhs);
209 col()->
sort(algorithm);
237 return utl::cast<SortedCollection>(_col);
244 return utl::cast<SortedCollection>(_col);
bool isSubSet(const SortedCollection *rhs) const
Determine whether self is a subset of rhs.
Templated proxy for SortedCollection.
#define UTL_CLASS_IMPL_TPL(className, T)
Implementation of standard UTL++ functionality for a template class.
Collection * difference(const SortedCollection *rhs, Collection *out=nullptr) const
Determine the difference between self and rhs.
void intersect(const SortedCollection *rhs)
Set self to the intersection of self and rhs.
void intersect(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false, bool multiSet=false, bool outIsLHS=false)
Determine the intersection of two sorted sequences.
void merge(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false)
Merge two sorted sequences into a single sorted sequence.
bool intersects(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
Determine whether the intersection of two sorted sequences is non-empty.
void difference(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false, bool outIsLHS=false)
Determine the difference between two sorted sequences.
void sort(const FwdIt &begin, const FwdIt &end, const Ordering *ordering=nullptr, uint_t algorithm=sort_quickSort, size_t size=size_t_max)
Sort a sequence using a given algorithm.
Collection * intersection(const SortedCollection *rhs, Collection *out=nullptr, bool multiSet=false) const
Determine the intersection of self and rhs.
void multiKeyQuickSort(const FwdIt &begin, const FwdIt &end, bool key=true, bool reverse=false, size_t size=size_t_max)
Multi-key quick-sort a sequence.
void clobber(const SortedCollection *rhs)
Where self and rhs intersect, make self's object equal to the rhs version (i.e.
void findLastIt(const Object &key, BidIt &it) const
Find the last object matching the given key.
void reverse(const BidIt &begin, const BidIt &end)
Reverse a sequence.
Object * findLinear(const Object &key) const
Linear search for an object matching the given key.
void symmetricDifference(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false)
Determine the symmetric difference of two sorted sequences.
void findFirstIt(const Object &key, BidIt &it, bool insert=false) const
Find the first object matching the given key.
void sort()
Sort the collection using the quicksort algorithm.
Abstraction for a Collection whose objects may be sorted.
size_t intersectCard(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr, bool multiSet=false)
Determine the cardinality of the intersection of two sorted sequences.
void multiKeyQuickSort(bool key=true, bool reverse=false)
Multi-key quick-sort the collection.
Templated proxy for Collection.
bool intersects(const SortedCollection *rhs) const
Determine whether the intersection of self and rhs is non-empty.
bool isSuperSet(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
Determine whether the lhs sorted sequence is a superset of the rhs sorted sequence.
unsigned int uint_t
Unsigned integer.
Collection * unique(Collection *out=nullptr)
Remove duplicate objects.
Bi-directional iterator abstraction.
Collection * merge(const SortedCollection *rhs, Collection *out=nullptr) const
Merge with rhs to form a single sorted sequence.
#define UTL_CLASS_DECL_TPL(DC, T, BC)
Declaration of standard UTL++ functionality for a template class with one parameter.
Object * findLinearSorted(const Object &key) const
Linear search for an object matching the given key.
void findEqualRange(const Object &key, BidIt &begin, BidIt &end) const
Find the range elements [begin,end) that match a given key.
bool isSubSet(const FwdIt &lhsBegin, const FwdIt &lhsEnd, const FwdIt &rhsBegin, const FwdIt &rhsEnd, const Ordering *ordering=nullptr)
Determine whether the lhs sorted sequence is a subset of the rhs sorted sequence. ...
size_t intersectCard(const SortedCollection *rhs) const
Determine the cardinality of the intersection of self and rhs.
Collection * symmetricDifference(const SortedCollection *rhs, Collection *out=nullptr) const
Determine the symmetric difference of self and rhs.
void clobber()
Fake read/write access to all memory.
Root of UTL++ class hierarchy.
bool isSuperSet(const SortedCollection *rhs) const
Determine whether self is a superset of rhs.
void unique(const FwdIt &begin, const FwdIt &end, FwdIt &out, const Ordering *ordering=nullptr, bool cloning=false, bool outIsSrc=false)
Remove duplicate objects from a sorted sequence.
#define ASSERTD
Do an assertion in DEBUG mode only.
void reverse()
Reverse the order of the contained objects.