ORIGINAL
|
A base class for basic iterators. More...
#include <iterator.h>
Public Member Functions | |
baseIterator * | clone () const override=0 |
Creates a clone of the iterator. | |
~baseIterator () override=default | |
Virtual destructor for proper cleanup of derived objects. | |
![]() | |
TYPE & | operator* () |
Dereferences the iterator to get the element. | |
TYPE | operator* () const |
Dereferences the iterator to get a copy of the element. | |
void | operator++ () const |
Moves the iterator forward by one position. | |
void | operator++ (int postfix) const |
Moves the iterator forward by one position (postfix). | |
void | operator-- () const |
Moves the iterator backward by one position. | |
void | operator-- (int postfix) const |
Moves the iterator backward by one position (postfix). | |
virtual void | operator+= (integer steps) const =0 |
Adds a number of steps to the current position of iterator. | |
virtual void | operator-= (integer steps) const =0 |
Subtracts a number of steps from the current position of iterator. | |
integer | compareTo (const iterator &other) const override |
Compares two iterators to determine their relative positions. | |
virtual integer | operator- (const iterator &other) const =0 |
Returns the distance between this iterator and another iterator. | |
operator bool () const | |
Checks if the iterator is valid (i.e., points to a valid element). | |
virtual bool | hasNext () const =0 |
Checks if there is a next element. | |
virtual bool | hasPrev () const =0 |
Checks if there is a previous element. | |
virtual bool | atPrev (const iterator *other) const =0 |
Checks if this iterator is positioned at the previous element. | |
virtual bool | atNext (const iterator *other) const =0 |
Checks if this iterator is positioned at the next element. | |
bool | atPrev (const iterator &other) const |
Checks if this iterator is positioned at the previous element. | |
bool | atNext (const iterator &other) const |
Checks if this iterator is positioned at the next element. | |
virtual void | next () const =0 |
Moves the iterator to the next element. | |
virtual void | prev () const =0 |
Moves the iterator to the previous element. | |
virtual iterator * | getNext () const |
Returns a new iterator pointing to the next element. | |
virtual iterator * | getPrev () const =0 |
Returns a new iterator pointing to the previous element. | |
virtual TYPE & | get ()=0 |
Gets the element pointed to by the iterator. | |
virtual TYPE | get () const =0 |
Gets a copy of the element pointed to by the iterator. | |
virtual TYPE | getElem () const |
Returns a copy of the element. | |
virtual void | set (const TYPE &data)=0 |
Sets the element pointed to by the iterator. | |
bool | equal (const iterator *other) const |
Checks if two iterators are equal. | |
bool | equal (const iterator &other) const |
Checks if two iterators are equal. | |
virtual bool | isValid () const =0 |
Checks if the iterator is valid. | |
std::string | className () const override |
Returns the class name of the iterator. | |
std::string | toString (bool enter) const override |
Returns a string representation of the iterator. | |
~iterator () override=default | |
Virtual destructor for proper cleanup of derived objects. | |
![]() | |
operator std::string () const | |
Explicit conversion to std::string. | |
operator const char * () const | |
Explicit conversion to C-style string. | |
const char * | toCString (bool enter) const |
Direct C-string access with formatting control. | |
template<typename TYPE> | |
auto | formatString (const TYPE &t) -> std::string |
template<typename TYPE> | |
auto | formatCString (const TYPE &t) -> const char * |
template<typename TYPE> | |
auto | formatEnum (const TYPE &t) -> std::string |
template<typename TYPE> | |
auto | formatString (TYPE *const &ptr) -> std::string |
![]() | |
~cloneable () override=default | |
Virtual destructor for cloneable. | |
![]() | |
virtual | ~baseCloneable ()=default |
Virtual destructor for baseCloneable. | |
![]() | |
bool | operator== (const iterator< TYPE > &other) const |
Checks if the current object is equal to another. | |
bool | operator!= (const iterator< TYPE > &other) const |
Checks if the current object is not equal to another. | |
bool | operator< (const iterator< TYPE > &other) const |
Checks if the current object is less than another. | |
bool | operator> (const iterator< TYPE > &other) const |
Checks if the current object is greater than another. | |
bool | operator<= (const iterator< TYPE > &other) const |
Checks if the current object is less than or equal to another. | |
bool | operator>= (const iterator< TYPE > &other) const |
Checks if the current object is greater than or equal to another. | |
virtual | ~comparable ()=default |
Virtual destructor for proper cleanup of derived objects. | |
Additional Inherited Members | |
![]() | |
template<typename TYPE> | |
static std::string | formatString (const TYPE &t) |
Universal value-to-string conversion. | |
template<typename TYPE> | |
static std::string | formatString (TYPE *const &ptr) |
Pointer-specific formatting. | |
template<typename TYPE> | |
static const char * | formatCString (const TYPE &t) |
C-string cache for temporary usage. | |
template<typename TYPE> | |
static std::string | formatEnum (const TYPE &t) |
Enum formatting utility. | |
template<> | |
auto | formatString (const char &t) -> std::string |
template<> | |
auto | formatString (const bool &t) -> std::string |
template<> | |
auto | formatString (const char *const &ptr) -> std::string |
![]() | |
virtual bool | equalPtr (const iterator *other) const =0 |
Checks if two iterators point to the same object. | |
![]() | |
cloneable ()=default | |
Default constructor for cloneable. | |
![]() | |
baseCloneable ()=default | |
Default constructor for baseCloneable. | |
A base class for basic iterators.
TYPE | The type of the elements the iterator will traverse. |
The baseIterator
serves as the foundation for basic iterators. It defines common functionality for iterators, and it can be extended by other iterator types. For more specialized or adapted iterators, see original::iterable::iterAdaptor and other iterator types that inherit from baseIterator
.
|
overridepure virtual |
Creates a clone of the iterator.
Implements original::iterator< TYPE >.
Implemented in original::array< TYPE, ALLOC >::Iterator, original::bitSet< ALLOC >::Iterator, original::blocksList< TYPE, ALLOC >::Iterator, original::chain< TYPE, ALLOC >::Iterator, original::doubleDirectionIterator< TYPE >, original::forwardChain< TYPE, ALLOC >::Iterator, original::randomAccessIterator< TYPE, ALLOC >, original::singleDirectionIterator< TYPE >, original::stepIterator< TYPE >, and original::vector< TYPE, ALLOC >::Iterator.