ADTF
Loading...
Searching...
No Matches
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.
 
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 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 IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast()
 

Additional Inherited Members

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

Detailed Description

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

Definition at line 18 of file class_factory_pooled.h.

Constructor & Destructor Documentation

◆ cPooledClassFactory()

template<typename T>
cPooledClassFactory ( )

Definition at line 69 of file class_factory_pooled.h.

◆ ~cPooledClassFactory()

template<typename T>
~cPooledClassFactory ( )
virtual

Definition at line 74 of file class_factory_pooled.h.

Member Function Documentation

◆ CreateInstance()

template<typename T>
tResult CreateInstance ( const char * strCID,
iobject_ptr< IObject > & oObject,
const tChar * strNameOfObject = "" ) const
virtual

Definition at line 79 of file class_factory_pooled.h.

◆ GetCacheSize()

template<typename T>
size_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.

Definition at line 99 of file class_factory_pooled.h.

◆ GetClasses()

template<typename T>
tResult GetClasses ( iobject_enum< const IClassInfo > & lstOfClasses) const
virtual

Definition at line 87 of file class_factory_pooled.h.

◆ GetUseCount()

template<typename T>
size_t GetUseCount ( ) const
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.

◆ ReleaseObject()

template<typename T>
tResult ReleaseObject ( const iobject_ptr< IObject > & i_pRelease)
virtual

Definition at line 93 of file class_factory_pooled.h.

◆ ResizeCache()

template<typename T>
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.