Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
pool< T, SIZE_ > Class Template Reference
[pool]
A templated pool implementation that uses a fixed size pool. More...
#include <pool.h>
Inherits etl::ipool.
Public Member Functions | |
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<typename T, const size_t SIZE_>
class etl::pool< T, SIZE_ >
A templated pool implementation that uses a fixed size pool.
Definition at line 331 of file pool.h.
Constructor & Destructor Documentation
Member Function Documentation
U* allocate | ( | ) |
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 nullptr is returned. Static asserts if the specified type is too large for the pool.
size_t available | ( | ) | const [inherited] |
bool empty | ( | ) | const [inherited] |
bool full | ( | ) | const [inherited] |
bool is_in_pool | ( | const void * | p_object ) | const [inherited] |
size_t max_size | ( | ) | const [inherited] |
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_object A pointer to the object to be released.
void release_all | ( | ) | [inherited] |
Generated on Tue Jul 12 2022 14:05:53 by
