The IObjectPool interface provides methods for managing pools of objects.
More...
The IObjectPool interface provides methods for managing pools of objects.
Definition at line 23 of file object_pool_intf.h.
◆ ADTF_IID()
ADTF_IID |
( |
IObjectPool |
, |
|
|
"object_pool.ant.ucom.adtf.iid" |
|
|
) |
| |
◆ GetCacheSize()
virtual size_t GetCacheSize |
( |
| ) |
const |
|
pure virtual |
Get entire size of the cache which is also the amount of preallocated objects.
- Note
- To retrieve the current cache size , use
GetCacheSize() - GetUseCount()
- Returns
- Entire size of the cache.
◆ GetUseCount()
virtual size_t GetUseCount |
( |
| ) |
const |
|
pure virtual |
Get amount of objects currently in use.
- Returns
- Amount of objects currently in use.
◆ ReleaseObject()
A pooled Object will manage its Destroy Method with the UnrefObject Method.
Default object implementation:
- See also
- ucom::cObject.
- Parameters
-
i_pRelease | [in] A pooled object, that needs to be unreferenced. |
- Returns
- Standard Result Code.
◆ ResizeCache()
virtual tResult ResizeCache |
( |
size_t |
i_nSize | ) |
|
|
pure virtual |
Resize the cache.
- Parameters
-
[in] | i_nSize | New size of the cache |
- Postcondition
- If i_nSize > GetCacheSize() --> Memory for the cache is (re-)allocated.
-
If i_nSize < GetCacheSize() --> Memory from the cache is released. If the resulting cache size would be smaller zero, nothing is released and ERR_RESOURCE_IN_USE is returned.
-
If i_nSize == GetCacheSize() --> Nothing is done.
- Returns
- Standard error code
- Return values
-
ERR_NOERROR | Everything went fine. |
ERR_MEMORY | Memory could not be allocated. |
ERR_RESOURCE_IN_USE | Wanted cache size is too small for all currently held objects |