|
| 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.
|
|
template<typename TYPE, typename ALLOC>
class original::container< TYPE, ALLOC >
Abstract base class for containers.
- Template Parameters
-
TYPE | Type of the elements stored in the container. |
ALLOC | Allocator type for memory management (default is allocator<TYPE>) |
Provides a common interface for container classes to manage a collection of elements. Supports querying the size, checking for emptiness, and checking if an element is contained. Uses the provided allocator for all memory management operations.
template<typename TYPE, typename ALLOC>
template<typename O_TYPE, typename... Args>
Constructs an element in-place.
- Template Parameters
-
O_TYPE | Type of object to construct (must be compatible with TYPE) |
Args | Types of constructor arguments |
- Parameters
-
o_ptr | Pointer to the memory where the object should be constructed |
args | Arguments to forward to the constructor |
Uses the container's allocator to construct an object of type O_TYPE
template<typename TYPE, typename ALLOC>
Checks if an element is contained in the container.
- Parameters
-
e | Element to check for presence in the container. |
- Returns
- True if the element is found in the container, false otherwise.
This method must be implemented by derived classes to provide the actual containment check.
container(ALLOC alloc=ALLOC{})
Constructs a container with specified allocator.
Definition container.h:129
virtual bool contains(const TYPE &e) const =0
Checks if an element is contained in the container.
Dynamic array container with amortized constant time operations.
Definition vector.h:42
Implemented in original::containerAdapter< TYPE, SERIAL, ALLOC >, original::containerAdapter< TYPE, blocksList, allocator >, original::containerAdapter< TYPE, chain, allocator >, original::serial< TYPE, ALLOC >, original::serial< bool, allocator< bool > >, original::serial< opts, allocator< opts > >, original::serial< TYPE, allocator< TYPE > >, and original::serial< underlying_type, rebind_alloc_underlying >.
template<typename TYPE, typename ALLOC>
Gets the number of elements in the container.
- Returns
- The size of the container.
This method must be implemented by derived classes to return the correct size.
virtual u_integer size() const =0
Gets the number of elements in the container.
std::uint32_t u_integer
32-bit unsigned integer type for sizes/indexes
Definition config.h:17
Implemented in original::array< TYPE, ALLOC >, original::array< underlying_type, rebind_alloc_underlying >, original::bitSet< ALLOC >, original::blocksList< TYPE, ALLOC >, original::blocksList< TYPE, allocator< TYPE > >, original::chain< TYPE, ALLOC >, original::chain< opts >, original::chain< original::strongPtr< original::filter< TYPE > > >, original::chain< original::strongPtr< original::transform< TYPE > > >, original::chain< TYPE, allocator< TYPE > >, original::containerAdapter< TYPE, SERIAL, ALLOC >, original::containerAdapter< TYPE, blocksList, allocator >, original::containerAdapter< TYPE, chain, allocator >, original::forwardChain< TYPE, ALLOC >, original::vector< TYPE, ALLOC >, and original::vector< TYPE * >.