|
| forwardChain (ALLOC alloc=ALLOC{}) |
| Constructs an empty forwardChain with specified allocator.
|
|
| forwardChain (const forwardChain &other) |
| Copy constructs a forwardChain with allocator propagation.
|
|
| forwardChain (std::initializer_list< TYPE > list) |
| Constructs a forwardChain from an initializer list.
|
|
| forwardChain (const array< TYPE > &arr) |
| Constructs a forwardChain from an array.
|
|
forwardChain & | operator= (const forwardChain &other) |
| Assignment operator for forwardChain.
|
|
| forwardChain (forwardChain &&other) noexcept |
| Move constructs a forwardChain with allocator propagation.
|
|
forwardChain & | operator= (forwardChain &&other) noexcept |
| Move assignment operator for forwardChain.
|
|
u_integer | size () const override |
| Gets the size of the forwardChain.
|
|
TYPE | get (integer index) const override |
| Gets the element at the specified index.
|
|
TYPE & | operator[] (integer index) override |
| Gets a reference to the element at the specified index.
|
|
void | set (integer index, const TYPE &e) override |
| Sets the element at the specified index.
|
|
u_integer | indexOf (const TYPE &e) const override |
| Finds the index of the first occurrence of the specified element.
|
|
void | pushBegin (const TYPE &e) override |
| Inserts element at the beginning of the chain.
|
|
void | push (integer index, const TYPE &e) override |
| Pushes an element at the specified index in the forwardChain.
|
|
void | pushEnd (const TYPE &e) override |
| Inserts element at the end of the chain.
|
|
TYPE | popBegin () override |
| Removes and returns the first element.
|
|
TYPE | pop (integer index) override |
| Pops an element at the specified index in the forwardChain.
|
|
TYPE | popEnd () override |
| Removes and returns the last element.
|
|
Iterator * | begins () const override |
| Gets an iterator to the beginning of the forwardChain.
|
|
Iterator * | ends () const override |
| Gets an iterator to the end of the forwardChain.
|
|
std::string | className () const override |
| Gets the class name of the forwardChain.
|
|
| ~forwardChain () override |
| Destructor for the forwardChain.
|
|
virtual void | add (const TYPE &e) |
| Adds an element to the end of the list.
|
|
virtual TYPE | remove (const TYPE &e) |
| Removes an element from the list.
|
|
virtual void | clear () |
| Removes all elements.
|
|
virtual TYPE | getBegin () const |
| Retrieves the first element in the container.
|
|
virtual TYPE | getEnd () const |
| Retrieves the last element in the container.
|
|
virtual TYPE | operator[] (integer index) const |
| Retrieves the element at the specified index (const version).
|
|
bool | contains (const TYPE &e) const override |
| Checks if the container contains the specified element.
|
|
bool | empty () const |
| Checks if the container is empty.
|
|
virtual | ~container ()=default |
| Destructor for the container class.
|
|
integer | compareTo (const iterationStream &other) const override |
| Compares the current iteration stream with another iteration stream.
|
|
std::string | className () const override |
| Returns the class name.
|
|
std::string | toString (bool enter) const override |
| Converts the iteration stream to a string representation.
|
|
| operator std::string () const |
| Explicit conversion to std::string.
|
|
| operator const char * () const |
| Explicit conversion to C-style string.
|
|
const char * | toCString (bool enter) const |
| Direct C-string access with formatting control.
|
|
template<typename TYPE> |
auto | formatString (const TYPE &t) -> std::string |
|
template<typename TYPE> |
auto | formatCString (const TYPE &t) -> const char * |
|
template<typename TYPE> |
auto | formatEnum (const TYPE &t) -> std::string |
|
template<typename TYPE> |
auto | formatString (TYPE *const &ptr) -> std::string |
|
iterAdaptor | begin () |
| Returns an iterator pointing to the beginning of the iterable container.
|
|
iterAdaptor | end () |
| Returns an iterator pointing to the end of the iterable container.
|
|
iterAdaptor | begin () const |
| Returns a constant iterator pointing to the beginning of the iterable container.
|
|
iterAdaptor | end () const |
| Returns a constant iterator pointing to the end of the iterable container.
|
|
iterAdaptor | first () |
| Returns an iterator pointing to the first element.
|
|
iterAdaptor | last () |
| Returns an iterator pointing to the last element.
|
|
iterAdaptor | first () const |
| Returns a constant iterator pointing to the first element.
|
|
iterAdaptor | last () const |
| Returns a constant iterator pointing to the last element.
|
|
template<typename Callback = transform<TYPE>>
requires Operation<Callback, TYPE> |
void | forEach (Callback operation=Callback{}) |
| Applies a given operation to each element in the iterable container.
|
|
template<typename Callback = transform<TYPE>>
requires Operation<Callback, TYPE> |
void | forEach (const Callback &operation=Callback{}) const |
| Applies a given operation to each element in the iterable container (const version).
|
|
template<typename Callback>
requires original::Operation<Callback, TYPE> |
auto | forEach (Callback operation) -> void |
|
template<typename Callback>
requires original::Operation<Callback, TYPE> |
auto | forEach (const Callback &operation) const -> void |
|
virtual integer | compareTo (const DERIVED &other) const=0 |
| Compares the current object with another of the same type.
|
|
bool | operator== (const DERIVED &other) const |
| Checks if the current object is equal to another.
|
|
bool | operator!= (const DERIVED &other) const |
| Checks if the current object is not equal to another.
|
|
bool | operator< (const DERIVED &other) const |
| Checks if the current object is less than another.
|
|
bool | operator> (const DERIVED &other) const |
| Checks if the current object is greater than another.
|
|
bool | operator<= (const DERIVED &other) const |
| Checks if the current object is less than or equal to another.
|
|
bool | operator>= (const DERIVED &other) const |
| Checks if the current object is greater than or equal to another.
|
|
virtual | ~comparable ()=default |
| Virtual destructor for proper cleanup of derived objects.
|
|
|
template<typename TYPE> |
static std::string | formatString (const TYPE &t) |
| Universal value-to-string conversion.
|
|
template<typename TYPE> |
static std::string | formatString (TYPE *const &ptr) |
| Pointer-specific formatting.
|
|
template<typename TYPE> |
static const char * | formatCString (const TYPE &t) |
| C-string cache for temporary usage.
|
|
template<typename TYPE> |
static std::string | formatEnum (const TYPE &t) |
| Enum formatting utility.
|
|
template<> |
auto | formatString (const char &t) -> std::string |
|
template<> |
auto | formatString (const bool &t) -> std::string |
|
template<> |
auto | formatString (const char *const &ptr) -> std::string |
|
bool | indexOutOfBound (integer index) const |
| Checks if the provided index is out of bounds.
|
|
integer | parseNegIndex (integer index) const |
| Converts negative indices into valid positive indices.
|
|
| container (ALLOC alloc=ALLOC{}) |
| Constructs a container with specified allocator.
|
|
TYPE * | allocate (u_integer size) |
| Allocates raw memory for elements.
|
|
void | deallocate (TYPE *ptr, u_integer size) |
| Deallocates memory previously allocated by allocate()
|
|
template<typename O_TYPE, typename... Args> |
void | construct (O_TYPE *o_ptr, Args &&... args) |
| Constructs an element in-place.
|
|
template<typename O_TYPE> |
void | destroy (O_TYPE *o_ptr) |
| Destroys an element.
|
|
std::string | elementsString () const |
| Returns a string representation of the elements in the stream.
|
|
ALLOC | allocator |
| The allocator instance used for memory management.
|
|
template<typename TYPE, typename ALLOC = allocator<TYPE>>
class original::forwardChain< TYPE, ALLOC >
A singly linked list implementation.
- Template Parameters
-
TYPE | The type of elements stored in the forward chain |
ALLOC | Allocator type for memory management (default: allocator<TYPE>) |
The forwardChain class implements a singly linked list where elements are stored in nodes. Each node points to the next node, and the list supports operations like push, pop, get, and indexOf. Uses the provided allocator for all memory management operations, including node allocation.