Embedded Template Library 1.0
pool

Classes

class  etl::generic_pool< VTypeSize, VAlignment, VSize >
 
class  etl::generic_pool_ext< VTypeSize, VAlignment >
 
class  etl::pool_exception
 
class  etl::pool_no_allocation
 
class  etl::pool_object_not_in_pool
 
class  etl::pool_element_size
 
class  etl::ipool
 
class  etl::pool< T, VSize >
 
class  etl::pool_ext< T >
 

Detailed Description

A fixed capacity pool.


Class Documentation

◆ etl::generic_pool

class etl::generic_pool
template<size_t VTypeSize, size_t VAlignment, size_t VSize>
class etl::generic_pool< VTypeSize, VAlignment, VSize >

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

Public Member Functions

 generic_pool ()
 Constructor.
 
template<typename U >
U * allocate ()
 
template<typename U >
U * create ()
 
template<typename U , typename T1 >
U * create (const T1 &value1)
 
template<typename U , typename T1 , typename T2 >
U * create (const T1 &value1, const T2 &value2)
 
template<typename U , typename T1 , typename T2 , typename T3 >
U * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename U , typename T1 , typename T2 , typename T3 , typename T4 >
U * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename U >
void destroy (const U *const p_object)
 
- Public Member Functions inherited from etl::ipool
template<typename T >
T * allocate ()
 
template<typename T >
T * create ()
 
template<typename T , typename T1 >
T * create (const T1 &value1)
 
template<typename T , typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T , typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename T >
void destroy (const T *const p_object)
 
void release (const void *const p_object)
 
void release_all ()
 Release all objects in the pool.
 
bool is_in_pool (const void *const p_object) const
 
size_t max_size () const
 Returns the maximum number of items in the pool.
 
size_t capacity () 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
 
bool full () const
 

Static Public Attributes

static ETL_CONSTANT size_t SIZE = VSize
 
static ETL_CONSTANT size_t ALIGNMENT = VAlignment
 
static ETL_CONSTANT size_t TYPE_SIZE = VTypeSize
 

Additional Inherited Members

- Public Types inherited from etl::ipool
typedef size_t size_type
 
- Protected Member Functions inherited from etl::ipool
 ipool (char *p_buffer_, uint32_t item_size_, uint32_t max_size_)
 Constructor.
 
 ~ipool ()
 Destructor.
 

Member Function Documentation

◆ allocate()

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U >
U * etl::generic_pool< VTypeSize, VAlignment, VSize >::allocate ( )
inline

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 null pointer is returned. Static asserts if the specified type is too large for the pool.

◆ create() [1/5]

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U >
U * etl::generic_pool< VTypeSize, VAlignment, VSize >::create ( )
inline

Allocate storage for an object from the pool and create with default. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [2/5]

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U , typename T1 >
U * etl::generic_pool< VTypeSize, VAlignment, VSize >::create ( const T1 &  value1)
inline

Allocate storage for an object from the pool and create with 1 parameter. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [3/5]

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U , typename T1 , typename T2 >
U * etl::generic_pool< VTypeSize, VAlignment, VSize >::create ( const T1 &  value1,
const T2 &  value2 
)
inline

Allocate storage for an object from the pool and create with 2 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [4/5]

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U , typename T1 , typename T2 , typename T3 >
U * etl::generic_pool< VTypeSize, VAlignment, VSize >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)
inline

Allocate storage for an object from the pool and create with 3 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [5/5]

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U , typename T1 , typename T2 , typename T3 , typename T4 >
U * etl::generic_pool< VTypeSize, VAlignment, VSize >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)
inline

Allocate storage for an object from the pool and create with 4 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ destroy()

template<size_t VTypeSize, size_t VAlignment, size_t VSize>
template<typename U >
void etl::generic_pool< VTypeSize, VAlignment, VSize >::destroy ( const U *const  p_object)
inline

Destroys the object. Undefined behaviour if the pool does not contain a 'U'.

Parameters
p_objectA pointer to the object to be destroyed.

◆ etl::generic_pool_ext

class etl::generic_pool_ext
template<size_t VTypeSize, size_t VAlignment>
class etl::generic_pool_ext< VTypeSize, VAlignment >

A templated abstract pool implementation that uses a fixed size pool. The storage for the pool is supplied externally.

Public Types

typedef etl::aligned_storage< sizeof(element_internal), etl::alignment_of< element_internal >::value >::type element
 
- Public Types inherited from etl::ipool
typedef size_t size_type
 

Public Member Functions

 generic_pool_ext (element *buffer, size_t size)
 Constructor.
 
template<typename U >
U * allocate ()
 
template<typename U >
U * create ()
 
template<typename U , typename T1 >
U * create (const T1 &value1)
 
template<typename U , typename T1 , typename T2 >
U * create (const T1 &value1, const T2 &value2)
 
template<typename U , typename T1 , typename T2 , typename T3 >
U * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename U , typename T1 , typename T2 , typename T3 , typename T4 >
U * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename U >
void destroy (const U *const p_object)
 
- Public Member Functions inherited from etl::ipool
template<typename T >
T * allocate ()
 
template<typename T >
T * create ()
 
template<typename T , typename T1 >
T * create (const T1 &value1)
 
template<typename T , typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T , typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename T >
void destroy (const T *const p_object)
 
void release (const void *const p_object)
 
void release_all ()
 Release all objects in the pool.
 
bool is_in_pool (const void *const p_object) const
 
size_t max_size () const
 Returns the maximum number of items in the pool.
 
size_t capacity () 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
 
bool full () const
 

Static Public Attributes

static ETL_CONSTANT size_t ALIGNMENT = VAlignment
 
static ETL_CONSTANT size_t TYPE_SIZE = VTypeSize
 

Additional Inherited Members

- Protected Member Functions inherited from etl::ipool
 ipool (char *p_buffer_, uint32_t item_size_, uint32_t max_size_)
 Constructor.
 
 ~ipool ()
 Destructor.
 

Member Function Documentation

◆ allocate()

template<size_t VTypeSize, size_t VAlignment>
template<typename U >
U * etl::generic_pool_ext< VTypeSize, VAlignment >::allocate ( )
inline

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 null pointer is returned. Static asserts if the specified type is too large for the pool.

◆ create() [1/5]

template<size_t VTypeSize, size_t VAlignment>
template<typename U >
U * etl::generic_pool_ext< VTypeSize, VAlignment >::create ( )
inline

Allocate storage for an object from the pool and create with default. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [2/5]

template<size_t VTypeSize, size_t VAlignment>
template<typename U , typename T1 >
U * etl::generic_pool_ext< VTypeSize, VAlignment >::create ( const T1 &  value1)
inline

Allocate storage for an object from the pool and create with 1 parameter. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [3/5]

template<size_t VTypeSize, size_t VAlignment>
template<typename U , typename T1 , typename T2 >
U * etl::generic_pool_ext< VTypeSize, VAlignment >::create ( const T1 &  value1,
const T2 &  value2 
)
inline

Allocate storage for an object from the pool and create with 2 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [4/5]

template<size_t VTypeSize, size_t VAlignment>
template<typename U , typename T1 , typename T2 , typename T3 >
U * etl::generic_pool_ext< VTypeSize, VAlignment >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)
inline

Allocate storage for an object from the pool and create with 3 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [5/5]

template<size_t VTypeSize, size_t VAlignment>
template<typename U , typename T1 , typename T2 , typename T3 , typename T4 >
U * etl::generic_pool_ext< VTypeSize, VAlignment >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)
inline

Allocate storage for an object from the pool and create with 4 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ destroy()

template<size_t VTypeSize, size_t VAlignment>
template<typename U >
void etl::generic_pool_ext< VTypeSize, VAlignment >::destroy ( const U *const  p_object)
inline

Destroys the object. Undefined behaviour if the pool does not contain a 'U'.

Parameters
p_objectA pointer to the object to be destroyed.

◆ etl::pool_exception

class etl::pool_exception

The base class for pool exceptions.

Public Member Functions

 pool_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::exception
ETL_CONSTEXPR exception (string_type reason_, string_type, numeric_type line_)
 Constructor.
 
ETL_CONSTEXPR string_type what () const
 
ETL_CONSTEXPR string_type file_name () const
 
ETL_CONSTEXPR numeric_type line_number () const
 

Additional Inherited Members

- Public Types inherited from etl::exception
typedef const char * string_type
 
typedef int numeric_type
 

◆ etl::pool_no_allocation

class etl::pool_no_allocation

The exception thrown when the pool has no more free items.

Public Member Functions

 pool_no_allocation (string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::pool_exception
 pool_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::exception
ETL_CONSTEXPR exception (string_type reason_, string_type, numeric_type line_)
 Constructor.
 
ETL_CONSTEXPR string_type what () const
 
ETL_CONSTEXPR string_type file_name () const
 
ETL_CONSTEXPR numeric_type line_number () const
 

Additional Inherited Members

- Public Types inherited from etl::exception
typedef const char * string_type
 
typedef int numeric_type
 

◆ etl::pool_object_not_in_pool

class etl::pool_object_not_in_pool

The exception thrown when an object is released which does not belong to the pool.

Public Member Functions

 pool_object_not_in_pool (string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::pool_exception
 pool_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::exception
ETL_CONSTEXPR exception (string_type reason_, string_type, numeric_type line_)
 Constructor.
 
ETL_CONSTEXPR string_type what () const
 
ETL_CONSTEXPR string_type file_name () const
 
ETL_CONSTEXPR numeric_type line_number () const
 

Additional Inherited Members

- Public Types inherited from etl::exception
typedef const char * string_type
 
typedef int numeric_type
 

◆ etl::pool_element_size

class etl::pool_element_size

The exception thrown when an the type requested is larger than the element size.

Public Member Functions

 pool_element_size (string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::pool_exception
 pool_exception (string_type reason_, string_type file_name_, numeric_type line_number_)
 
- Public Member Functions inherited from etl::exception
ETL_CONSTEXPR exception (string_type reason_, string_type, numeric_type line_)
 Constructor.
 
ETL_CONSTEXPR string_type what () const
 
ETL_CONSTEXPR string_type file_name () const
 
ETL_CONSTEXPR numeric_type line_number () const
 

Additional Inherited Members

- Public Types inherited from etl::exception
typedef const char * string_type
 
typedef int numeric_type
 

◆ etl::ipool

class etl::ipool

Public Types

typedef size_t size_type
 

Public Member Functions

template<typename T >
T * allocate ()
 
template<typename T >
T * create ()
 
template<typename T , typename T1 >
T * create (const T1 &value1)
 
template<typename T , typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T , typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename T >
void destroy (const T *const p_object)
 
void release (const void *const p_object)
 
void release_all ()
 Release all objects in the pool.
 
bool is_in_pool (const void *const p_object) const
 
size_t max_size () const
 Returns the maximum number of items in the pool.
 
size_t capacity () 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
 
bool full () const
 

Protected Member Functions

 ipool (char *p_buffer_, uint32_t item_size_, uint32_t max_size_)
 Constructor.
 
 ~ipool ()
 Destructor.
 

Member Function Documentation

◆ allocate()

template<typename T >
T * etl::ipool::allocate ( )
inline

Allocate storage for 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 null pointer is returned.

◆ create() [1/2]

template<typename T >
T * etl::ipool::create ( )
inline

Allocate storage for an object from the pool and create default. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [2/2]

template<typename T , typename T1 >
T * etl::ipool::create ( const T1 &  value1)
inline

Allocate storage for an object from the pool and create with 1 parameter. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ destroy()

template<typename T >
void etl::ipool::destroy ( const T *const  p_object)
inline

Destroys the object. Undefined behaviour if the pool does not contain a 'T'.

Parameters
p_objectA pointer to the object to be destroyed.

◆ empty()

bool etl::ipool::empty ( ) const
inline

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

Returns
true if there are none allocated.

◆ full()

bool etl::ipool::full ( ) const
inline

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

Returns
true if there are none free.

◆ is_in_pool()

bool etl::ipool::is_in_pool ( const void *const  p_object) const
inline

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

◆ release()

void etl::ipool::release ( const void *const  p_object)
inline

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.

◆ etl::pool

class etl::pool
template<typename T, const size_t VSize>
class etl::pool< T, VSize >

A templated pool implementation that uses a fixed size pool.

Public Member Functions

 pool ()
 Constructor.
 
T * allocate ()
 
T * create ()
 
template<typename T1 >
T * create (const T1 &value1)
 
template<typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename U >
void release (const U *const p_object)
 
template<typename U >
void destroy (const U *const p_object)
 
- Public Member Functions inherited from etl::generic_pool< sizeof(T), etl::alignment_of< T >::value, VSize >
 generic_pool ()
 Constructor.
 
U * allocate ()
 
U * create ()
 
U * create (const T1 &value1)
 
U * create (const T1 &value1, const T2 &value2)
 
U * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
U * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
void destroy (const U *const p_object)
 
- Public Member Functions inherited from etl::ipool
template<typename T >
T * allocate ()
 
template<typename T >
T * create ()
 
template<typename T , typename T1 >
T * create (const T1 &value1)
 
template<typename T , typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T , typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename T >
void destroy (const T *const p_object)
 
void release (const void *const p_object)
 
void release_all ()
 Release all objects in the pool.
 
bool is_in_pool (const void *const p_object) const
 
size_t max_size () const
 Returns the maximum number of items in the pool.
 
size_t capacity () 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
 
bool full () const
 

Additional Inherited Members

- Public Types inherited from etl::ipool
typedef size_t size_type
 
- Static Public Attributes inherited from etl::generic_pool< sizeof(T), etl::alignment_of< T >::value, VSize >
static ETL_CONSTANT size_t SIZE
 
static ETL_CONSTANT size_t ALIGNMENT
 
static ETL_CONSTANT size_t TYPE_SIZE
 
- Protected Member Functions inherited from etl::ipool
 ipool (char *p_buffer_, uint32_t item_size_, uint32_t max_size_)
 Constructor.
 
 ~ipool ()
 Destructor.
 

Member Function Documentation

◆ allocate()

template<typename T , const size_t VSize>
T * etl::pool< T, VSize >::allocate ( )
inline

Allocate an object from the pool. Uses the default constructor. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned. Static asserts if the specified type is too large for the pool.

◆ create() [1/5]

template<typename T , const size_t VSize>
T * etl::pool< T, VSize >::create ( )
inline

Allocate storage for an object from the pool and create with default. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [2/5]

template<typename T , const size_t VSize>
template<typename T1 >
T * etl::pool< T, VSize >::create ( const T1 &  value1)
inline

Allocate storage for an object from the pool and create with 1 parameter. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [3/5]

template<typename T , const size_t VSize>
template<typename T1 , typename T2 >
T * etl::pool< T, VSize >::create ( const T1 &  value1,
const T2 &  value2 
)
inline

Allocate storage for an object from the pool and create with 2 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [4/5]

template<typename T , const size_t VSize>
template<typename T1 , typename T2 , typename T3 >
T * etl::pool< T, VSize >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)
inline

Allocate storage for an object from the pool and create with 3 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [5/5]

template<typename T , const size_t VSize>
template<typename T1 , typename T2 , typename T3 , typename T4 >
T * etl::pool< T, VSize >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)
inline

Allocate storage for an object from the pool and create with 4 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ destroy()

template<typename T , const size_t VSize>
template<typename U >
void etl::pool< T, VSize >::destroy ( const U *const  p_object)
inline

Destroys the object. Undefined behaviour if the pool does not contain a 'U' object derived from 'U'.

Parameters
p_objectA pointer to the object to be destroyed.

◆ release()

template<typename T , const size_t VSize>
template<typename U >
void etl::pool< T, VSize >::release ( const U *const  p_object)
inline

Releases the object. Undefined behaviour if the pool does not contain a 'U' object derived from 'U'.

Parameters
p_objectA pointer to the object to be destroyed.

◆ etl::pool_ext

class etl::pool_ext
template<typename T>
class etl::pool_ext< T >

A templated pool implementation that uses a fixed size pool. The storage for the pool is supplied externally.

Public Member Functions

 pool_ext (typename base_t::element *buffer, size_t size)
 Constructor.
 
T * allocate ()
 
T * create ()
 
template<typename T1 >
T * create (const T1 &value1)
 
template<typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename U >
void release (const U *const p_object)
 
template<typename U >
void destroy (const U *const p_object)
 
- Public Member Functions inherited from etl::generic_pool_ext< sizeof(T), etl::alignment_of< T >::value >
 generic_pool_ext (element *buffer, size_t size)
 Constructor.
 
U * allocate ()
 
U * create ()
 
U * create (const T1 &value1)
 
U * create (const T1 &value1, const T2 &value2)
 
U * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
U * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
void destroy (const U *const p_object)
 
- Public Member Functions inherited from etl::ipool
template<typename T >
T * allocate ()
 
template<typename T >
T * create ()
 
template<typename T , typename T1 >
T * create (const T1 &value1)
 
template<typename T , typename T1 , typename T2 >
T * create (const T1 &value1, const T2 &value2)
 
template<typename T , typename T1 , typename T2 , typename T3 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3)
 
template<typename T , typename T1 , typename T2 , typename T3 , typename T4 >
T * create (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 
template<typename T >
void destroy (const T *const p_object)
 
void release (const void *const p_object)
 
void release_all ()
 Release all objects in the pool.
 
bool is_in_pool (const void *const p_object) const
 
size_t max_size () const
 Returns the maximum number of items in the pool.
 
size_t capacity () 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
 
bool full () const
 

Additional Inherited Members

- Public Types inherited from etl::generic_pool_ext< sizeof(T), etl::alignment_of< T >::value >
typedef etl::aligned_storage< sizeof(element_internal), etl::alignment_of< element_internal >::value >::type element
 
- Public Types inherited from etl::ipool
typedef size_t size_type
 
- Static Public Attributes inherited from etl::generic_pool_ext< sizeof(T), etl::alignment_of< T >::value >
static ETL_CONSTANT size_t ALIGNMENT
 
static ETL_CONSTANT size_t TYPE_SIZE
 
- Protected Member Functions inherited from etl::ipool
 ipool (char *p_buffer_, uint32_t item_size_, uint32_t max_size_)
 Constructor.
 
 ~ipool ()
 Destructor.
 

Member Function Documentation

◆ allocate()

template<typename T >
T * etl::pool_ext< T >::allocate ( )
inline

Allocate an object from the pool. Uses the default constructor. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned. Static asserts if the specified type is too large for the pool.

◆ create() [1/5]

template<typename T >
T * etl::pool_ext< T >::create ( )
inline

Allocate storage for an object from the pool and create with default. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [2/5]

template<typename T >
template<typename T1 >
T * etl::pool_ext< T >::create ( const T1 &  value1)
inline

Allocate storage for an object from the pool and create with 1 parameter. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [3/5]

template<typename T >
template<typename T1 , typename T2 >
T * etl::pool_ext< T >::create ( const T1 &  value1,
const T2 &  value2 
)
inline

Allocate storage for an object from the pool and create with 2 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [4/5]

template<typename T >
template<typename T1 , typename T2 , typename T3 >
T * etl::pool_ext< T >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)
inline

Allocate storage for an object from the pool and create with 3 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ create() [5/5]

template<typename T >
template<typename T1 , typename T2 , typename T3 , typename T4 >
T * etl::pool_ext< T >::create ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)
inline

Allocate storage for an object from the pool and create with 4 parameters. If asserts or exceptions are enabled and there are no more free items an etl::pool_no_allocation if thrown, otherwise a null pointer is returned.

◆ destroy()

template<typename T >
template<typename U >
void etl::pool_ext< T >::destroy ( const U *const  p_object)
inline

Destroys the object. Undefined behaviour if the pool does not contain a 'U' object derived from 'U'.

Parameters
p_objectA pointer to the object to be destroyed.

◆ release()

template<typename T >
template<typename U >
void etl::pool_ext< T >::release ( const U *const  p_object)
inline

Releases the object. Undefined behaviour if the pool does not contain a 'U' object derived from 'U'.

Parameters
p_objectA pointer to the object to be destroyed.