#include <bn_generic_pool.h>
template<int MaxElementSize>
igeneric_pool class
Base class of generic_
Template parameters | |
---|---|
MaxElementSize | Maximum element size in bytes. |
Can be used as a reference type for all generic_
Base classes
- class igeneric_pool_base
- Base class of igeneric_
pool.
Public types
- using size_type = igeneric_pool_base::size_type
- Size type alias.
Public functions
-
auto size() const -> size_
type - Returns the current elements count.
-
auto max_size() const -> size_
type - Returns the maximum possible elements count.
-
auto available() const -> size_
type - Returns the remaining element capacity.
- auto empty() const -> bool
- Indicates if it doesn't contain any element.
- auto full() const -> bool
- Indicates if it can't contain any more elements.
-
template<typename Type>auto contains(const Type& value) const -> bool
- Indicates if the given value belongs to the igeneric_
pool or not. -
template<typename Type, typename... Args>auto create(Args && ... args) -> Type&
- Constructs a value inside of the igeneric_
pool. -
template<typename Type>void destroy(Type& value)
- Destroys the given value, previously allocated with the create method.
Function documentation
template<int MaxElementSize>
template<typename Type, typename... Args>
Type& bn:: igeneric_pool<MaxElementSize>:: create(Args && ... args)
Constructs a value inside of the igeneric_
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. |