NCBI C++ ToolKit
|
Search Toolkit Book for CQueryFuncPromoteEq
class CQueryFuncPromoteEq More...
#include <gui/objutils/query_func_promote.hpp>
Public Member Functions | |
CQueryFuncPromoteEq (NStr::ECase c=NStr::eCase, CStringMatching::EStringMatching matching=CStringMatching::ePlainSearch) | |
Ctor. More... | |
virtual void | Evaluate (CQueryParseTree::TNode &qnode) |
Evaluate the node to see if '==' returns true. More... | |
Public Member Functions inherited from CQueryFuncEqualityCompares | |
CQueryFuncEqualityCompares (CQueryParseNode::EType op_type, NStr::ECase c=NStr::eCase, CStringMatching::EStringMatching matching=CStringMatching::ePlainSearch) | |
Ctor. More... | |
virtual void | InitTypePromotionRules (CQueryParseNode::EType op_type) |
Initialize promotion table for eqaulity comparisons (e.g. == or In) More... | |
Public Member Functions inherited from CQueryFuncPromoteCompare | |
CQueryFuncPromoteCompare (CQueryParseNode::EType op_type, NStr::ECase c=NStr::eCase, CStringMatching::EStringMatching matching=(CStringMatching::ePlainSearch)) | |
Ctors for compare must include op_type for loading promotion rules. More... | |
Public Member Functions inherited from CQueryFuncPromoteBase | |
CQueryFuncPromoteBase () | |
void | SetCaseSensitive (NStr::ECase e) |
Get/set case sensitivity for all string compares for this function. More... | |
NStr::ECase | GetCaseSensitive () const |
void | SetStringMatching (CStringMatching::EStringMatching m) |
Get/set string matching algorithm. More... | |
CStringMatching::EStringMatching | GetStringMatching () const |
TEvalResult * | GetQueryNodeValue (CQueryParseTree::TNode &qnode) |
Get the user object for node 'qnode' or NULL if not created. More... | |
TEvalResult * | MakeQueryNodeValue (CQueryParseTree::TNode &qnode) |
Get user object for 'qnode' or create a new object if it doesn't exist. More... | |
void | PreProcess (CQueryParseTree::TNode &tr, objects::CScope *scope) |
Resolve, if possible, the data type for the query node tr and, for operator nodes (e.g. More... | |
QueryValueType::EBaseType | ResolveAndPromote (size_t comparison_idx, CQueryParseTree::TNode &qnode, CQueryParseTree::TNode *arg1, CQueryParseTree::TNode *arg2) |
For the operator in 'qnode', retrive from data source (if ncessary) the data values arg1 and arg2 and promote the values, if needed, to the required type needed for comparison. More... | |
QueryValueType::EBaseType | GetPromotedType (const CPromoteRule &pr) |
Given data from two nodes and a comparison operator (e.g. More... | |
bool | ResolveFieldValue (TEvalResult &tree_val) |
Get the value of a field from the data source and store the result in the CQueryNodeValue object. More... | |
bool | SetCompareType (TEvalResult &tree_value) |
Given data for a node, determine its underlying data type (e.g. More... | |
virtual size_t | GetArgCountMin (CQueryParseNode::EType) |
virtual size_t | GetArgCountMax (CQueryParseNode::EType) |
Public Member Functions inherited from CQueryFunctionBase | |
virtual | ~CQueryFunctionBase () |
virtual bool | EvaluateChildrenFirst () const |
Do we evaluate before visiting the nodes children or after. More... | |
Additional Inherited Members | |
Public Types inherited from CQueryFuncPromoteBase | |
typedef CQueryNodeValue | TEvalResult |
Public Types inherited from CQueryFunctionBase | |
typedef vector< CQueryParseTree::TNode * > | TArgVector |
Vector for easy argument access. More... | |
Protected Member Functions inherited from CQueryFuncPromoteBase | |
void | AddPromoteTypes (CQueryParseNode::EType op, QueryValueType::EBaseType type1, QueryValueType::EBaseType type2, QueryValueType::EBaseType ptype) |
Add the promtion rules for both 'type1 op type2' and 'type2 op type1'. More... | |
Protected Member Functions inherited from CQueryFunctionBase | |
CQueryExec & | GetExec () |
Get reference on parent execution environment. More... | |
CQueryParseTree & | GetQueryTree () |
Get query tree (execution context) More... | |
void | MakeArgVector (CQueryParseTree::TNode &qnode, TArgVector &args) |
Created vector of arguments (translate sub-nodes to vector) More... | |
CQueryParseTree::TNode * | GetArg0 (CQueryParseTree::TNode &qnode) |
Get first sub-node. More... | |
Protected Attributes inherited from CQueryFuncPromoteBase | |
std::vector< CPromoteRule > | m_PromoteRules |
Vector of sorted promotion rules. More... | |
NStr::ECase | m_CaseSensitive |
If true, all string comparisons by subclasses will use case-sensitive comparisons, otherwise not. More... | |
CStringMatching::EStringMatching | m_StringMatchAlgo |
Determines how string equality comaparisons will be handled (wildcards, regex, exact..) More... | |
Protected Attributes inherited from CQueryFunctionBase | |
CQueryExec * | m_QExec |
class CQueryFuncPromoteEq
Query execution function for equality comparison: ==
Definition at line 293 of file query_func_promote.hpp.
CQueryFuncPromoteEq::CQueryFuncPromoteEq | ( | NStr::ECase | c = NStr::eCase , |
CStringMatching::EStringMatching | matching = CStringMatching::ePlainSearch |
||
) |
Ctor.
Definition at line 1122 of file query_func_promote.cpp.
References CQueryParseNode::eEQ, and CQueryFuncEqualityCompares::InitTypePromotionRules().
|
virtual |
Evaluate the node to see if '==' returns true.
Implements CQueryFunctionBase.
Definition at line 1128 of file query_func_promote.cpp.
References NStr::Compare(), NStr::CompareNocase(), QueryValueType::eBool, CQueryParseNode::eEQ, QueryValueType::eFloat, QueryValueType::eInt, CStringMatching::ePlainSearch, QueryValueType::eSeqID, QueryValueType::eString, QueryValueType::eUndefined, CQueryFuncPromoteBase::GetCaseSensitive(), CQueryNodeValue::GetDataType(), CException::GetMsg(), CQueryFuncPromoteBase::GetQueryNodeValue(), CQueryNodeValue::GetScope(), CQueryNodeValue::GetValue(), CTreeNode< TValue, TKeyGetterP >::GetValue(), CQueryNodeValue::IsDataField(), CQueryNodeValue::m_Bool, CQueryNodeValue::m_Double, CQueryNodeValue::m_Int, CQueryNodeValue::m_String, CQueryFuncPromoteBase::m_StringMatchAlgo, CQueryFunctionBase::MakeArgVector(), CSeqUtils::Match(), match(), CStringMatching::MatchString(), NCBI_THROW, CQueryFuncPromoteBase::ResolveAndPromote(), result, CQueryNodeValue::SetValue(), and NStr::SizetToString().