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.

Public types

using size_type = int
Size type alias.

Constructors, destructors, conversion operators

~igeneric_pool() noexcept
Destructor.

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, 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>
bn::igeneric_pool<MaxElementSize>::~igeneric_pool() noexcept

Destructor.

It doesn't destroy its elements, they must be destroyed manually.

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.