69 template <
typename TYPE>
111 iterAdaptor*
clone()
const override;
137 iterAdaptor(
const iterAdaptor&
other);
408 template<
typename Callback = transform<TYPE>>
424 template<
typename Callback = transform<TYPE>>
428 using T = std::remove_const_t<TYPE>;
464 template <
typename TYPE>
467 template <
typename TYPE>
473 return this->it_->equal(
other_it->it_);
476 template <
typename TYPE>
482 template <
typename TYPE>
485 auto*
it = this->clone();
490 template <
typename TYPE>
493 auto*
it = this->clone();
498 template <
typename TYPE>
504 template <
typename TYPE>
507 if (
this == &
other)
return *
this;
510 this->it_ =
other.it_->clone();
514 template <
typename TYPE>
520 template <
typename TYPE>
523 return this->it_->hasNext();
526 template <
typename TYPE>
529 return this->it_->hasPrev();
532 template <
typename TYPE>
538 return this->it_->atPrev(
other_it->it_);
541 template <
typename TYPE>
547 return this->it_->atNext(
other_it->it_);
550 template <
typename TYPE>
556 template <
typename TYPE>
562 template <
typename TYPE>
565 this->it_->operator+=(
steps);
568 template <
typename TYPE>
571 this->it_->operator-=(
steps);
574 template <
typename TYPE>
579 return this->it_->operator-(
other);
580 return this->it_->operator-(*
other_it->it_);
583 template <
typename TYPE>
586 return this->it_->
get();
589 template <
typename TYPE>
592 this->it_->set(data);
595 template<
typename TYPE>
598 return this->it_->getElem();
601 template<
typename TYPE>
603 return this->it_->isValid();
606 template<
typename TYPE>
608 return "iterAdaptor";
611 template<
typename TYPE>
613 std::stringstream
ss;
614 ss << this->className();
615 ss <<
"(" << *this->it_ <<
")";
620 template<
typename TYPE>
625 template <
typename TYPE>
630 template <
typename TYPE>
637 template <
typename TYPE>
642 template <
typename TYPE>
649 template <
typename TYPE>
652 return this->
begin();
655 template <
typename TYPE>
661 template <
typename TYPE>
664 return this->
begin();
667 template <
typename TYPE>
673 template <
typename TYPE>
674 template<
typename Callback>
678 for (
auto it = this->
first();
it.isValid();
it.next()) {
683 template<
typename TYPE>
684 template<
typename Callback>
687 for (
auto it = this->
first(); it.
isValid(); it.next()) {
688 operation(it.getElem());
692 template <
typename TYPE>
696 for (
const auto&
elem : *
this)
698 co_yield std::remove_const_t<TYPE>(
elem);
const TYPE * get() const
Get managed pointer const version.
Definition autoPtr.h:629
Lazy sequence generator using C++20 coroutines.
Definition coroutines.h:57
RAII wrapper for base iterators that provides standard iteration interface.
Definition iterable.h:86
const iterator< TYPE > & getIt() const
Gets the underlying iterator.
Definition iterable.h:515
TYPE & get() override
Gets the value of the element the iterator is pointing to.
Definition iterable.h:584
void operator-=(integer steps) const override
Moves the iterator backward by a specified number of steps.
Definition iterable.h:569
bool atNext(const iterator< TYPE > *other) const override
Checks if the current iterator is at the next element relative to another iterator.
Definition iterable.h:542
iterAdaptor * clone() const override
Creates a copy of the current iterator.
Definition iterable.h:477
iterAdaptor * getPrev() const override
Gets the previous iterator.
Definition iterable.h:483
void set(const TYPE &data) override
Sets the value of the element the iterator is pointing to.
Definition iterable.h:590
bool hasPrev() const override
Checks if there is a previous element.
Definition iterable.h:527
void prev() const override
Moves the iterator to the previous element.
Definition iterable.h:557
void operator+=(integer steps) const override
Advances the iterator by a specified number of steps.
Definition iterable.h:563
std::string toString(bool enter) const override
Converts the iterator to a string representation.
Definition iterable.h:612
iterAdaptor * getNext() const override
Gets the next iterator.
Definition iterable.h:491
bool equalPtr(const iterator< TYPE > *other) const override
Compares the current iterator with another iterator.
Definition iterable.h:468
void next() const override
Moves the iterator to the next element.
Definition iterable.h:551
~iterAdaptor() override
Destructor for iterAdaptor.
Definition iterable.h:621
std::string className() const override
Returns the class name.
Definition iterable.h:607
bool isValid() const override
Checks if the iterator is pointing to a valid element.
Definition iterable.h:602
bool atPrev(const iterator< TYPE > *other) const override
Checks if the current iterator is at the previous element relative to another iterator.
Definition iterable.h:533
bool hasNext() const override
Checks if there is a next element.
Definition iterable.h:521
iterAdaptor & operator=(const iterAdaptor &other)
Copy assignment operator for the iterAdaptor.
Definition iterable.h:505
A base class for iterable containers that support multiple iteration patterns.
Definition iterable.h:70
iterAdaptor end() const
Returns a const iterator adapter pointing to the end sentinel of the container.
Definition iterable.h:643
void forEach(const Callback &operation=Callback{}) const
Applies a given operation to each element in the iterable container (const version).
iterAdaptor first()
Returns an iterator adapter pointing to the first element.
Definition iterable.h:650
iterAdaptor end()
Returns an iterator adapter pointing to the end sentinel of the container.
Definition iterable.h:631
virtual baseIterator< TYPE > * begins() const =0
Returns the iterator to the beginning of the container.
iterAdaptor begin() const
Returns a const iterator adapter pointing to the beginning of the container.
Definition iterable.h:638
iterAdaptor last() const
Returns a const iterator adapter pointing to the last element.
Definition iterable.h:668
iterAdaptor begin()
Returns an iterator adapter pointing to the beginning of the container.
Definition iterable.h:626
void forEach(Callback operation=Callback{})
Applies a given operation to each element in the iterable container.
iterAdaptor last()
Returns an iterator adapter pointing to the last element.
Definition iterable.h:656
coroutine::generator< T > generator() const
Creates a coroutine generator that yields elements from this container.
Definition iterable.h:694
iterAdaptor first() const
Returns a const iterator adapter pointing to the first element.
Definition iterable.h:662
virtual baseIterator< TYPE > * ends() const =0
Returns the iterator to the end of the container.
Base iterator interface that supports common operations for iteration.
Definition iterator.h:37
bool equal(const iterator *other) const
Checks if two iterators are equal.
Definition iterator.h:422
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.
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37
Abstract base class for unique element containers.
Definition set.h:44
Constraint for mutating operations.
Definition types.h:419
C++20 coroutine support with generator pattern implementation.
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:254
Defines the iterator class for traversing and manipulating container elements.
Main namespace for the project Original.
Definition algorithms.h:21
Standard namespace extensions for original::alternative.
Definition allocator.h:351
Core type system foundations and concept definitions.