template<int MaxElementSize>
bn::igeneric_pool class

Base class of generic_pool.

Template parameters
MaxElementSize Maximum element size in bytes.

Can be used as a reference type for all generic_pool containers containing a specific maximum size.

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_pool.

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.