|
| 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.
Abstract base class for containers.
Definition container.h:26
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:43
Implemented in original::serial< bool, allocator< bool > >, original::serial< hashNode *, rebind_alloc_pointer >, original::serial< opts, allocator< opts > >, original::serial< original::hashTable::hashNode *, rebind_alloc_pointer >, original::serial< original::skipList::skipListNode *, allocator< original::skipList::skipListNode * > >, original::serial< original::strongPtr< original::filter< TYPE > >, allocator< original::strongPtr< original::filter< TYPE > > > >, original::serial< original::strongPtr< original::transform< TYPE > >, allocator< original::strongPtr< original::transform< TYPE > > > >, original::serial< original::strongPtr< taskBase >, allocator< original::strongPtr< taskBase > > >, original::serial< original::thread, allocator< original::thread > >, original::containerAdapter< priorityTask, vector, allocator >, original::serial< priorityTask, allocator< priorityTask > >, original::containerAdapter< TYPE, SERIAL, ALLOC >, original::containerAdapter< TYPE, blocksList, allocator >, original::containerAdapter< TYPE, chain, allocator >, original::serial< TYPE, ALLOC >, original::serial< TYPE, allocator< TYPE > >, original::serial< TYPE *, allocator< TYPE * > >, and original::serial< underlying_type, rebind_alloc_underlying >.