Brief description of class still missing. More...
#include <AbstractNumericalCache.h>
Public Member Functions | |
AbstractNumericalCache (AbstractNumericalKey *key) | |
virtual void | init ()=0 |
const AbstractNumericalKey & | key () const |
virtual | ~AbstractNumericalCache () |
Static Public Member Functions | |
static const AbstractNumericalCache * | begin (AbstractNumericalKey *key) |
static void | clear () |
static void | end (const AbstractNumericalCache *cache) |
Brief description of class still missing.
Full description of class still missing
virtual QGpCoreTools::AbstractNumericalCache::~AbstractNumericalCache | ( | ) | [inline, virtual] |
{delete _key;}
const AbstractNumericalCache * QGpCoreTools::AbstractNumericalCache::begin | ( | AbstractNumericalKey * | key | ) | [static] |
Takes the ownership over key. If a new cache is created, the cache tackes its ownership.
{ AbstractNumericalCache * cache; HashNumericalKey k(key); _mutex.lock(); QHash<HashNumericalKey, AbstractNumericalCache *>::iterator it=_caches.find(k); if(it!=_caches.end()) { cache=it.value(); cache->setLocked(true); _mutex.unlock(); delete key; // A similar key already exist, drop this one } else { cache=add(key); cache->setLocked(true); _mutex.unlock(); cache->init(); } return cache; }
void QGpCoreTools::AbstractNumericalCache::clear | ( | ) | [static] |
Referenced by QGpCoreTools::CoreApplicationPrivate::destructorCleanUp().
{ QMutexLocker ml(&_mutex); qDeleteAll(_caches); _caches.clear(); }
void QGpCoreTools::AbstractNumericalCache::end | ( | const AbstractNumericalCache * | cache | ) | [static] |
Referenced by GeopsyCore::DFFTPack::backward(), GeopsyCore::DFFTPack::forward(), GeopsyCore::DFFTPack::manyBackward(), GeopsyCore::DFFTPack::manyForward(), and QGpCoreTools::MatrixData< T >::operator*().
{
cache->setLocked(false);
}
virtual void QGpCoreTools::AbstractNumericalCache::init | ( | ) | [pure virtual] |
Implemented in GeopsyCore::DFFTPackCache, and QGpCoreTools::MatrixMultiply.
Referenced by begin().
const AbstractNumericalKey& QGpCoreTools::AbstractNumericalCache::key | ( | ) | const [inline] |
Referenced by AbstractNumericalCache(), begin(), QGpCoreTools::MatrixMultiply::indexCount(), GeopsyCore::DFFTPackCache::init(), and QGpCoreTools::MatrixMultiply::init().
{return *_key;}