106 template <
typename K_TYPE,
108 typename HASH = hash<K_TYPE>,
109 typename ALLOC = allocator<couple<const K_TYPE, V_TYPE>>>
111 :
public hashTable<K_TYPE, V_TYPE, ALLOC, HASH>,
112 public map<K_TYPE, V_TYPE, ALLOC>,
113 public iterable<couple<const K_TYPE, V_TYPE>>,
238 void next()
const override;
244 void prev()
const override;
292 hashMap(
const hashMap& other);
301 hashMap&
operator=(
const hashMap& other);
309 hashMap(hashMap&& other)
noexcept;
319 hashMap&
operator=(hashMap&& other)
noexcept;
345 void swap(hashMap& other)
noexcept;
351 [[nodiscard]] u_integer
size()
const override;
358 bool contains(
const couple<const K_TYPE, V_TYPE> &e)
const override;
366 bool add(
const K_TYPE &k,
const V_TYPE &v)
override;
373 bool remove(
const K_TYPE &k)
override;
380 [[nodiscard]]
bool containsKey(
const K_TYPE &k)
const override;
388 V_TYPE
get(
const K_TYPE &k)
const override;
396 bool update(
const K_TYPE &key,
const V_TYPE &value)
override;
404 const V_TYPE &
operator[](
const K_TYPE &k)
const override;
412 V_TYPE &
operator[](
const K_TYPE &k)
override;
418 Iterator*
begins()
const override;
424 Iterator*
ends()
const override;
430 [[nodiscard]] std::string
className()
const override;
437 [[nodiscard]] std::string
toString(
bool enter)
const override;
468 template <
typename K_TYPE,
470 typename Compare = increaseComparator<K_TYPE>,
471 typename ALLOC = allocator<couple<const K_TYPE, V_TYPE>>>
473 public map<K_TYPE, V_TYPE, ALLOC>,
474 public iterable<couple<const K_TYPE, V_TYPE>>,
594 void next()
const override;
599 void prev()
const override;
649 treeMap(
const treeMap& other);
658 treeMap&
operator=(
const treeMap& other);
666 treeMap(treeMap&& other)
noexcept;
676 treeMap&
operator=(treeMap&& other)
noexcept;
703 void swap(treeMap& other)
noexcept;
709 [[nodiscard]] u_integer
size()
const override;
716 bool contains(
const couple<const K_TYPE, V_TYPE> &e)
const override;
724 bool add(
const K_TYPE &k,
const V_TYPE &v)
override;
731 bool remove(
const K_TYPE &k)
override;
738 [[nodiscard]]
bool containsKey(
const K_TYPE &k)
const override;
746 V_TYPE
get(
const K_TYPE &k)
const override;
754 bool update(
const K_TYPE &key,
const V_TYPE &value)
override;
762 const V_TYPE &
operator[](
const K_TYPE &k)
const override;
770 V_TYPE &
operator[](
const K_TYPE &k)
override;
776 Iterator*
begins()
const override;
782 Iterator*
ends()
const override;
788 [[nodiscard]] std::string
className()
const override;
795 [[nodiscard]] std::string
toString(
bool enter)
const override;
829 template <
typename K_TYPE,
834 public skipList<const K_TYPE, V_TYPE, ALLOC, Compare>,
835 public iterable<couple<const K_TYPE, V_TYPE>>,
953 void next()
const override;
958 void prev()
const override;
1006 JMap(
const JMap& other);
1023 JMap(JMap&& other)
noexcept;
1060 void swap(JMap& other)
noexcept;
1066 [[nodiscard]] u_integer
size()
const override;
1073 bool contains(
const couple<const K_TYPE, V_TYPE> &e)
const override;
1081 bool add(
const K_TYPE &k,
const V_TYPE &v)
override;
1088 bool remove(
const K_TYPE &k)
override;
1095 [[nodiscard]]
bool containsKey(
const K_TYPE &k)
const override;
1103 V_TYPE
get(
const K_TYPE &k)
const override;
1111 bool update(
const K_TYPE &key,
const V_TYPE &value)
override;
1119 const V_TYPE &
operator[](
const K_TYPE &k)
const override;
1127 V_TYPE &
operator[](
const K_TYPE &k)
override;
1133 Iterator*
begins()
const override;
1139 Iterator*
ends()
const override;
1145 [[nodiscard]] std::string
className()
const override;
1152 [[nodiscard]] std::string
toString(
bool enter)
const override;
1191 template <
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1222 template <
typename K_TYPE,
typename V_TYPE,
typename COMPARE,
typename ALLOC>
1253 template <
typename K_TYPE,
typename V_TYPE,
typename COMPARE,
typename ALLOC>
1258template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1260 vector<hashNode *, rebind_alloc_pointer> *buckets, u_integer bucket, hashNode *node)
1261 : hashTable<K_TYPE, V_TYPE, ALLOC, HASH>::Iterator(
1262 const_cast<vector<hashNode*, rebind_alloc_pointer>*>(buckets), bucket, node) {}
1264template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1266 const iterator<couple<const K_TYPE, V_TYPE>>* other)
const {
1267 auto other_it =
dynamic_cast<const Iterator*
>(other);
1269 this->p_buckets == other_it->p_buckets &&
1270 this->cur_bucket == other_it->cur_bucket &&
1271 this->p_node == other_it->p_node;
1274template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1279template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1289template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1295template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1297 return "hashMap::Iterator";
1300template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1305template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1310template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1316template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1321template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1326template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1333 auto next =
ownerPtr(this->clone());
1334 if (!next->isValid()){
1342template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1345 return other->atPrev(*
this);
1348template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1353template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1358template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1364template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1370template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1376template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1381template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1386template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1391template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1396template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1399 if (
this == &
other) {
1403 this->buckets = this->bucketsCopy(
other.buckets);
1404 this->size_ =
other.size_;
1405 this->hash_ =
other.hash_;
1406 if constexpr(ALLOC::propagate_on_container_copy_assignment::value) {
1408 this->rebind_alloc =
other.rebind_alloc;
1413template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1415 this->operator=(std::move(
other));
1418template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1421 if (
this == &
other) {
1425 this->buckets = std::move(
other.buckets);
1426 this->size_ =
other.size_;
1428 this->hash_ = std::move(
other.hash_);
1429 if constexpr(ALLOC::propagate_on_container_move_assignment::value) {
1431 this->rebind_alloc = std::move(
other.rebind_alloc);
1436template <
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1445 if constexpr (ALLOC::propagate_on_container_swap::value) {
1451template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1457template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1460 return this->containsKey(
e.first()) && this->get(
e.first()) ==
e.second();
1463template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1465 return this->insert(
k,
v);
1468template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1470 return this->erase(
k);
1473template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1475 return this->
find(k);
1478template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1483 return node->getValue();
1486template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1488 return this->modify(
key, value);
1491template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1496 return node->getValue();
1499template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1506 return node->getValue();
1509template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1513 if (this->buckets[0]) {
1514 return new Iterator(p_buckets, 0, this->buckets[0]);
1516 auto bucket = Iterator::findNextValidBucket(p_buckets, 0);
1520template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1524 auto bucket = Iterator::findPrevValidBucket(p_buckets, this->buckets.size());
1532template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1537template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1539 std::stringstream
ss;
1540 ss << this->className();
1543 for (
auto it = this->begin();
it != this->end();
it.next()){
1557template<
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
1560template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1562 : RBTreeType::Iterator(
tree,
cur) {}
1564template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1567 const iterator<couple<const K_TYPE, V_TYPE>>* other)
const
1569 auto other_it =
dynamic_cast<const Iterator*
>(other);
1571 this->tree_ == other_it->tree_ &&
1572 this->cur_ == other_it->cur_;
1575template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1581template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1585 if (
this == &
other) {
1589 this->tree_ =
other.tree_;
1590 this->cur_ =
other.cur_;
1594template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1601template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1604 return "treeMap::Iterator";
1607template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1610 RBTreeType::Iterator::operator+=(
steps);
1613template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1616 RBTreeType::Iterator::operator-=(
steps);
1619template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1627template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1630 return RBTreeType::Iterator::hasNext();
1633template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1636 return RBTreeType::Iterator::hasPrev();
1639template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1647 auto next =
ownerPtr(this->clone());
1648 if (!next->isValid()){
1656template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1660 return other->atNext(*
this);
1663template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1666 RBTreeType::Iterator::next();
1669template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1672 RBTreeType::Iterator::prev();
1675template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1679 auto it = this->clone();
1684template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1687 return RBTreeType::Iterator::get();
1690template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1693 return RBTreeType::Iterator::get();
1696template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1702template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1705 return RBTreeType::Iterator::isValid();
1708template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1713template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1718template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1721 if (
this == &
other){
1725 this->destroyTree();
1726 this->root_ =
other.treeCopy();
1727 this->size_ =
other.size_;
1728 this->compare_ =
other.compare_;
1729 if constexpr(ALLOC::propagate_on_container_copy_assignment::value) {
1731 this->rebind_alloc =
other.rebind_alloc;
1736template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1738 this->operator=(std::move(
other));
1741template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1744 if (
this == &
other){
1748 this->destroyTree();
1749 this->root_ =
other.root_;
1750 other.root_ =
nullptr;
1751 this->size_ =
other.size_;
1753 this->compare_ = std::move(
other.compare_);
1754 if constexpr(ALLOC::propagate_on_container_move_assignment::value) {
1756 this->rebind_alloc = std::move(
other.rebind_alloc);
1761template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1770 if constexpr (ALLOC::propagate_on_container_swap::value) {
1776template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1781template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1784 return this->containsKey(
e.first()) && this->get(
e.first()) ==
e.second();
1787template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1789 return this->insert(
k,
v);
1792template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1794 return this->erase(
k);
1797template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1799 return this->
find(k);
1802template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1807 return node->getValue();
1810template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1812 return this->modify(
key, value);
1815template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1820 return node->getValue();
1823template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1830 return node->getValue();
1833template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1840template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1847template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1852template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1854 std::stringstream
ss;
1855 ss << this->className();
1858 for (
auto it = this->begin();
it != this->end();
it.next()){
1872template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1875template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1882template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1886template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1890template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1893 skipListType::Iterator::operator=(
other);
1897template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1903template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1906 return "JMap::Iterator";
1909template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1911 skipListType::Iterator::operator+=(
steps);
1914template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1919template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1925 return this > &
other ?
1926 (std::numeric_limits<integer>::max)() :
1927 (std::numeric_limits<integer>::min)();
1928 return skipListType::Iterator::operator-(*
other_it);
1931template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1933 return skipListType::Iterator::hasNext();
1936template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1941template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1952template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1955 return other->atPrev(*
this);
1958template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1960 skipListType::Iterator::next();
1963template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1968template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1974template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1976 return skipListType::Iterator::get();
1979template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1981 return skipListType::Iterator::get();
1984template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1989template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1991 return skipListType::Iterator::isValid();
1994template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
1998template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2003template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2006 if (
this == &
other){
2010 this->listDestroy();
2011 this->head_ =
other.listCopy();
2012 this->size_ =
other.size_;
2013 this->compare_ =
other.compare_;
2014 if constexpr(ALLOC::propagate_on_container_copy_assignment::value) {
2016 this->rebind_alloc =
other.rebind_alloc;
2021template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2023 this->operator=(std::move(
other));
2026template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2029 if (
this == &
other){
2033 this->listDestroy();
2034 this->head_ =
other.head_;
2036 this->size_ =
other.size_;
2038 this->compare_ = std::move(
other.compare_);
2039 if constexpr(ALLOC::propagate_on_container_move_assignment::value) {
2041 this->rebind_alloc = std::move(
other.rebind_alloc);
2046template <
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2055 if constexpr(ALLOC::propagate_on_container_swap::value) {
2061template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2066template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2068 return this->containsKey(
e.first()) && this->get(
e.first()) ==
e.second();
2071template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2073 return this->insert(
k,
v);
2076template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2078 return this->erase(
k);
2081template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2083 return this->
find(k);
2086template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2091 return node->getValue();
2094template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2096 return this->modify(
key, value);
2099template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2104 return node->getValue();
2107template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2114 return node->getValue();
2117template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2120 return new Iterator(this->head_->getPNext(1));
2123template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2126 return new Iterator(this->findLastNode());
2129template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2134template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2136 std::stringstream
ss;
2137 ss << this->className();
2140 for (
auto it = this->begin();
it != this->end();
it.next()){
2154template<
typename K_TYPE,
typename V_TYPE,
typename Compare,
typename ALLOC>
2157template <
typename K_TYPE,
typename V_TYPE,
typename HASH,
typename ALLOC>
2164template <
typename K_TYPE,
typename V_TYPE,
typename COMPARE,
typename ALLOC>
2171template <
typename K_TYPE,
typename V_TYPE,
typename COMPARE,
typename ALLOC>
Red-Black Tree implementation header.
Memory allocation interface and implementations.
Forward iterator for JMap.
Definition maps.h:861
Iterator & operator=(const Iterator &other)
Copy assignment operator.
Definition maps.h:1892
bool atNext(const iterator< couple< const K_TYPE, V_TYPE > > *other) const override
Checks if other is next to this.
Definition maps.h:1953
Iterator * getPrev() const override
Not supported (throws unSupportedMethodError)
Definition maps.h:1970
bool hasPrev() const override
Not supported (throws unSupportedMethodError)
Definition maps.h:1937
Iterator(skipListNode *cur)
Constructs iterator pointing to specific skip list node.
Definition maps.h:1883
std::string className() const override
Gets iterator class name.
Definition maps.h:1905
void prev() const override
Not supported (throws unSupportedMethodError)
Definition maps.h:1964
void operator+=(integer steps) const override
Advances iterator by steps.
Definition maps.h:1910
void operator-=(integer steps) const override
Not supported (throws unSupportedMethodError)
Definition maps.h:1915
void next() const override
Moves to next element.
Definition maps.h:1959
bool isValid() const override
Checks if iterator is valid.
Definition maps.h:1990
void set(const couple< const K_TYPE, V_TYPE > &data) override
Not supported (throws unSupportedMethodError)
Definition maps.h:1985
couple< const K_TYPE, V_TYPE > & get() override
Gets current element (non-const)
Definition maps.h:1975
bool hasNext() const override
Checks if more elements exist in forward direction.
Definition maps.h:1932
bool atPrev(const iterator< couple< const K_TYPE, V_TYPE > > *other) const override
Checks if other is previous to this.
Definition maps.h:1942
Iterator * clone() const override
Creates a copy of this iterator.
Definition maps.h:1899
Skip List based implementation of the map interface.
Definition maps.h:836
bool update(const K_TYPE &key, const V_TYPE &value) override
Updates value for existing key.
Definition maps.h:2095
std::string toString(bool enter) const override
Converts to string representation.
Definition maps.h:2135
Iterator * ends() const override
Gets end iterator.
Definition maps.h:2125
const V_TYPE & operator[](const K_TYPE &k) const override
Const element access.
Definition maps.h:2100
bool remove(const K_TYPE &k) override
Removes key-value pair.
Definition maps.h:2077
bool containsKey(const K_TYPE &k) const override
Checks if key exists.
Definition maps.h:2082
bool contains(const couple< const K_TYPE, V_TYPE > &e) const override
Checks if key-value pair exists.
Definition maps.h:2067
~JMap() override
Destructor.
void swap(JMap &other) noexcept
Swaps contents with another JMap.
Definition maps.h:2047
u_integer size() const override
Gets number of elements.
Definition maps.h:2062
std::string className() const override
Gets class name.
Definition maps.h:2130
bool add(const K_TYPE &k, const V_TYPE &v) override
Adds new key-value pair.
Definition maps.h:2072
Iterator * begins() const override
Gets begin iterator.
Definition maps.h:2119
V_TYPE get(const K_TYPE &k) const override
Gets value for key.
Definition maps.h:2087
JMap & operator=(const JMap &other)
Copy assignment operator.
Definition maps.h:2005
JMap(Compare comp=Compare{}, ALLOC alloc=ALLOC{})
Constructs empty JMap.
Definition maps.h:1995
Bidirectional iterator for RBTree.
Definition RBTree.h:219
Internal node class for Red-Black Tree.
Definition RBTree.h:51
Red-Black Tree container implementation.
Definition RBTree.h:40
Default memory allocator using allocators utilities.
Definition allocator.h:153
void swap(autoPtr &other) noexcept
Swaps the reference counters between two autoPtr instances.
Definition autoPtr.h:703
const TYPE * get() const
Get managed pointer const version.
Definition autoPtr.h:629
A base class for basic iterators.
Definition iterator.h:296
Bidirectional iterator for hashMap.
Definition maps.h:143
void next() const override
Moves to next element.
Definition maps.h:1349
bool atNext(const iterator< couple< const K_TYPE, V_TYPE > > *other) const override
Checks if other is next to this.
Definition maps.h:1343
Iterator * getPrev() const override
Not supported.
Definition maps.h:1360
Iterator & operator=(const Iterator &other)
Copy assignment operator.
Definition maps.h:1281
bool hasNext() const override
Checks if more elements exist.
Definition maps.h:1317
bool atPrev(const iterator< couple< const K_TYPE, V_TYPE > > *other) const override
Checks if other is previous to this.
Definition maps.h:1327
std::string className() const override
Gets iterator class name.
Definition maps.h:1296
void prev() const override
Not supported.
Definition maps.h:1354
void operator+=(integer steps) const override
Advances iterator by steps.
Definition maps.h:1301
void operator-=(integer steps) const override
Not supported.
Definition maps.h:1306
bool isValid() const override
Checks if iterator is valid.
Definition maps.h:1382
void set(const couple< const K_TYPE, V_TYPE > &data) override
Not supported.
Definition maps.h:1377
Iterator * clone() const override
Creates a copy of this iterator.
Definition maps.h:1291
couple< const K_TYPE, V_TYPE > & get() override
Gets current element (non-const)
Definition maps.h:1366
bool hasPrev() const override
Not supported.
Definition maps.h:1322
Hash table based implementation of the map interface.
Definition maps.h:114
void swap(hashMap &other) noexcept
Swaps contents with another hashMap.
Definition maps.h:1437
hashMap(HASH hash=HASH{}, ALLOC alloc=ALLOC{})
Constructs empty hashMap.
Definition maps.h:1387
u_integer size() const override
Gets number of elements.
Definition maps.h:1453
bool add(const K_TYPE &k, const V_TYPE &v) override
Adds new key-value pair.
Definition maps.h:1464
bool remove(const K_TYPE &k) override
Removes key-value pair.
Definition maps.h:1469
Iterator * ends() const override
Gets end iterator.
Definition maps.h:1522
bool contains(const couple< const K_TYPE, V_TYPE > &e) const override
Checks if key-value pair exists.
Definition maps.h:1459
bool containsKey(const K_TYPE &k) const override
Checks if key exists.
Definition maps.h:1474
std::string className() const override
Gets class name.
Definition maps.h:1533
const V_TYPE & operator[](const K_TYPE &k) const override
Const element access.
Definition maps.h:1492
bool update(const K_TYPE &key, const V_TYPE &value) override
Updates value for existing key.
Definition maps.h:1487
Iterator * begins() const override
Gets begin iterator.
Definition maps.h:1511
std::string toString(bool enter) const override
Converts to string representation.
Definition maps.h:1538
hashMap & operator=(const hashMap &other)
Copy assignment operator.
Definition maps.h:1398
V_TYPE get(const K_TYPE &k) const override
Gets value for key.
Definition maps.h:1479
void next() const
Advances to the next element.
Definition hashTable.h:633
couple< const K_TYPE, V_TYPE > & get()
Gets current key-value pair (non-const)
Definition hashTable.h:667
Iterator & operator=(const Iterator &other)
Copy assignment operator.
Definition hashTable.h:614
void operator+=(integer steps) const
Advances iterator by steps positions.
Definition hashTable.h:655
bool isValid() const
Checks if iterator points to valid element.
Definition hashTable.h:686
bool hasNext() const
Checks if more elements are available.
Definition hashTable.h:624
Internal node type for hash table storage.
Definition hashTable.h:70
Hash table implementation with separate chaining.
Definition hashTable.h:54
ALLOC::template rebind_alloc< hashNode * > rebind_alloc_pointer
Rebound allocator type for pointer storage.
Definition hashTable.h:173
Generic hash function object supporting multiple types.
Definition hash.h:62
A base class for iterable containers that support multiple iteration patterns.
Definition iterable.h:70
Base iterator interface that supports common operations for iteration.
Definition iterator.h:37
friend iterator< T > * operator-(const iterator< T > &it, integer steps)
Subtracts a number of steps from the iterator's current position and returns a new iterator.
Abstract base class for key-value mapping containers.
Definition map.h:49
Exception for missing element requests.
Definition error.h:298
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37
Base class providing polymorphic string conversion capabilities.
Definition printable.h:39
static std::string formatString(const TYPE &t)
Universal value-to-string conversion with type-specific formatting.
Definition printable.h:339
Abstract base class for unique element containers.
Definition set.h:44
Forward iterator for skipList.
Definition skipList.h:164
Internal node class for Skip List.
Definition skipList.h:54
Skip List container implementation.
Definition skipList.h:45
Bidirectional iterator for treeMap.
Definition maps.h:504
couple< const K_TYPE, V_TYPE > & get() override
Gets current element (non-const)
Definition maps.h:1685
bool hasNext() const override
Checks if more elements exist in forward direction.
Definition maps.h:1628
void next() const override
Moves to next element.
Definition maps.h:1664
bool atNext(const iterator< couple< const K_TYPE, V_TYPE > > *other) const override
Checks if other is next to this.
Definition maps.h:1657
bool atPrev(const iterator< couple< const K_TYPE, V_TYPE > > *other) const override
Checks if other is previous to this.
Definition maps.h:1640
void operator-=(integer steps) const override
Rewinds iterator by steps.
Definition maps.h:1614
Iterator * getPrev() const override
Gets previous iterator.
Definition maps.h:1677
std::string className() const override
Gets iterator class name.
Definition maps.h:1602
Iterator * clone() const override
Creates a copy of this iterator.
Definition maps.h:1596
bool isValid() const override
Checks if iterator is valid.
Definition maps.h:1703
void prev() const override
Moves to previous element.
Definition maps.h:1670
Iterator & operator=(const Iterator &other)
Copy assignment operator.
Definition maps.h:1583
void operator+=(integer steps) const override
Advances iterator by steps.
Definition maps.h:1608
bool hasPrev() const override
Checks if more elements exist in backward direction.
Definition maps.h:1634
void set(const couple< const K_TYPE, V_TYPE > &data) override
Not supported.
Definition maps.h:1697
Red-Black Tree based implementation of the map interface.
Definition maps.h:475
Iterator * begins() const override
Gets begin iterator.
Definition maps.h:1835
treeMap & operator=(const treeMap &other)
Copy assignment operator.
Definition maps.h:1720
std::string className() const override
Gets class name.
Definition maps.h:1848
Iterator * ends() const override
Gets end iterator.
Definition maps.h:1842
bool containsKey(const K_TYPE &k) const override
Checks if key exists.
Definition maps.h:1798
V_TYPE get(const K_TYPE &k) const override
Gets value for key.
Definition maps.h:1803
~treeMap() override
Destructor.
std::string toString(bool enter) const override
Converts to string representation.
Definition maps.h:1853
bool contains(const couple< const K_TYPE, V_TYPE > &e) const override
Checks if key-value pair exists.
Definition maps.h:1783
bool remove(const K_TYPE &k) override
Removes key-value pair.
Definition maps.h:1793
void swap(treeMap &other) noexcept
Swaps contents with another treeMap.
Definition maps.h:1762
bool add(const K_TYPE &k, const V_TYPE &v) override
Adds new key-value pair.
Definition maps.h:1788
const V_TYPE & operator[](const K_TYPE &k) const override
Const element access.
Definition maps.h:1816
bool update(const K_TYPE &key, const V_TYPE &value) override
Updates value for existing key.
Definition maps.h:1811
treeMap(Compare comp=Compare{}, ALLOC alloc=ALLOC{})
Constructs empty treeMap.
Definition maps.h:1709
u_integer size() const override
Gets number of elements.
Definition maps.h:1777
Exception for unimplemented method calls.
Definition error.h:271
Comparator base class and concrete comparator classes.
Combines Comparable and CallbackOf for comparison callbacks.
Definition types.h:377
Generic pair container implementation.
Implementation of hashTable container.
Provides a generic hashing utility and interface for hashable types.
Abstract base class for map-like container implementations.
Main namespace for the project Original.
Definition algorithms.h:21
TYPE find(coroutine::generator< TYPE > gen, Callback &&c)
Finds the first element satisfying a predicate.
Definition generators.h:856
Standard namespace extensions for original::alternative.
Definition allocator.h:351
void swap(original::objPoolAllocator< TYPE > &lhs, original::objPoolAllocator< TYPE > &rhs) noexcept
Specialization of std::swap for objPoolAllocator.
Definition allocator.h:635
Exclusive-ownership smart pointer implementation.
Skip List container implementation.