#include <bn_generic_pool.h>
template<int MaxElementSize, int MaxSize>
generic_pool class
Generic pool implementation that uses a fixed size buffer.
| Template parameters | |
|---|---|
| MaxElementSize | Element size. |
| MaxSize | Maximum number of elements that can be stored. |
Contents
Base classes
-
template<int MaxElementSize>class igeneric_pool<sizeof(generic_pool_element<MaxElementSize>)>
- Base class of generic_
pool.
Public types
-
using size_type = typename base_type::
size_type - Size type alias.
Constructors, destructors, conversion operators
- generic_pool()
- Default constructor.
Public functions
-
template<typename Type>auto contains(const Type& value) const -> bool
- Indicates if the given value belongs to the generic_
pool or not. -
template<typename Type, typename... Args>auto create(Args && ... args) -> Type&
- Constructs a value inside of the generic_
pool. -
template<typename Type>void destroy(Type& value)
- Destroys the given value, previously allocated with the create method.
Function documentation
template<int MaxElementSize, int MaxSize>
template<typename Type, typename... Args>
Type& bn:: generic_pool<MaxElementSize, MaxSize>:: create(Args && ... args)
Constructs a value inside of the generic_
| Template parameters | |
|---|---|
| Type | Type of the value to construct. |
| Args | Type of the arguments of the value to construct. |
| Parameters | |
| args | Parameters of the value to construct. |
| Returns | Reference to the new value. |