|
ucommon
|
A reusable private pool of reusable types. More...
#include <vector.h>


Public Member Functions | |
| T * | create (void) |
| Get a typed object from the pager heap. | |
| T * | create (timeout_t timeout) |
| Create a typed object from the heap. | |
| T * | get (void) |
| Get a typed object from the pager heap. | |
| T * | get (timeout_t timeout) |
| Get a typed object from the heap. | |
| operator bool () | |
| Test if typed objects available from the pager or re-use list. | |
| operator T * () | |
| Get a typed object from the pager heap by pointer reference. | |
| bool | operator! () |
| Test if no objects are available for reuse or the pager. | |
| T * | operator* () |
| Get a typed object from the pager heap by type casting reference. | |
| paged_reuse (mempager *pager, unsigned count) | |
| Create a managed reusable typed object pool. | |
| void | release (T *object) |
| Release (return) a typed object back to the pager heap for re-use. | |
| T * | request (void) |
| Request immediately next available typed object from the pager heap. | |
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.
| ucommon::paged_reuse< T >::paged_reuse | ( | mempager * | pager, |
| unsigned | count | ||
| ) | [inline] |
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.
| pager | pool to allocate from. |
| count | of objects of specified type to allocate. |
| T* ucommon::paged_reuse< T >::create | ( | void | ) | [inline] |
| T* ucommon::paged_reuse< T >::create | ( | timeout_t | timeout | ) | [inline] |
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.
| timeout | to wait for heap in milliseconds. |
| T* ucommon::paged_reuse< T >::get | ( | void | ) | [inline] |
Get a typed object from the pager heap.
This function blocks when the heap is empty until an object is returned to the heap.
Reimplemented from ucommon::PagerReuse.
| T* ucommon::paged_reuse< T >::get | ( | timeout_t | timeout | ) | [inline] |
Get a typed object from the heap.
This function blocks until the the heap has an object to return or the timer has expired.
| timeout | to wait for heap in milliseconds. |
Reimplemented from ucommon::PagerReuse.
| ucommon::paged_reuse< T >::operator bool | ( | ) | [inline] |
| ucommon::paged_reuse< T >::operator T * | ( | ) | [inline] |
| bool ucommon::paged_reuse< T >::operator! | ( | ) | [inline] |
| T* ucommon::paged_reuse< T >::operator* | ( | ) | [inline] |
| void ucommon::paged_reuse< T >::release | ( | T * | object | ) | [inline] |
| T* ucommon::paged_reuse< T >::request | ( | void | ) | [inline] |
Request immediately next available typed object from the pager heap.
Reimplemented from ucommon::PagerReuse.
1.7.6.1