36 template<
typename TYPE>
112 void next()
const override;
118 void prev()
const override;
168 void set(
const TYPE& data)
override;
184 template <
typename TYPE>
188 template <
typename TYPE>
194 while (
s->isValid()){
195 if (
s->_ptr ==
e->_ptr){
202 dis = (std::numeric_limits<integer>::max)();
207 template<
typename TYPE>
213 template <
typename TYPE>
220 template <
typename TYPE>
224 if (
this == &
other) {
227 this->_ptr =
other._ptr;
231 template<
typename TYPE>
236 template <
typename TYPE>
239 return this->isValid();
242 template<
typename TYPE>
247 template <
typename TYPE>
253 template <
typename TYPE>
259 template <
typename TYPE>
263 this->_ptr = this->_ptr->getPNext();
266 template<
typename TYPE>
271 template <
typename TYPE>
285 template <
typename TYPE>
299 template <
typename TYPE>
304 return this > &
other ?
305 (std::numeric_limits<integer>::max)() :
306 (std::numeric_limits<integer>::min)();
310 neg_dis != (std::numeric_limits<integer>::max)())
return -
neg_dis;
311 return this->_ptr >
other_it->_ptr ?
312 (std::numeric_limits<integer>::max)() :
313 (std::numeric_limits<integer>::min)();
316 template <
typename TYPE>
321 template<
typename TYPE>
326 template <
typename TYPE>
330 return this->_ptr->getVal();
333 template <
typename TYPE>
337 return this->_ptr->getVal();
340 template <
typename TYPE>
344 this->_ptr->setVal(data);
347 template <
typename TYPE>
350 return this->_ptr !=
nullptr;
353 template <
typename TYPE>
356 return "stepIterator";
A base class for basic iterators.
Definition iterator.h:296
Base iterator interface that supports common operations for iteration.
Definition iterator.h:37
friend iterator< T > * operator-(const iterator< T > &it, integer steps)
Subtracts a number of steps from the iterator's current position and returns a new iterator.
Exception for null pointer dereference attempts.
Definition error.h:245
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37
Abstract base class for unique element containers.
Definition set.h:44
Abstract base class for step iterators.
Definition stepIterator.h:38
iterator< TYPE > * getPrev() const override
Creates a new iterator pointing to the previous element.
Definition stepIterator.h:322
wrapper< TYPE > * _ptr
Pointer to the current wrapper.
Definition stepIterator.h:40
stepIterator * clone() const override
Creates a heap-allocated copy of the iterator.
Definition stepIterator.h:232
bool hasPrev() const override
Checks if the iterator can move backward.
Definition stepIterator.h:243
void set(const TYPE &data) override
Sets the value of the current element.
Definition stepIterator.h:341
bool equalPtr(const iterator< TYPE > *other) const override
Equality comparison for two iterators.
Definition stepIterator.h:208
void next() const override
Advances to the next position in the container.
Definition stepIterator.h:260
std::string className() const override
Returns the class name of the iterator.
Definition stepIterator.h:354
TYPE & get() override
Gets the reference of current element in the container.
Definition stepIterator.h:327
void prev() const override
Retreats to the previous position in the container.
Definition stepIterator.h:267
stepIterator(wrapper< TYPE > *ptr)
Protected constructor for derived classes.
Definition stepIterator.h:185
bool atNext(const iterator< TYPE > *other) const override
Checks if the current iterator is at the next position relative to another iterator.
Definition stepIterator.h:254
bool hasNext() const override
Checks if the iterator can move forward.
Definition stepIterator.h:237
static integer ptrDistance(const stepIterator *start, const stepIterator *end)
Calculates the distance between two iterators.
Definition stepIterator.h:189
stepIterator & operator=(const stepIterator &other)
Copy assignment operator for stepIterator.
Definition stepIterator.h:221
void operator+=(integer steps) const override
Moves forward by a specified number of steps.
Definition stepIterator.h:272
bool isValid() const override
Checks if the iterator is valid.
Definition stepIterator.h:348
stepIterator * getNext() const override
Creates a new iterator pointing to the next element.
Definition stepIterator.h:317
bool atPrev(const iterator< TYPE > *other) const override
Checks if the current iterator is at the previous position relative to another iterator.
Definition stepIterator.h:248
void operator-=(integer steps) const override
Moves backward by a specified number of steps.
Definition stepIterator.h:286
Exception for unimplemented method calls.
Definition error.h:271
Custom exception classes and callback validation utilities.
Defines the iterator class for traversing and manipulating container elements.
Mathematical utilities, constants, and range generators.
Main namespace for the project Original.
Definition algorithms.h:21
TYPE abs(TYPE a)
Returns the absolute value of a given number.
Standard namespace extensions for original::alternative.
Definition allocator.h:351
Exclusive-ownership smart pointer implementation.
Abstract polymorphic container with value encapsulation and navigation support.