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.
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 | ( | ) |
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.
| 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
1.7.2