ORIGINAL
|
Iterator for blocksList, supports forward and backward iteration. More...
#include <blocksList.h>
Public Member Functions | |
Iterator (const Iterator &other) | |
Copy constructor for the Iterator. | |
Iterator & | operator= (const Iterator &other) |
Assignment operator for the Iterator. | |
Iterator * | clone () const override |
Clones the iterator. | |
bool | hasNext () const override |
Checks if there is a next element. | |
bool | hasPrev () const override |
Checks if there is a previous element. | |
void | next () const override |
Moves the iterator to the next element. | |
void | prev () const override |
Moves the iterator to the previous element. | |
void | operator+= (integer steps) const override |
Advances the iterator by the specified number of steps. | |
void | operator-= (integer steps) const override |
Moves the iterator backward by the specified number of steps. | |
integer | operator- (const iterator< TYPE > &other) const override |
Computes the distance between two iterators. | |
Iterator * | getPrev () const override |
Gets the previous iterator. | |
Iterator * | getNext () const override |
Gets the next iterator. | |
TYPE & | get () override |
Gets the element pointed to by the iterator. | |
TYPE | get () const override |
Gets the element pointed to by the iterator (const version). | |
void | set (const TYPE &data) override |
Sets the value of the element pointed to by the iterator. | |
bool | isValid () const override |
Checks if the iterator is valid. | |
bool | atPrev (const iterator< TYPE > *other) const override |
Checks if the iterator is at the previous element relative to another iterator. | |
bool | atNext (const iterator< TYPE > *other) const override |
Checks if the iterator is at the next element relative to another iterator. | |
std::string | className () const override |
Gets the class name 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). | |
integer | compareTo (const iterator &other) const override |
Compares two iterators to determine their relative positions. | |
operator bool () const | |
Checks if the iterator is valid (i.e., points to a valid 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 TYPE | getElem () const |
Returns a copy of the element. | |
bool | equal (const iterator *other) const |
Checks if two iterators are equal. | |
bool | equal (const iterator &other) const |
Checks if two iterators are equal. | |
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. | |
Public Attributes | |
friend | blocksList |
Additional Inherited Members | |
![]() | |
template<typename TYPE > | |
static std::string | formatString (const TYPE &t) |
Universal value-to-string conversion with type-specific formatting. | |
template<Printable TYPE> | |
static std::string | formatString (const TYPE &t) |
Specialization for types deriving from printable. | |
template<EnumType TYPE> | |
static std::string | formatString (const TYPE &t) |
Specialization for enum types with type-safe formatting. | |
template<typename TYPE > | |
static std::string | formatString (TYPE *const &ptr) |
Pointer-specific formatting with null safety. | |
template<typename TYPE > | |
static const char * | formatCString (const TYPE &t) |
C-string cache for temporary usage with static storage. | |
template<typename TYPE > | |
static std::string | formatEnum (const TYPE &t) |
Enum formatting utility with underlying value extraction. | |
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 |
![]() | |
cloneable ()=default | |
Default constructor for cloneable. | |
![]() | |
baseCloneable ()=default | |
Default constructor for baseCloneable. | |
Iterator for blocksList, supports forward and backward iteration.
This iterator allows iterating through the blocksList with random access.
original::blocksList< TYPE, ALLOC >::Iterator::Iterator | ( | const Iterator & | other | ) |
Copy constructor for the Iterator.
other | The iterator to copy. |
|
overridevirtual |
Checks if the iterator is at the next element relative to another iterator.
other | The other iterator to compare. |
Implements original::iterator< TYPE >.
|
overridevirtual |
Checks if the iterator is at the previous element relative to another iterator.
other | The other iterator to compare. |
Implements original::iterator< TYPE >.
|
overridevirtual |
Gets the class name of the iterator.
Reimplemented from original::printable.
|
overridevirtual |
Clones the iterator.
Implements original::baseIterator< TYPE >.
|
overridevirtual |
Gets the element pointed to by the iterator (const version).
Implements original::iterator< TYPE >.
|
overridevirtual |
Gets the element pointed to by the iterator.
Implements original::iterator< TYPE >.
|
overridevirtual |
Gets the next iterator.
Reimplemented from original::iterator< TYPE >.
|
overridevirtual |
Gets the previous iterator.
Implements original::iterator< TYPE >.
|
overridevirtual |
Checks if there is a next element.
Implements original::iterator< TYPE >.
|
overridevirtual |
Checks if there is a previous element.
Implements original::iterator< TYPE >.
|
overridevirtual |
Checks if the iterator is valid.
Implements original::iterator< TYPE >.
|
overridevirtual |
Moves the iterator to the next element.
Implements original::iterator< TYPE >.
|
overridevirtual |
Advances the iterator by the specified number of steps.
steps | The number of steps to advance. |
Implements original::iterator< TYPE >.
|
overridevirtual |
Computes the distance between two iterators.
other | The other iterator to compare. |
Implements original::iterator< TYPE >.
|
overridevirtual |
Moves the iterator backward by the specified number of steps.
steps | The number of steps to move backward. |
Implements original::iterator< TYPE >.
Assignment operator for the Iterator.
other | The iterator to assign. |
|
overridevirtual |
Moves the iterator to the previous element.
Implements original::iterator< TYPE >.
Sets the value of the element pointed to by the iterator.
data | The value to set. |
Implements original::iterator< TYPE >.