NCBI C++ ToolKit
Public Types | Public Member Functions | List of all members
IQueryDataSource Class Referenceabstract

Search Toolkit Book for IQueryDataSource

class IQueryDataSource More...

#include <gui/objutils/query_data_source.hpp>

+ Inheritance diagram for IQueryDataSource:

Public Types

typedef vector< pair< string, string > > TNamedQueries
 

Public Member Functions

virtual ~IQueryDataSource ()
 dtor More...
 
virtual string GetColumnLabel (size_t col) const =0
 get number and names of columns in data source More...
 
virtual size_t GetColsCount () const =0
 
virtual void ExecuteStringQuery (const string &query, size_t &num_selected, size_t &num_queried, CStringMatching::EStringMatching string_matching=CStringMatching::ePlainSearch, NStr::ECase use_case=NStr::eCase)=0
 Execute a string-matching query on the underlying data. More...
 
virtual CRef< objects::CScope > GetScope ()
 Return a scope for the data source, if available. More...
 
virtual CMacroQueryExecGetQueryExec (bool casesensitive, CStringMatching::EStringMatching matching)=0
 Create an appropriate instance of a subclass of CQueryExec for that will be used to execute a query on the data source. More...
 
virtual void ClearQueryResults ()=0
 Clear any current results from previous queries. More...
 
virtual void SetQueryResults (CMacroQueryExec *q)=0
 Set selection results to be whatever elements are selected in 'q'. More...
 

Detailed Description

class IQueryDataSource

This is an abstract interface for any datasource that wants to support queries using CQueryParseTree and CQueryExec. This interface supports searching the data source for a spcified string (when parsing is not being used) and supports the creation of a query execution object that is tailored for that data source. This interface also allows the user to set and clear a set of selected results for the data source.

Definition at line 54 of file query_data_source.hpp.

Member Typedef Documentation

◆ TNamedQueries

Definition at line 56 of file query_data_source.hpp.

Constructor & Destructor Documentation

◆ ~IQueryDataSource()

virtual IQueryDataSource::~IQueryDataSource ( )
inlinevirtual

dtor

Definition at line 59 of file query_data_source.hpp.

Member Function Documentation

◆ ClearQueryResults()

virtual void IQueryDataSource::ClearQueryResults ( )
pure virtual

Clear any current results from previous queries.

Implemented in CPhyloTreeDataSource, and CTDQueryDataSource.

◆ ExecuteStringQuery()

virtual void IQueryDataSource::ExecuteStringQuery ( const string query,
size_t &  num_selected,
size_t &  num_queried,
CStringMatching::EStringMatching  string_matching = CStringMatching::ePlainSearch,
NStr::ECase  use_case = NStr::eCase 
)
pure virtual

Execute a string-matching query on the underlying data.

Parameters
[in]queryReference to a pattern to search for.
[out]num_selectedNumber of matching rows.
[out]num_queriedTotal rows queried.
[in]string_matchingString matching algorithm to use.
[in]use_caseWhether to do a case sensitive compare (default), or not.

Implemented in CPhyloTreeDataSource, and CTDQueryDataSource.

Referenced by CQueryParsePanel::CQueryJob::Execute().

◆ GetColsCount()

virtual size_t IQueryDataSource::GetColsCount ( ) const
pure virtual

◆ GetColumnLabel()

virtual string IQueryDataSource::GetColumnLabel ( size_t  col) const
pure virtual

get number and names of columns in data source

Implemented in CPhyloTreeDataSource, and CTDQueryDataSource.

◆ GetQueryExec()

virtual CMacroQueryExec* IQueryDataSource::GetQueryExec ( bool  casesensitive,
CStringMatching::EStringMatching  matching 
)
pure virtual

Create an appropriate instance of a subclass of CQueryExec for that will be used to execute a query on the data source.

Implemented in CTDQueryDataSource, and CPhyloTreeDataSource.

◆ GetScope()

virtual CRef<objects::CScope> IQueryDataSource::GetScope ( void  )
inlinevirtual

Return a scope for the data source, if available.

Reimplemented in CPhyloTreeDataSource.

Definition at line 79 of file query_data_source.hpp.

◆ SetQueryResults()

virtual void IQueryDataSource::SetQueryResults ( CMacroQueryExec q)
pure virtual

Set selection results to be whatever elements are selected in 'q'.

Implemented in CPhyloTreeDataSource, and CTDQueryDataSource.


The documentation for this class was generated from the following file:
Modified on Sun Apr 14 05:25:04 2024 by modify_doxy.py rev. 669887