#include <object_pool_intf.h>
Inherits adtf::ucom::ant::IObject.
|
|
| ~IObjectPool ()=default |
| | Protected destructor --> Only the final implementation can be destroyed!
|
| |
|
| ~IObject ()=default |
| | Protected destructor --> Only the final implementation can be destroyed!
|
| |
The IObjectPool interface provides methods for managing pools of objects.
◆ ADTF_IID()
| adtf::ucom::ant::IObjectPool::ADTF_IID |
( |
IObjectPool | , |
|
|
"object_pool.ant.ucom.adtf.iid" | ) |
◆ GetCacheSize()
| virtual size_t adtf::ucom::ant::IObjectPool::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 adtf::ucom::ant::IObjectPool::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 adtf::ucom::ant::IObjectPool::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 |
The documentation for this class was generated from the following file: