7 #ifndef Fw_MapConstIterator_HPP 8 #define Fw_MapConstIterator_HPP 19 template <
typename K,
typename V>
70 const auto implKind = it.getImplIterator().
implKind();
73 this->m_implIterator =
new (&this->m_impl.array)
ArrayIterator(it.m_impl.array);
75 case ImplKind::RED_BLACK_TREE:
76 this->m_implIterator =
new (&this->m_impl.redBlackTree)
RedBlackTreeIterator(it.m_impl.redBlackTree);
79 FW_ASSERT(0, static_cast<FwAssertArgType>(implKind));
98 const auto implKind1 = this->getImplIterator().
implKind();
99 const auto implKind2 = it.getImplIterator().
implKind();
100 if (implKind1 == implKind2) {
102 case ImplKind::ARRAY:
103 result = this->m_impl.array.compareEqual(it.m_impl.array);
105 case ImplKind::RED_BLACK_TREE:
106 result = this->m_impl.redBlackTree.compareEqual(it.m_impl.redBlackTree);
109 FW_ASSERT(0, static_cast<FwAssertArgType>(implKind1));
148 FW_ASSERT(this->m_implIterator !=
nullptr);
149 return *this->m_implIterator;
153 const SetOrMapImplConstIterator<K, V>& getImplIterator()
const {
154 FW_ASSERT(this->m_implIterator !=
nullptr);
155 return *this->m_implIterator;
167 SetOrMapImplConstIterator<K, V>* m_implIterator =
nullptr;
virtual void increment()=0
Increment the iterator.
MapConstIterator & operator++()
Prefix increment.
typename RedBlackTreeSetOrMapImpl< K, V >::ConstIterator RedBlackTreeIterator
The type of a red-black tree iterator.
typename ArraySetOrMapImpl< K, V >::ConstIterator ArrayIterator
The type of an array iterator.
const EntryBase * operator->() const
Pointer.
virtual ImplKind implKind() const =0
MapConstIterator & operator=(const MapConstIterator &)=default
Copy assignment operator.
virtual const SetOrMapImplEntry< KE, VN > & getEntry() const =0
MapConstIterator operator++(int)
Postfix increment.
MapConstIterator(const RedBlackTreeIterator &it)
Constructor providing a red-black tree implementation.
bool operator==(const MapConstIterator &it)
Equality comparison operator.
MapConstIterator(const MapConstIterator &it)
Copy constructor.
bool isInRange() const
Check whether the iterator is in range.
bool operator!=(const MapConstIterator &it)
Inequality comparison operator.
~MapConstIterator()
Destructor.
const EntryBase & operator*() const
Dereference.
virtual bool isInRange() const =0
MapConstIterator(const ArrayIterator &it)
Constructor providing an array implementation.