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

This class serves as a ref-counted wrapper for a SearchSpace, which is much more convenient to deal with than having to remember who owns the results or who's responsible for deleting it. More...

#include <searchspace.h>

Public Member Functions

 BaseResultSet (BaseSearchSpace< SearchPointType, DataSetType > *sspace)
 
SearchResults get (int n, int offset=0)
 Returns the list of search results, which are pairs of (pointName, distance). More...
 
int size () const
 
BaseResultSet limit (int n)
 This function limits the number of results contained in this ResultSet. More...
 
BaseResultSet thresholdLimit (float maxDist)
 This method limits the number of results contained in this ResultSet. More...
 
void addPoints (const DataSetType *dataset, const QList< QString > &ids)
 
void removePoints (const QList< QString > &ids)
 
BaseSearchSpace< SearchPointType, DataSetType > * searchSpace ()
 

Protected Attributes

QExplicitlySharedDataPointer< SearchSpaceWrapper< SearchPointType, DataSetType > > _d
 

Detailed Description

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

This class serves as a ref-counted wrapper for a SearchSpace, which is much more convenient to deal with than having to remember who owns the results or who's responsible for deleting it.

Member Function Documentation

template<typename SearchPointType , typename DataSetType >
SearchResults BaseResultSet::get ( int  n,
int  offset = 0 
)

Returns the list of search results, which are pairs of (pointName, distance).

Parameters
nthe number of desired results
offsetthe start offset

Referenced by Cyclops::chainedSearch(), Cyclops::nnSearchById(), and Cyclops::nnSearchByIdWithFilter().

template<typename SearchPointType , typename DataSetType >
BaseResultSet gaia2::BaseResultSet< SearchPointType, DataSetType >::limit ( int  n)
inline

This function limits the number of results contained in this ResultSet.

If there were fewer points before than the given number, the ResultSet is left untouched, otherwise it will have a maximum of n points after the call. Returns this object so it is possible to chain this method call with a get() one.

References gaia2::BaseResultSet< SearchPointType, DataSetType >::limit().

Referenced by gaia2::BaseResultSet< SearchPointType, DataSetType >::limit().

template<typename SearchPointType , typename DataSetType >
BaseResultSet gaia2::BaseResultSet< SearchPointType, DataSetType >::thresholdLimit ( float  maxDist)
inline

This method limits the number of results contained in this ResultSet.

All the results which have a distance higher than the specified maxDist will be discarded from this SearchSpace. Returns this object so it is possible to chain this method call with a get() one.

References gaia2::BaseResultSet< SearchPointType, DataSetType >::thresholdLimit().

Referenced by Cyclops::chainedSearch(), and gaia2::BaseResultSet< SearchPointType, DataSetType >::thresholdLimit().


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