ORIGINAL
Loading...
Searching...
No Matches
original::baseIterator< TYPE > Class Template Referenceabstract

A base class for basic iterators. More...

#include <iterator.h>

Inheritance diagram for original::baseIterator< TYPE >:
Inheritance graph
Collaboration diagram for original::baseIterator< TYPE >:
Collaboration graph

Public Member Functions

baseIteratorclone () const override=0
 Creates a clone of the iterator.
 
 ~baseIterator () override=default
 Virtual destructor for proper cleanup of derived objects.
 
- Public Member Functions inherited from original::iterator< TYPE >
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 iteratorgetNext () const
 Returns a new iterator pointing to the next element.
 
virtual iteratorgetPrev () 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.
 
- Public Member Functions inherited from original::printable
 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
 
- Public Member Functions inherited from original::cloneable
 ~cloneable () override=default
 Virtual destructor for cloneable.
 
- Public Member Functions inherited from original::baseCloneable< cloneable >
virtual ~baseCloneable ()=default
 Virtual destructor for baseCloneable.
 
- Public Member Functions inherited from original::comparable< iterator< TYPE > >
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

- Static Public Member Functions inherited from original::printable
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
 
- Protected Member Functions inherited from original::iterator< TYPE >
virtual bool equalPtr (const iterator *other) const =0
 Checks if two iterators point to the same object.
 
- Protected Member Functions inherited from original::cloneable
 cloneable ()=default
 Default constructor for cloneable.
 
- Protected Member Functions inherited from original::baseCloneable< cloneable >
 baseCloneable ()=default
 Default constructor for baseCloneable.
 

Detailed Description

template<typename TYPE>
class original::baseIterator< TYPE >

A base class for basic iterators.

Template Parameters
TYPEThe 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.

Member Function Documentation

◆ clone()


The documentation for this class was generated from the following file: