1#ifndef ITERATIONSTREAM_H
2#define ITERATIONSTREAM_H
31 template<
typename TYPE,
typename DERIVED>
59 [[nodiscard]] std::string
className()
const override;
69 [[nodiscard]] std::string
toString(
bool enter)
const override;
73template<
typename TYPE,
typename DERIVED>
79 for (
const auto it = this->begin(); it.isValid(); ++it) {
83 ss << formatString(it.get());
90template<
typename TYPE,
typename DERIVED>
92 const auto this_it = this->begin();
93 const auto other_it = other.begin();
94 for (; this_it.isValid() && other_it.isValid(); ++this_it, ++other_it) {
96 if (*this_it != *other_it)
97 return *this_it < *other_it ? -1 : 1;
100 return this_it.isValid() - other_it.isValid();
103template<
typename TYPE,
typename DERIVED>
105 return "iterationStream";
108template<
typename TYPE,
typename DERIVED>
111 std::stringstream ss;
112 ss << this->className() << this->elementsString();
113 if (enter) ss <<
"\n";
Base class for comparable objects.
Definition comparable.h:32
A base class for iterable containers that support multiple iteration patterns.
Definition iterable.h:59
A stream class that allows iteration, comparison, and printing.
Definition iterationStream.h:32
std::string elementsString() const
Returns a string representation of the elements in the stream.
Definition iterationStream.h:74
integer compareTo(const iterationStream &other) const override
Compares the current iteration stream with another iteration stream.
Definition iterationStream.h:91
std::string className() const override
Returns the class name.
Definition iterationStream.h:104
std::string toString(bool enter) const override
Converts the iteration stream to a string representation.
Definition iterationStream.h:109
Base class providing polymorphic string conversion capabilities.
Definition printable.h:39
Interface for objects that can be compared.
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:254
Base interface for iterable container types.
Main namespace for the project Original.
Definition algorithms.h:21
Interface for polymorphic string formatting and output.
Core type system foundations and concept definitions.