A reusable private pool of reusable types.
More...
#include <vector.h>
template<class T>
class ucommon::paged_reuse< T >
A reusable private pool of reusable types.
A pool of typed objects is created which can be allocated from a memory pager. Deallocated typed objects are also returned to this pool so they can be reallocated later.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 586 of file vector.h.
Create a managed reusable typed object pool.
This manages a heap of typed objects that can either be reused from released objects or allocate from an existing memory pager pool.
- Parameters
-
pager | pool to allocate from. |
count | of objects of specified type to allocate. |
Definition at line 596 of file vector.h.
Get a typed object from the pager heap.
This function blocks when the heap is empty until an object is returned to the heap. The objects default constructor is used.
- Returns
- typed object pointer from heap.
Definition at line 627 of file vector.h.
Create a typed object from the heap.
This function blocks until the the heap has an object to return or the timer has expired. The objects default constructor is used.
- Parameters
-
timeout | to wait for heap in milliseconds. |
- Returns
- typed object pointer from heap or NULL if timeout.
Definition at line 646 of file vector.h.
Get a typed object from the pager heap.
This function blocks when the heap is empty until an object is returned to the heap.
- Returns
- typed object pointer from heap.
Definition at line 618 of file vector.h.
Get a typed object from the heap.
This function blocks until the the heap has an object to return or the timer has expired.
- Parameters
-
timeout | to wait for heap in milliseconds. |
- Returns
- typed object pointer from heap or NULL if timeout.
Definition at line 636 of file vector.h.
Test if typed objects available from the pager or re-use list.
- Returns
- true if objects still are available.
Definition at line 603 of file vector.h.
Get a typed object from the pager heap by pointer reference.
This function blocks while the heap is empty.
- Returns
- typed object pointer from heap.
Definition at line 676 of file vector.h.
Test if no objects are available for reuse or the pager.
- Returns
- true if no objects are available.
Definition at line 610 of file vector.h.
Get a typed object from the pager heap by type casting reference.
This function blocks while the heap is empty.
- Returns
- typed object pointer from heap.
Definition at line 668 of file vector.h.
Release (return) a typed object back to the pager heap for re-use.
- Parameters
-
Definition at line 660 of file vector.h.
Request immediately next available typed object from the pager heap.
- Returns
- typed object pointer or NULL if heap is empty.
Definition at line 653 of file vector.h.
The documentation for this class was generated from the following file: