7 #ifndef Fw_SetConstIterator_HPP 8 #define Fw_SetConstIterator_HPP 69 const auto implKind = it.getImplIterator().implKind();
72 this->m_implIterator =
new (&this->m_impl.array)
ArrayIterator(it.m_impl.array);
74 case ImplKind::RED_BLACK_TREE:
75 this->m_implIterator =
new (&this->m_impl.redBlackTree)
RedBlackTreeIterator(it.m_impl.redBlackTree);
78 FW_ASSERT(0, static_cast<FwAssertArgType>(implKind));
97 const auto implKind1 = this->getImplIterator().implKind();
98 const auto implKind2 = it.getImplIterator().implKind();
99 if (implKind1 == implKind2) {
101 case ImplKind::ARRAY:
102 result = this->m_impl.array.compareEqual(it.m_impl.array);
104 case ImplKind::RED_BLACK_TREE:
105 result = this->m_impl.redBlackTree.compareEqual(it.m_impl.redBlackTree);
108 FW_ASSERT(0, static_cast<FwAssertArgType>(implKind1));
120 this->getImplIterator().increment();
132 bool isInRange()
const {
return this->getImplIterator().isInRange(); }
135 const T&
operator*()
const {
return this->getImplIterator().getEntry().getKeyOrElement(); }
138 const T*
operator->()
const {
return &this->getImplIterator().getEntry().getKeyOrElement(); }
147 FW_ASSERT(this->m_implIterator !=
nullptr);
148 return *this->m_implIterator;
152 const SetOrMapImplConstIterator<T, Nil>& getImplIterator()
const {
153 FW_ASSERT(this->m_implIterator !=
nullptr);
154 return *this->m_implIterator;
166 SetOrMapImplConstIterator<T, Nil>* m_implIterator =
nullptr;
bool operator!=(const SetConstIterator &it)
Inequality comparison operator.
typename RedBlackTreeSetOrMapImpl< T, Nil >::ConstIterator RedBlackTreeIterator
The type of a red-black tree iterator.
SetConstIterator(const ArrayIterator &it)
Constructor providing an array implementation.
typename ArraySetOrMapImpl< T, Nil >::ConstIterator ArrayIterator
The type of an array iterator.
SetConstIterator(const SetConstIterator &it)
Copy constructor.
bool isInRange() const
Check whether the iterator is in range.
SetConstIterator(const RedBlackTreeIterator &it)
Constructor providing a red-black tree implementation.
~SetConstIterator()
Destructor.
SetConstIterator & operator++()
Prefix increment.
bool operator==(const SetConstIterator &it)
Equality comparison operator.
SetConstIterator operator++(int)
Postfix increment.
ImplKind
The kind of a const iterator implementation.
SetConstIterator & operator=(const SetConstIterator &)=default
Copy assignment operator.
const T & operator*() const
Dereference.
const T * operator->() const
Pointer.