Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

generic_pool< TYPE_SIZE_, ALIGNMENT_, SIZE_ > Class Template Reference

generic_pool< TYPE_SIZE_, ALIGNMENT_, SIZE_ > Class Template Reference
[pool]

A templated abstract pool implementation that uses a fixed size pool. More...

#include <pool.h>

Inherits etl::ipool.

Public Member Functions

 generic_pool ()
 Constructor.
template<typename U >
U * allocate ()
 Allocate an object from the pool.
void release (const void *p_object)
 Release an object in the pool.
void release_all ()
 Release all objects in the pool.
bool is_in_pool (const void *p_object) const
 Check to see if the object belongs to the pool.
size_t max_size () const
 Returns the maximum number of items in the pool.
size_t available () const
 Returns the number of free items in the pool.
size_t size () const
 Returns the number of allocated items in the pool.
bool empty () const
 Checks to see if there are no allocated items in the pool.
bool full () const
 Checks to see if there are no free items in the pool.

Detailed Description

template<const size_t TYPE_SIZE_, const size_t ALIGNMENT_, const size_t SIZE_>
class etl::generic_pool< TYPE_SIZE_, ALIGNMENT_, SIZE_ >

A templated abstract pool implementation that uses a fixed size pool.

Definition at line 384 of file pool.h.


Constructor & Destructor Documentation

generic_pool (  )

Constructor.

Definition at line 395 of file pool.h.


Member Function Documentation

U* allocate (  )

Allocate an object from the pool.

If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a nullptr is returned. Static asserts if the specified type is too large for the pool.

Definition at line 407 of file pool.h.

size_t available (  ) const [inherited]

Returns the number of free items in the pool.

Definition at line 179 of file pool.h.

bool empty (  ) const [inherited]

Checks to see if there are no allocated items in the pool.

Returns:
true if there are none allocated.

Definition at line 196 of file pool.h.

bool full (  ) const [inherited]

Checks to see if there are no free items in the pool.

Returns:
true if there are none free.

Definition at line 205 of file pool.h.

bool is_in_pool ( const void *  p_object ) const [inherited]

Check to see if the object belongs to the pool.

Parameters:
p_objectA pointer to the object to be checked.
Returns:
true< > if it does, otherwise false

Definition at line 163 of file pool.h.

size_t max_size (  ) const [inherited]

Returns the maximum number of items in the pool.

Definition at line 171 of file pool.h.

void release ( const void *  p_object ) [inherited]

Release an object in the pool.

If asserts or exceptions are enabled and the object does not belong to this pool then an etl::pool_object_not_in_pool is thrown.

Parameters:
p_objectA pointer to the object to be released.

Definition at line 142 of file pool.h.

void release_all (  ) [inherited]

Release all objects in the pool.

Definition at line 150 of file pool.h.

size_t size (  ) const [inherited]

Returns the number of allocated items in the pool.

Definition at line 187 of file pool.h.