Abstract pool of numberofObjects equal buffers, each preceded by a PoolEntry, with allocation and free counters.
More...
#include <Pool.hh>
Inherited by Pds::GenericPool.
|
| virtual | ~Pool () |
| | Does nothing; empty virtual destructor.
|
| |
| | Pool (size_t sizeofObject, int numberofOfObjects) |
| | Set the object size and count and round each allocation (object plus PoolEntry header) up to a multiple of the PoolEntry size; the subclass calls populate() to create the buffers.
|
| |
| | Pool (size_t sizeofObject, int numberofOfObjects, unsigned alignBoundary) |
| | Like Pool(sizeofObject, numberofOfObjects), but rounds each allocation up to a multiple of alignBoundary.
|
| |
| void * | alloc (size_t size) |
| | Take a buffer from the free list and count the allocation; returns nullptr if size exceeds the object size or none is available.
|
| |
| virtual void | free (PoolEntry *) |
| | Return entry to the free list (enque()).
|
| |
| void | clearCounters () |
| | Zero the allocation and free counters.
|
| |
| size_t | sizeofObject () const |
| | Return the object size given to the constructor.
|
| |
| int | numberofObjects () const |
| | Return the number of buffers.
|
| |
| const uint64_t & | numberofAllocs () const |
| | Return a reference to the allocation counter.
|
| |
| const uint64_t & | numberofFrees () const |
| | Return a reference to the free counter.
|
| |
| int | numberOfAllocatedObjects () const |
| | Return allocations minus frees.
|
| |
| int | numberOfFreeObjects () const |
| | Return the number of buffers minus numberOfAllocatedObjects().
|
| |
Abstract pool of numberofObjects equal buffers, each preceded by a PoolEntry, with allocation and free counters.
Subclasses provide the storage and the free list.
◆ ~Pool()
Does nothing; empty virtual destructor.
◆ Pool() [1/2]
| Pds::Pool::Pool |
( |
size_t |
sizeofObject, |
|
|
int |
numberofOfObjects |
|
) |
| |
Set the object size and count and round each allocation (object plus PoolEntry header) up to a multiple of the PoolEntry size; the subclass calls populate() to create the buffers.
◆ Pool() [2/2]
| Pds::Pool::Pool |
( |
size_t |
sizeofObject, |
|
|
int |
numberofOfObjects, |
|
|
unsigned |
alignBoundary |
|
) |
| |
Like Pool(sizeofObject, numberofOfObjects), but rounds each allocation up to a multiple of alignBoundary.
◆ alloc()
| void * Pds::Pool::alloc |
( |
size_t |
size | ) |
|
|
inline |
Take a buffer from the free list and count the allocation; returns nullptr if size exceeds the object size or none is available.
◆ allocate()
| virtual void * Pds::Pool::allocate |
( |
size_t |
size | ) |
|
|
protectedpure virtual |
◆ clearCounters()
| void Pds::Pool::clearCounters |
( |
| ) |
|
Zero the allocation and free counters.
◆ deque()
| virtual void * Pds::Pool::deque |
( |
| ) |
|
|
protectedpure virtual |
◆ enque()
| virtual void Pds::Pool::enque |
( |
PoolEntry * |
| ) |
|
|
protectedpure virtual |
◆ free() [1/2]
Return entry to the free list (enque()).
◆ free() [2/2]
| void Pds::Pool::free |
( |
void * |
buffer | ) |
|
|
inlinestatic |
Return the user buffer buffer to the pool recorded in its PoolEntry header and count the free.
◆ numberOfAllocatedObjects()
| int Pds::Pool::numberOfAllocatedObjects |
( |
| ) |
const |
|
inline |
Return allocations minus frees.
◆ numberofAllocs()
| const uint64_t & Pds::Pool::numberofAllocs |
( |
| ) |
const |
|
inline |
Return a reference to the allocation counter.
◆ numberOfFreeObjects() [1/2]
| int Pds::Pool::numberOfFreeObjects |
( |
| ) |
const |
|
inline |
◆ numberOfFreeObjects() [2/2]
| int Pds::Pool::numberOfFreeObjects |
( |
void * |
buffer | ) |
|
|
inlinestatic |
◆ numberofFrees()
| const uint64_t & Pds::Pool::numberofFrees |
( |
| ) |
const |
|
inline |
Return a reference to the free counter.
◆ numberofObjects()
| int Pds::Pool::numberofObjects |
( |
| ) |
const |
|
inline |
Return the number of buffers.
◆ populate()
| void Pds::Pool::populate |
( |
| ) |
|
|
protected |
◆ sizeofAllocate()
| size_t Pds::Pool::sizeofAllocate |
( |
| ) |
const |
|
inlineprotected |
◆ sizeofObject()
| size_t Pds::Pool::sizeofObject |
( |
| ) |
const |
|
inline |
Return the object size given to the constructor.
The documentation for this class was generated from the following file: