ADTF
cPooledClassFactory< T >
Inheritance diagram for cPooledClassFactory< T >:
[legend]

Public Member Functions

 UCOM_RESOLVE (IObject, IObjectPool)
 
virtual tResult CreateInstance (const char *strCID, iobject_ptr< IObject > &oObject, const tChar *strNameOfObject="") const
 
virtual tResult GetClasses (iobject_enum< const IClassInfo > &lstOfClasses) const
 
virtual tResult ReleaseObject (const iobject_ptr< IObject > &i_pRelease)
 
virtual size_t GetCacheSize () const
 Get entire size of the cache which is also the amount of preallocated objects. More...
 
virtual size_t GetUseCount () const
 Get amount of objects currently in use. More...
 
virtual tResult ResizeCache (size_t i_nSize)
 Resize the cache. More...
 
- Public Member Functions inherited from object< IObjectPool, IClassFactory >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object. More...
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying. More...
 
void Destroy () const override
 Destruct and deallocate instantiations of type IObject. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

Additional Inherited Members

- Protected Member Functions inherited from IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

template<typename T>
class adtf::ucom::ant::cPooledClassFactory< T >

Definition at line 18 of file class_factory_pooled.h.

Member Function Documentation

◆ GetCacheSize()

size_t GetCacheSize
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.

Definition at line 99 of file class_factory_pooled.h.

◆ GetUseCount()

size_t GetUseCount
virtual

Get amount of objects currently in use.

Returns
Amount of objects currently in use.

Definition at line 105 of file class_factory_pooled.h.

◆ ResizeCache()

tResult ResizeCache ( size_t  i_nSize)
virtual

Resize the cache.

Parameters
[in]i_nSizeNew 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_NOERROREverything went fine.
ERR_MEMORYMemory could not be allocated.
ERR_RESOURCE_IN_USEWanted cache size is too small for all currently held objects

Definition at line 111 of file class_factory_pooled.h.