All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Member Functions
QGpCoreTools::AbstractNumericalCache Class Reference

Brief description of class still missing. More...

#include <AbstractNumericalCache.h>

Inheritance diagram for QGpCoreTools::AbstractNumericalCache:
GeopsyCore::DFFTPackCache QGpCoreTools::MatrixMultiply

List of all members.

Public Member Functions

 AbstractNumericalCache (AbstractNumericalKey *key)
virtual void init ()=0
const AbstractNumericalKeykey () const
virtual ~AbstractNumericalCache ()

Static Public Member Functions

static const
AbstractNumericalCache
begin (AbstractNumericalKey *key)
static void clear ()
static void end (const AbstractNumericalCache *cache)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

References key().

{
  _key=key;
  _lastUse=clock();
  _locked=0;
}
{delete _key;}

Member Function Documentation

Takes the ownership over key. If a new cache is created, the cache tackes its ownership.

References init(), and key().

{
  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;
}

Referenced by QGpCoreTools::CoreApplicationPrivate::destructorCleanUp().

{
  QMutexLocker ml(&_mutex);
  qDeleteAll(_caches);
  _caches.clear();
}
virtual void QGpCoreTools::AbstractNumericalCache::init ( ) [pure virtual]

Implemented in GeopsyCore::DFFTPackCache, and QGpCoreTools::MatrixMultiply.

Referenced by begin().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines