Commit 8748798c authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Improving object pool impl

parent d63159b2
......@@ -96,12 +96,12 @@ private:
// -= Implementierung object pool =----------------------------------------------------------------
//! Factory method for ObjectPool interface
IVAObjectPool* IVAObjectPool::Create( int iInitialSize, int iDelta, IVAPoolObjectFactory* pFactory, bool bDeleteFactory )
IVAObjectPool* IVAObjectPool::Create( const int iInitialSize, const int iDelta, IVAPoolObjectFactory* pFactory, const bool bDeleteFactory )
{
return new CVAObjectPool( iInitialSize, iDelta, pFactory, bDeleteFactory );
}
CVAObjectPool::CVAObjectPool( int iInitialSize, int iDelta, IVAPoolObjectFactory* pFactory, bool bDeleteFactory )
CVAObjectPool::CVAObjectPool( const int iInitialSize, const int iDelta, IVAPoolObjectFactory* pFactory, const bool bDeleteFactory )
: m_iDelta( iDelta )
, m_pFactory( pFactory )
, m_bDeleteFactory( bDeleteFactory )
......@@ -171,10 +171,9 @@ int CVAObjectPool::Grow( int iDelta )
m_sFree.insert( pObject );
}
if( POOL_DEBUG_MESSAGES )
{
VA_VERBOSE( "ObjectPool" + m_sName, "Growing pool by " << iDelta << "." );
}
#if POOL_DEBUG_MESSAGES == 1
VA_VERBOSE( "ObjectPool" + m_sName, "Growing pool by " << iDelta << "." );
#endif
return iDelta;
}
......@@ -242,9 +241,9 @@ void CVAObjectPool::ReleaseObject( CVAPoolObject* pObject )
// Keine Referenzen mehr => Objekt wieder freigeben
// Sicherheitscheck: Rckgabe = Anzahl gelschter Objekte
int nDeleted = ( int ) m_sUsed.erase( pObject );
m_sUsed.erase( pObject );
// TODO: Wichtig. Referenz-Management fr Container beim Reset handhaben
// assert( nDeleted == 1 );
m_sFree.insert( pObject );
#endif // POOL_NO_REUSE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment