1#ifndef CONTAINERADAPTER_H
2#define CONTAINERADAPTER_H
46 template <
typename TYPE,
47 template <
typename,
typename>
typename SERIAL,
48 template <
typename>
typename ALLOC>
49 requires ExtendsOf<baseList<TYPE, ALLOC<TYPE>>, SERIAL<TYPE, ALLOC<TYPE>>>
53 public comparable<containerAdapter<TYPE, SERIAL, ALLOC>>{
129 [[nodiscard]] std::string
toString(
bool enter)
const override;
135 template <
typename TYPE,
136 template <
typename,
typename>
typename SERIAL,
137 template <
typename>
typename ALLOC>
142 template <
typename TYPE,
143 template <
typename,
typename>
typename SERIAL,
144 template <
typename>
typename ALLOC>
148 return serial_.size();
151 template <
typename TYPE,
152 template <
typename,
typename>
typename SERIAL,
153 template <
typename>
typename ALLOC>
159 template <
typename TYPE,
160 template <
typename,
typename>
typename SERIAL,
161 template <
typename>
typename ALLOC>
164 return serial_.contains(e);
167 template <
typename TYPE,
168 template <
typename,
typename>
typename SERIAL,
169 template <
typename>
typename ALLOC>
173 return serial_.compareTo(other.serial_);
176 template <
typename TYPE,
177 template <
typename,
typename>
typename SERIAL,
178 template <
typename>
typename ALLOC>
181 return "containerAdapter";
184 template <
typename TYPE,
185 template <
typename,
typename>
typename SERIAL,
186 template <
typename>
typename ALLOC>
189 std::stringstream ss;
190 ss << this->className() <<
"(";
192 for (
const auto e : this->serial_)
194 if (!first) ss <<
", ";
199 if (enter) ss <<
"\n";
Provides a base class for variable-size serial containers.
Base class for comparable objects.
Definition comparable.h:32
Adapter class that provides unified interface for various container types.
Definition containerAdapter.h:53
SERIAL< TYPE, ALLOC< TYPE > > serial_
The underlying container instance.
Definition containerAdapter.h:60
u_integer size() const override
Returns the number of elements in the adapter.
Definition containerAdapter.h:146
containerAdapter(const SERIAL< TYPE, ALLOC< TYPE > > &serial)
Constructs a container adapter with specified underlying container.
Definition containerAdapter.h:139
void clear()
Removes all elements from the adapter.
Definition containerAdapter.h:155
std::string toString(bool enter) const override
Generates formatted string representation.
Definition containerAdapter.h:188
~containerAdapter() override=default
Virtual destructor for proper polymorphic cleanup.
integer compareTo(const containerAdapter &other) const override
Compares two container adapters lexicographically.
Definition containerAdapter.h:171
bool contains(const TYPE &e) const override
Checks for element existence in the adapter.
Definition containerAdapter.h:163
std::string className() const override
Gets class name identifier for type information.
Definition containerAdapter.h:180
Abstract base class for containers.
Definition container.h:26
Base class providing polymorphic string conversion capabilities.
Definition printable.h:39
static std::string formatString(const TYPE &t)
Universal value-to-string conversion.
Definition printable.h:263
Abstract base class for sequential containers with index-based access.
Definition serial.h:34
Interface for objects that can be compared.
Checks derivation or type identity using std::derived_from.
Definition types.h:393
std::uint32_t u_integer
32-bit unsigned integer type for sizes and indexes
Definition config.h:263
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:254
Main namespace for the project Original.
Definition algorithms.h:21
Interface for polymorphic string formatting and output.
Core type system foundations and concept definitions.