ADTF
Loading...
Searching...
No Matches
adtf::ucom::ant::cPooledClassFactory< T > Class Template Reference

Inherits adtf::ucom::catwo::object< IObjectPool, IClassFactory >.

Public Member Functions

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.
 
virtual size_t GetUseCount () const
 Get amount of objects currently in use.
 
virtual tResult ResizeCache (size_t i_nSize)
 Resize the cache.
 
- Public Member Functions inherited from adtf::ucom::catwo::object< IObjectPool, IClassFactory >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object.
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying.
 
void Destroy () const override
 Switch from non-virtual destructor to virtual destructor.
 
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object.
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying.
 
void Destroy () const override
 Switch from non-virtual destructor to virtual destructor.
 
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object.
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying.
 
void Destroy () const override
 Switch from non-virtual destructor to virtual destructor.
 
- Public Member Functions inherited from adtf::ucom::ant::IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 

Additional Inherited Members

- Protected Member Functions inherited from adtf::ucom::ant::IObject
 ~IObject ()=default
 Protected destructor --> Only the final implementation can be destroyed!
 

Member Function Documentation

◆ GetCacheSize()

template<typename T>
size_t adtf::ucom::ant::cPooledClassFactory< T >::GetCacheSize ( ) const
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()

template<typename T>
size_t adtf::ucom::ant::cPooledClassFactory< T >::GetUseCount ( ) const
virtual

Get amount of objects currently in use.

Returns
Amount of objects currently in use.

◆ ResizeCache()

template<typename T>
tResult adtf::ucom::ant::cPooledClassFactory< T >::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

The documentation for this class was generated from the following file: