Gaia
gaia2::BaseSearchSpacePool< SearchPointType, DataSetType > Class Template Reference

The SearchSpacePool accomplishes 2 main functions: More...

#include <searchspacepool.h>

Classes

class  LabelIndex
 
class  ValueIndex
 

Public Types

typedef BaseSearchSpace< SearchPointType, DataSetType > SearchSpaceType
 

Public Member Functions

 BaseSearchSpacePool (const DataSetType *dataset)
 By default, the SearchSpacePool constructor takes a DataSet which it will use for creating indices. More...
 
void recreate ()
 Recreates the SearchSpacePool and all the indices (needed for instance when the dataset it is pointing to has been changed).
 
SearchSpaceTypegetAllPoints () const
 Returns a SearchSpace containing all points. More...
 
void indexOn (const QString &descriptorName)
 Indexes on the given descriptorName. More...
 
bool hasIndex (const QString &descriptorName) const
 Returns whether an index exists for the given descriptorName.
 
SearchSpaceTypegetSubSpace (const parser::Predicate *pred) const
 
const DataSetType * dataset () const
 

Static Public Member Functions

static void clear ()
 Clear the cache of preallocated SearchSpaces.
 
static SearchSpaceTypeacquire ()
 
static void release (SearchSpaceType *sspace)
 

Protected Member Functions

void clearIndices ()
 
int getCuttingPos (const SearchSpaceType &sspace, int idx, int type, Real value, int start, int end) const
 
void indexOnValue (const QString &descriptorName)
 assumes descriptorName is the fully qualified name
 
void indexOnLabel (const QString &descriptorName)
 assumes descriptorName is the fully qualified name
 
void indexOnEnum (const QString &descriptorName)
 assumes descriptorName is the fully qualified name
 

Protected Attributes

const DataSetType * _dataset
 
SearchSpaceType_originalSpace
 
GaiaMap< QString, ValueIndex_valueIndex
 
GaiaMap< QString, LabelIndex_labelIndex
 

Static Protected Attributes

static QList< SearchSpaceType * > _sspool = QList<SearchSpace*>()
 
static QMutex * _sspoolMutex = 0
 

Friends

class BaseQueryOptimizer< SearchPointType, DataSetType >
 

Detailed Description

template<typename SearchPointType, typename DataSetType>
class gaia2::BaseSearchSpacePool< SearchPointType, DataSetType >

The SearchSpacePool accomplishes 2 main functions:

  • it holds references to precomputed SearchSpaces which correspond to indexed descriptors
  • it acts as a pool of preallocated SearchSpaces, to avoid the cost of creating / deleting them each time.

Constructor & Destructor Documentation

template<typename SearchPointType , typename DataSetType >
BaseSearchSpacePool::BaseSearchSpacePool ( const DataSetType *  dataset)

By default, the SearchSpacePool constructor takes a DataSet which it will use for creating indices.

It is necessary to call the indexOn() method explicitly, though.

Member Function Documentation

template<typename SearchPointType , typename DataSetType >
BaseSearchSpace< SearchPointType, DataSetType > * BaseSearchSpacePool::getAllPoints ( ) const

Returns a SearchSpace containing all points.

FIXME: implementation needs to get a space from ::acquire() instead of creating a new one each time

template<typename SearchPointType , typename DataSetType >
void BaseSearchSpacePool::indexOn ( const QString &  descriptorName)

Indexes on the given descriptorName.

Queries which then use this descriptor should be faster.


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