UCommon
|
An array of reusable objects. More...
#include <reuse.h>
Public Member Functions | |
~ArrayReuse () | |
Destroy reusable private heap array. | |
Protected Member Functions | |
ArrayReuse (size_t objsize, unsigned c) | |
ArrayReuse (size_t objsize, unsigned c, void *memory) | |
bool | avail (void) const |
ReusableObject * | get (timeout_t timeout) |
ReusableObject * | get (void) |
ReusableObject * | request (void) |
![]() | |
ReusableObject * | next (ReusableObject *object) |
Get next reusable object in the pool. | |
void | release (ReusableObject *object) |
Release resuable object. | |
ReusableAllocator () | |
Initialize reusable allocator through a conditional. | |
![]() | |
void | broadcast (void) |
Signal the conditional to release all waiting threads. | |
Conditional () | |
Initialize and construct conditional. | |
void | signal (void) |
Signal the conditional to release one waiting thread. | |
bool | wait (struct timespec *timeout) |
Conditional wait for signal on timespec timeout. | |
bool | wait (timeout_t timeout) |
Conditional wait for signal on millisecond timeout. | |
void | wait (void) |
Wait (block) until signalled. | |
~Conditional () | |
Destroy conditional, release any blocked threads. | |
![]() | |
ConditionMutex () | |
Initialize and construct conditional. | |
void | lock (void) |
Lock the conditional's supporting mutex. | |
void | unlock (void) |
Unlock the conditional's supporting mutex. | |
~ConditionMutex () | |
Destroy conditional, release any blocked threads. | |
Additional Inherited Members | |
![]() | |
static pthread_condattr_t * | initializer (void) |
Support function for getting conditional attributes for realtime scheduling. | |
static void | set (struct timespec *hires, timeout_t timeout) |
Convert a millisecond timeout into use for high resolution conditional timers. | |
![]() | |
ReusableObject * | freelist |
unsigned | waiting |
![]() | |
pthread_cond_t | cond |
![]() | |
pthread_mutex_t | mutex |
![]() | |
static attribute | attr |
An array of reusable objects.
This class is used to support the array_use template. A pool of objects are created which can be allocated as needed. Deallocated objects are returned to the pool so they can be reallocated later. This is a private fixed size heap.