NCBI C++ ToolKit
Public Member Functions | Protected Attributes | List of all members
CTDQueryDataSource Class Reference

Search Toolkit Book for CTDQueryDataSource

class IQueryDataSource More...

#include <gui/objutils/td_query_data_source.hpp>

+ Inheritance diagram for CTDQueryDataSource:
+ Collaboration diagram for CTDQueryDataSource:

Public Member Functions

 CTDQueryDataSource (ITableData &tabelData)
 
std::vector< size_t > GetQueryResults () const
 
IQueryDataSource interface implementation
virtual string GetColumnLabel (size_t col) const
 get number and names of columns in data source More...
 
virtual size_t GetColsCount () const
 
virtual CMacroQueryExecGetQueryExec (bool casesensitive, CStringMatching::EStringMatching string_matching=CStringMatching::ePlainSearch)
 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 SetQueryResults (CMacroQueryExec *q)
 Set selection results to be whatever elements are selected in 'q'. More...
 
virtual void ClearQueryResults ()
 Clear any current results from previous queries. More...
 
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)
 Execute a string-matching query on the underlying data. More...
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 
- Public Member Functions inherited from IQueryDataSource
virtual ~IQueryDataSource ()
 dtor More...
 
virtual CRef< objects::CScope > GetScope ()
 Return a scope for the data source, if available. More...
 

Protected Attributes

std::vector< size_t > m_QueryResults
 
CIRef< ITableDatam_Table
 

Additional Inherited Members

- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1, eAllocFillZero, eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef CAtomicCounter TCounter
 Counter type is CAtomiCounter. More...
 
typedef TCounter::TValue TCount
 Alias for value type of counter. More...
 
- Public Types inherited from IQueryDataSource
typedef vector< pair< string, string > > TNamedQueries
 
- Static Public Member Functions inherited from CObject
static NCBI_NORETURN void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_NORETURN void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. 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 53 of file td_query_data_source.hpp.

Constructor & Destructor Documentation

CTDQueryDataSource::CTDQueryDataSource ( ITableData tabelData)
inline

Definition at line 56 of file td_query_data_source.hpp.

Member Function Documentation

void CTDQueryDataSource::ClearQueryResults ( )
virtual

Clear any current results from previous queries.

Implements IQueryDataSource.

Definition at line 111 of file td_query_data_source.cpp.

References m_QueryResults.

Referenced by ExecuteStringQuery().

void CTDQueryDataSource::ExecuteStringQuery ( const string query,
size_t &  num_selected,
size_t &  num_queried,
CStringMatching::EStringMatching  string_matching = CStringMatching::ePlainSearch,
NStr::ECase  use_case = NStr::eCase 
)
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.

Implements IQueryDataSource.

Definition at line 116 of file td_query_data_source.cpp.

References ClearQueryResults(), i, m_QueryResults, m_Table, and CStringMatching::MatchString().

size_t CTDQueryDataSource::GetColsCount ( ) const
virtual

Implements IQueryDataSource.

Definition at line 50 of file td_query_data_source.cpp.

References m_Table.

string CTDQueryDataSource::GetColumnLabel ( size_t  col) const
virtual

get number and names of columns in data source

Implements IQueryDataSource.

Definition at line 45 of file td_query_data_source.cpp.

References m_Table.

CMacroQueryExec * CTDQueryDataSource::GetQueryExec ( bool  casesensitive,
CStringMatching::EStringMatching  matching = CStringMatching::ePlainSearch 
)
virtual
std::vector<size_t> CTDQueryDataSource::GetQueryResults ( ) const
inline

Definition at line 70 of file td_query_data_source.hpp.

References m_QueryResults.

Referenced by CGridWidget::SetSelectAll(), and CGridWidget::x_CompleteQuery().

void CTDQueryDataSource::SetQueryResults ( CMacroQueryExec q)
virtual

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

Implements IQueryDataSource.

Definition at line 104 of file td_query_data_source.cpp.

References CTableQueryExec::GetTableSelected(), and m_QueryResults.

Member Data Documentation

std::vector<size_t> CTDQueryDataSource::m_QueryResults
protected
CIRef<ITableData> CTDQueryDataSource::m_Table
protected

The documentation for this class was generated from the following files:
Modified on Tue Jan 16 15:42:12 2018 by modify_doxy.py rev. 546573