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

Search Toolkit Book for CPromoteRule

class CPromoteRule More...

#include <gui/objutils/query_func_promote.hpp>

Public Member Functions

 CPromoteRule ()
 Default ctor initializes to undefined values. More...
 
 CPromoteRule (CQueryParseNode::EType op, QueryValueType::EBaseType type1, QueryValueType::EBaseType type2, QueryValueType::EBaseType ptype)
 Set the values for the type and their comparison operator. More...
 
bool operator< (const CPromoteRule &rhs) const
 Allow table to be sorted for faster lookup. More...
 
bool operator== (const CPromoteRule &rhs) const
 Allows us to check to see if we found requested table entry. More...
 

Public Attributes

CQueryParseNode::EType m_CompareOperator
 The comparison operator applied to the two values, e.g. ==, <, ... More...
 
QueryValueType::EBaseType m_Type1
 The extended type for the first element to compare. More...
 
QueryValueType::EBaseType m_Type2
 The extended type for the second element to compare. More...
 
QueryValueType::EBaseType m_PromotedType
 The type to be used for the comparison. More...
 

Detailed Description

class CPromoteRule

This is a simple class meant to be an entry in a table representing promotion rules. Given the table, you can determine for any two types (and type information incldudes the source of the data such as whether it came from the tree) and their operator, which type should be used as the basis for comparison, or if comparison does not make any sense. (An example of non-promotable pair would be a boolean and a string where that string is not converible to a boolean or numeric value).

Definition at line 133 of file query_func_promote.hpp.

Constructor & Destructor Documentation

CPromoteRule::CPromoteRule ( )
inline

Default ctor initializes to undefined values.

Definition at line 136 of file query_func_promote.hpp.

CPromoteRule::CPromoteRule ( CQueryParseNode::EType  op,
QueryValueType::EBaseType  type1,
QueryValueType::EBaseType  type2,
QueryValueType::EBaseType  ptype 
)
inline

Set the values for the type and their comparison operator.

Definition at line 143 of file query_func_promote.hpp.

Member Function Documentation

bool CPromoteRule::operator< ( const CPromoteRule rhs) const
inline

Allow table to be sorted for faster lookup.

Definition at line 154 of file query_func_promote.hpp.

References m_CompareOperator, m_Type1, and m_Type2.

bool CPromoteRule::operator== ( const CPromoteRule rhs) const
inline

Allows us to check to see if we found requested table entry.

Definition at line 170 of file query_func_promote.hpp.

References m_CompareOperator, m_Type1, and m_Type2.

Member Data Documentation

CQueryParseNode::EType CPromoteRule::m_CompareOperator

The comparison operator applied to the two values, e.g. ==, <, ...

Definition at line 178 of file query_func_promote.hpp.

Referenced by operator<(), operator==(), and CQueryFuncPromoteBase::ResolveAndPromote().

QueryValueType::EBaseType CPromoteRule::m_PromotedType

The type to be used for the comparison.

This is the type from the CQueryParseNode class since it does not care where the data came from

Definition at line 186 of file query_func_promote.hpp.

QueryValueType::EBaseType CPromoteRule::m_Type1

The extended type for the first element to compare.

Definition at line 180 of file query_func_promote.hpp.

Referenced by operator<(), operator==(), and CQueryFuncPromoteBase::ResolveAndPromote().

QueryValueType::EBaseType CPromoteRule::m_Type2

The extended type for the second element to compare.

Definition at line 182 of file query_func_promote.hpp.

Referenced by operator<(), operator==(), and CQueryFuncPromoteBase::ResolveAndPromote().


The documentation for this class was generated from the following file:
Modified on Tue Aug 23 18:24:43 2016 by modify_doxy.py rev. 506947