NCBI C++ ToolKit
|
Search Toolkit Book for CTDQueryDataSource
class IQueryDataSource More...
#include <gui/objutils/td_query_data_source.hpp>
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 CMacroQueryExec * | GetQueryExec (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... | |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (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... | |
![]() | |
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 |
![]() | |
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< ITableData > | m_Table |
Additional Inherited Members | |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
![]() | |
typedef vector< pair< string, string > > | TNamedQueries |
![]() | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT 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 void | EnableDebugDump (bool on) |
![]() | |
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... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
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.
|
inline |
Definition at line 56 of file td_query_data_source.hpp.
|
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().
|
virtual |
Execute a string-matching query on the underlying data.
[in] | query | Reference to a pattern to search for. |
[out] | num_selected | Number of matching rows. |
[out] | num_queried | Total rows queried. |
[in] | string_matching | String matching algorithm to use. |
[in] | use_case | Whether 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, CStringMatching::MatchString(), query, and val.
|
virtual |
Implements IQueryDataSource.
Definition at line 50 of file td_query_data_source.cpp.
References m_Table.
|
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.
|
virtual |
Create an appropriate instance of a subclass of CQueryExec for that will be used to execute a query on the data source.
Implements IQueryDataSource.
Definition at line 55 of file td_query_data_source.cpp.
References CQueryExec::AddFunc(), CQueryParseNode::eAnd, CQueryParseNode::eBetween, CQueryParseNode::eBoolConst, NStr::eCase, CQueryParseNode::eEQ, CQueryParseNode::eFloatConst, CQueryParseNode::eGE, CQueryParseNode::eGT, CQueryParseNode::eIn, CQueryParseNode::eIntConst, CQueryParseNode::eLE, CQueryParseNode::eLike, CQueryParseNode::eLT, NStr::eNocase, CQueryParseNode::eNot, CQueryParseNode::eOr, CQueryParseNode::eString, CQueryParseNode::eSub, CQueryParseNode::eXor, and m_Table.
|
inline |
Definition at line 70 of file td_query_data_source.hpp.
References m_QueryResults.
Referenced by CGridWidget::SetSelectAll(), and CGridWidget::x_CompleteQuery().
|
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.
|
protected |
Definition at line 73 of file td_query_data_source.hpp.
Referenced by ClearQueryResults(), ExecuteStringQuery(), GetQueryResults(), and SetQueryResults().
|
protected |
Definition at line 74 of file td_query_data_source.hpp.
Referenced by ExecuteStringQuery(), GetColsCount(), GetColumnLabel(), and GetQueryExec().