ORIGINAL
Loading...
Searching...
No Matches
original::baseArray< TYPE, ALLOC > Class Template Reference

Base class for fixed-size serial containers. More...

#include <baseArray.h>

Inheritance diagram for original::baseArray< TYPE, ALLOC >:
Inheritance graph
Collaboration diagram for original::baseArray< TYPE, ALLOC >:
Collaboration graph

Additional Inherited Members

- Public Member Functions inherited from original::serial< TYPE, ALLOC >
virtual TYPE get (integer index) const =0
 Retrieves the element at the specified index.
 
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).
 
virtual TYPE & operator[] (integer index)=0
 Retrieves or sets the element at the specified index.
 
virtual void set (integer index, const TYPE &e)=0
 Sets the element at the specified index.
 
virtual u_integer indexOf (const TYPE &e) const =0
 Finds the index of the specified element.
 
bool contains (const TYPE &e) const override
 Checks if the container contains the specified element.
 
- Public Member Functions inherited from original::container< TYPE, ALLOC >
virtual u_integer size () const =0
 Gets the number of elements in the container.
 
bool empty () const
 Checks if the container is empty.
 
virtual ~container ()=default
 Destructor for the container class.
 
- Protected Member Functions inherited from original::serial< TYPE, ALLOC >
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.
 
- Protected Member Functions inherited from original::container< TYPE, ALLOC >
 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.
 
- Protected Attributes inherited from original::container< TYPE, ALLOC >
ALLOC allocator
 The allocator instance used for memory management.
 

Detailed Description

template<typename TYPE, typename ALLOC = allocator<TYPE>>
class original::baseArray< TYPE, ALLOC >

Base class for fixed-size serial containers.

Template Parameters
TYPEType of the elements contained in the base array
ALLOCAllocator type for memory management (default: allocator<TYPE>)

This class is used as the foundation for containers with a fixed size, such as static arrays. It inherits from original::serial and provides the standard serial container functionality while maintaining a constant size throughout its existence.

The allocator is used to manage the fixed-size memory block for the array elements. Unlike dynamic containers, the allocation occurs only once during construction and remains fixed throughout the container's lifetime.

Key characteristics:

  • Single allocation during construction
  • No reallocation operations
  • Fixed capacity matching the size
  • Allocator propagated to derived classes

The ALLOC type must meet the C++ allocator requirements and should provide:

  • allocate()/deallocate() methods
  • construct()/destroy() methods
  • propagate_on_container_copy_assignment/move_assignment typedefs

The documentation for this class was generated from the following file: