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

Search Toolkit Book for CScannerFunctorArgN

Base class for N argument functions. More...

+ Inheritance diagram for CScannerFunctorArgN:
+ Collaboration diagram for CScannerFunctorArgN:

Public Types

enum  EAllFieldsCheck { eNoCheck , eCheckAll }
 Enum indicates how to interpret the plain value tree elements. More...
 
typedef vector< string * > TArgValueVector
 Vector of strings borrowed from the query environment pool to keep temporary values during the query execution. More...
 
typedef vector< const string * > TArgVector
 Vector of arguments, elements can point on values from TArgValueVector or variables located in the query tree itself. More...
 
typedef vector< CBoyerMooreMatcher * > TStringMatcherVector
 String matchers used for substring search. More...
 
typedef vector< const CBDB_Field * > TFieldVector
 If argument is a db field corresponding vector element contains the field pointer. More...
 

Public Member Functions

 CScannerFunctorArgN (CQueryExecEnv &env)
 
 ~CScannerFunctorArgN ()
 
bool IsAnyField (CBDB_File &dbf, const string &search_value, unsigned int arg_idx)
 Checks if value is equal to any field in the database. More...
 
CBoyerMooreMatcherGetMatcher (const string &search_value, unsigned int arg_idx)
 
void GetArguments (CTreeNode< CBDB_QueryNode > &tr, EAllFieldsCheck check_mode=eNoCheck)
 Extract function arguments from the parsing tree. More...
 
const stringGetArg (size_t idx) const
 
const CBDB_FieldGetArgField (size_t idx) const
 
void SetResult (CBDB_QueryNode &qnode, bool res)
 
- Public Member Functions inherited from CScannerFunctor
 CScannerFunctor (CQueryExecEnv &env)
 

Protected Attributes

TArgVector m_ArgVector
 
TArgValueVector m_ArgValueVector
 
TStringMatcherVector m_MatcherVector
 
TFieldVector m_FieldVector
 
string m_TmpStr
 
- Protected Attributes inherited from CScannerFunctor
CQueryExecEnvm_QueryEnv
 

Private Member Functions

void ResizeVectors (unsigned int new_size)
 Syncronously resize all arguments vectors. More...
 
void SyncArgValue (unsigned int idx, CResourcePool< string > &str_pool)
 m_ArgVector[idx] = m_ArgValueVector[idx] More...
 

Detailed Description

Base class for N argument functions.

Definition at line 314 of file bdb_query.cpp.

Member Typedef Documentation

◆ TArgValueVector

Vector of strings borrowed from the query environment pool to keep temporary values during the query execution.

Definition at line 329 of file bdb_query.cpp.

◆ TArgVector

Vector of arguments, elements can point on values from TArgValueVector or variables located in the query tree itself.

Definition at line 333 of file bdb_query.cpp.

◆ TFieldVector

If argument is a db field corresponding vector element contains the field pointer.

Definition at line 340 of file bdb_query.cpp.

◆ TStringMatcherVector

String matchers used for substring search.

Definition at line 336 of file bdb_query.cpp.

Member Enumeration Documentation

◆ EAllFieldsCheck

Enum indicates how to interpret the plain value tree elements.

It can be takes as is (eNoCheck) or converted to a "in any field" variant of check (similar to what PubMed does)

Enumerator
eNoCheck 
eCheckAll 

Definition at line 321 of file bdb_query.cpp.

Constructor & Destructor Documentation

◆ CScannerFunctorArgN()

CScannerFunctorArgN::CScannerFunctorArgN ( CQueryExecEnv env)
inline

Definition at line 343 of file bdb_query.cpp.

◆ ~CScannerFunctorArgN()

CScannerFunctorArgN::~CScannerFunctorArgN ( )

Member Function Documentation

◆ GetArg()

const string* CScannerFunctorArgN::GetArg ( size_t  idx) const
inline

◆ GetArgField()

const CBDB_Field* CScannerFunctorArgN::GetArgField ( size_t  idx) const
inline

Definition at line 443 of file bdb_query.cpp.

References _ASSERT, and m_FieldVector.

Referenced by CScannerFunctorEQ::Eval().

◆ GetArguments()

void CScannerFunctorArgN::GetArguments ( CTreeNode< CBDB_QueryNode > &  tr,
EAllFieldsCheck  check_mode = eNoCheck 
)
inline

◆ GetMatcher()

CBoyerMooreMatcher* CScannerFunctorArgN::GetMatcher ( const string search_value,
unsigned int  arg_idx 
)
inline

Definition at line 361 of file bdb_query.cpp.

References m_MatcherVector, and s_MakeNewMatcher().

Referenced by CScannerFunctorEQ::Eval(), and IsAnyField().

◆ IsAnyField()

bool CScannerFunctorArgN::IsAnyField ( CBDB_File dbf,
const string search_value,
unsigned int  arg_idx 
)
inline

Checks if value is equal to any field in the database.

Definition at line 350 of file bdb_query.cpp.

References BDB_find_field(), GetMatcher(), and m_TmpStr.

Referenced by GetArguments().

◆ ResizeVectors()

void CScannerFunctorArgN::ResizeVectors ( unsigned int  new_size)
inlineprivate

Syncronously resize all arguments vectors.

Definition at line 461 of file bdb_query.cpp.

References _ASSERT, m_ArgValueVector, m_ArgVector, m_FieldVector, and m_MatcherVector.

Referenced by GetArguments().

◆ SetResult()

void CScannerFunctorArgN::SetResult ( CBDB_QueryNode qnode,
bool  res 
)
inline

◆ SyncArgValue()

void CScannerFunctorArgN::SyncArgValue ( unsigned int  idx,
CResourcePool< string > &  str_pool 
)
inlineprivate

m_ArgVector[idx] = m_ArgValueVector[idx]

Definition at line 474 of file bdb_query.cpp.

References CResourcePool_Base< Value, Lock, CF >::Get(), m_ArgValueVector, and m_ArgVector.

Referenced by GetArguments().

Member Data Documentation

◆ m_ArgValueVector

TArgValueVector CScannerFunctorArgN::m_ArgValueVector
protected

Definition at line 485 of file bdb_query.cpp.

Referenced by GetArguments(), ResizeVectors(), SyncArgValue(), and ~CScannerFunctorArgN().

◆ m_ArgVector

TArgVector CScannerFunctorArgN::m_ArgVector
protected

◆ m_FieldVector

TFieldVector CScannerFunctorArgN::m_FieldVector
protected

Definition at line 487 of file bdb_query.cpp.

Referenced by GetArgField(), GetArguments(), and ResizeVectors().

◆ m_MatcherVector

TStringMatcherVector CScannerFunctorArgN::m_MatcherVector
protected

Definition at line 486 of file bdb_query.cpp.

Referenced by GetMatcher(), ResizeVectors(), and ~CScannerFunctorArgN().

◆ m_TmpStr

string CScannerFunctorArgN::m_TmpStr
protected

Definition at line 488 of file bdb_query.cpp.

Referenced by IsAnyField().


The documentation for this class was generated from the following file:
Modified on Thu Jul 18 16:01:02 2024 by modify_doxy.py rev. 669887