33 template <
typename TYPE,
typename ALLOC>
132template<
typename TYPE,
typename ALLOC>
136 return parsed_index < 0 || parsed_index >= this->
size();
139template<
typename TYPE,
typename ALLOC>
141 return index >= 0 ? index : this->
size() + index;
144template<
typename TYPE,
typename ALLOC>
149template<
typename TYPE,
typename ALLOC>
151 return this->
get(-1);
154template<
typename TYPE,
typename ALLOC>
157 return this->
get(index);
160template<
typename TYPE,
typename ALLOC>
virtual u_integer size() const =0
Gets the number of elements in the container.
container(ALLOC alloc=ALLOC{})
Constructs a container with specified allocator.
Definition container.h:129
Abstract base class for sequential containers with index-based access.
Definition serial.h:34
bool contains(const TYPE &e) const override
Checks if the container contains the specified element.
Definition serial.h:161
virtual TYPE getEnd() const
Retrieves the last element in the container.
Definition serial.h:150
bool indexOutOfBound(integer index) const
Checks if the provided index is out of bounds.
Definition serial.h:133
virtual TYPE getBegin() const
Retrieves the first element in the container.
Definition serial.h:145
virtual TYPE & operator[](integer index)=0
Retrieves or sets the element at the specified index.
integer parseNegIndex(integer index) const
Converts negative indices into valid positive indices.
Definition serial.h:140
virtual TYPE get(integer index) const =0
Retrieves the element at the specified index.
virtual void set(integer index, const TYPE &e)=0
Sets the element at the specified index.
virtual TYPE operator[](integer index) const
Retrieves the element at the specified index (const version).
Definition serial.h:155
virtual u_integer indexOf(const TYPE &e) const =0
Finds the index of the specified element.
Abstract base class for container types.
Main namespace for the project Original.
Definition algorithms.h:21
std::uint32_t u_integer
32-bit unsigned integer type for sizes/indexes
Definition config.h:17
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:15