OW_NAMESPACE::WQLSelectStatement Class Reference

#include <OW_WQLSelectStatement.hpp>

Collaboration diagram for OW_NAMESPACE::WQLSelectStatement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WQLSelectStatement ()
 ~WQLSelectStatement ()
void clear ()
 Clears all data members of this object.
const StringgetClassName () const
void setClassName (const String &className)
 Modifier.
UInt32 getSelectPropertyNameCount () const
 Returns the number of property names which were indicated in the selection list.
const StringgetSelectPropertyName (UInt32 i) const
 Gets the i-th selected property name in the list.
const StringArraygetSelectPropertyNames () const
 Gets the selected property names in the list.
void appendSelectPropertyName (const String &x)
 Appends a property name to the property name list.
UInt32 getWherePropertyNameCount () const
 Returns the number of unique property names from the where clause.
const StringgetWherePropertyName (UInt32 i) const
 Gets the i-th unique property appearing in the where clause.
bool appendWherePropertyName (const String &x)
 Appends a property name to the where property name list.
void appendOperation (WQLOperation x)
 Appends an operation to the operation array.
void appendOperand (const WQLOperand &x)
 Appends an operand to the operation array.
bool hasWhereClause () const
 Returns true if this class has a where clause.
bool evaluateWhereClause (const WQLPropertySource *source) const
 Evalautes the where clause using the symbol table to resolve symbols.
void print (std::ostream &ostr) const
 Prints out the members of this class.
String toString () const
void compileWhereClause (const WQLPropertySource *source, WQLCompile &wcl)

Private Attributes

String _className
Array< String_selectPropertyNames
Array< String_wherePropertyNames
Array< OperandOrOperation_operStack

Friends

class WQLCompile

Classes

struct  OperandOrOperation

Detailed Description

Definition at line 54 of file OW_WQLSelectStatement.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::WQLSelectStatement::WQLSelectStatement  ) 
 

Definition at line 118 of file OW_WQLSelectStatement.cpp.

References _operStack, and OW_NAMESPACE::Array< T >::reserve().

OW_NAMESPACE::WQLSelectStatement::~WQLSelectStatement  ) 
 

Definition at line 122 of file OW_WQLSelectStatement.cpp.


Member Function Documentation

void OW_NAMESPACE::WQLSelectStatement::appendOperand const WQLOperand x  )  [inline]
 

Appends an operand to the operation array.

This method should only be called by the parser itself.

Definition at line 127 of file OW_WQLSelectStatement.hpp.

Referenced by OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_FALSEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NOT_FALSEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NOT_NULLP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NOT_TRUEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NULLP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_TRUEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_ISNULL(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_NOTNULL(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_BITCONST(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_FALSEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_FCONST(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_HEXCONST(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_ICONST(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_NULLP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_SCONST(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExprConst_TRUEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_attr(), and OW_NAMESPACE::WQLSelectStatementGen::visit_cExpr_strColId_optIndirection().

void OW_NAMESPACE::WQLSelectStatement::appendOperation WQLOperation  x  )  [inline]
 

Appends an operation to the operation array.

This method should only be called by the parser itself.

Definition at line 120 of file OW_WQLSelectStatement.hpp.

Referenced by OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_AND_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_EQUALS_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_GREATERTHAN_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_GREATERTHANOREQUALS_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_FALSEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NOT_FALSEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NOT_NULLP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NOT_TRUEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_NULLP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_IS_TRUEP(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_ISA_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_ISNULL(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_LESSTHAN_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_LESSTHANOREQUALS_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_NOTEQUALS_aExpr(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_NOTNULL(), OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_aExpr_OR_aExpr(), and OW_NAMESPACE::WQLSelectStatementGen::visit_aExpr_NOT_aExpr().

void OW_NAMESPACE::WQLSelectStatement::appendSelectPropertyName const String x  )  [inline]
 

Appends a property name to the property name list.

This user should not call this method; it should only be called by the parser.

Definition at line 95 of file OW_WQLSelectStatement.hpp.

Referenced by OW_NAMESPACE::WQLSelectStatementGen::visit_attr(), OW_NAMESPACE::WQLSelectStatementGen::visit_cExpr_strColId_optIndirection(), OW_NAMESPACE::WQLSelectStatementGen::visit_targetEl_ASTERISK(), and OW_NAMESPACE::WQLSelectStatementGen::visit_targetEl_strRelationName_PERIOD_ASTERISK().

bool OW_NAMESPACE::WQLSelectStatement::appendWherePropertyName const String x  ) 
 

Appends a property name to the where property name list.

This user should not call this method; it should only be called by the parser.

Parameters:
x name of the property.
Returns:
false if a property with that name already exists.

Definition at line 131 of file OW_WQLSelectStatement.cpp.

References _wherePropertyNames, i, and OW_NAMESPACE::Array< T >::size().

Referenced by OW_NAMESPACE::WQLSelectStatementGen::visit_attr(), and OW_NAMESPACE::WQLSelectStatementGen::visit_cExpr_strColId_optIndirection().

void OW_NAMESPACE::WQLSelectStatement::clear  ) 
 

Clears all data members of this object.

Definition at line 125 of file OW_WQLSelectStatement.cpp.

References _className, _operStack, _selectPropertyNames, OW_NAMESPACE::Array< T >::clear(), and OW_NAMESPACE::String::erase().

Referenced by OW_NAMESPACE::WQLSelectStatementGen::visit_selectStmt().

void OW_NAMESPACE::WQLSelectStatement::compileWhereClause const WQLPropertySource source,
WQLCompile wcl
 

Definition at line 353 of file OW_WQLSelectStatement.cpp.

References OW_NAMESPACE::WQLCompile::compile().

bool OW_NAMESPACE::WQLSelectStatement::evaluateWhereClause const WQLPropertySource source  )  const
 

Evalautes the where clause using the symbol table to resolve symbols.

Returns:
true or false if the source passes the query
Exceptions:
NoSuchPropertyException if the where clause references a property that is unknown to source.
TypeMismatchException if the there is a type error in the where clause or if the property type of the source property doesn't match the query.

Definition at line 166 of file OW_WQLSelectStatement.cpp.

References OW_NAMESPACE::_Evaluate(), _operStack, OW_NAMESPACE::_ResolveProperty(), className, OW_NAMESPACE::WQLOperand::getBooleanValue(), OW_NAMESPACE::WQLOperand::getPropertyName(), OW_NAMESPACE::WQLOperand::getType(), hasWhereClause(), i, OW_NAMESPACE::WQLSelectStatement::OperandOrOperation::OPERAND, OW_ASSERT, OW_THROW, OW_NAMESPACE::Stack< T >::pop(), OW_NAMESPACE::WQLOperand::PROPERTY_NAME, OW_NAMESPACE::Stack< T >::push(), OW_NAMESPACE::Stack< T >::size(), OW_NAMESPACE::Array< T >::size(), OW_NAMESPACE::WQLOperand::STRING_VALUE, OW_NAMESPACE::Stack< T >::top(), OW_NAMESPACE::WQL_AND, OW_NAMESPACE::WQL_BOOLEAN_VALUE_TAG, OW_NAMESPACE::WQL_EQ, OW_NAMESPACE::WQL_GE, OW_NAMESPACE::WQL_GT, OW_NAMESPACE::WQL_ISA, OW_NAMESPACE::WQL_LE, OW_NAMESPACE::WQL_LT, OW_NAMESPACE::WQL_NE, OW_NAMESPACE::WQL_NOT, and OW_NAMESPACE::WQL_OR.

const String& OW_NAMESPACE::WQLSelectStatement::getClassName  )  const [inline]
 

Definition at line 62 of file OW_WQLSelectStatement.hpp.

const String& OW_NAMESPACE::WQLSelectStatement::getSelectPropertyName UInt32  i  )  const [inline]
 

Gets the i-th selected property name in the list.

Definition at line 82 of file OW_WQLSelectStatement.hpp.

UInt32 OW_NAMESPACE::WQLSelectStatement::getSelectPropertyNameCount  )  const [inline]
 

Returns the number of property names which were indicated in the selection list.

Definition at line 76 of file OW_WQLSelectStatement.hpp.

const StringArray& OW_NAMESPACE::WQLSelectStatement::getSelectPropertyNames  )  const [inline]
 

Gets the selected property names in the list.

Definition at line 88 of file OW_WQLSelectStatement.hpp.

const String& OW_NAMESPACE::WQLSelectStatement::getWherePropertyName UInt32  i  )  const [inline]
 

Gets the i-th unique property appearing in the where clause.

Definition at line 107 of file OW_WQLSelectStatement.hpp.

UInt32 OW_NAMESPACE::WQLSelectStatement::getWherePropertyNameCount  )  const [inline]
 

Returns the number of unique property names from the where clause.

Definition at line 101 of file OW_WQLSelectStatement.hpp.

bool OW_NAMESPACE::WQLSelectStatement::hasWhereClause  )  const [inline]
 

Returns true if this class has a where clause.

Definition at line 133 of file OW_WQLSelectStatement.hpp.

Referenced by OW_NAMESPACE::WQLCompile::compile(), and evaluateWhereClause().

void OW_NAMESPACE::WQLSelectStatement::print std::ostream &  ostr  )  const
 

Prints out the members of this class.

Definition at line 293 of file OW_WQLSelectStatement.cpp.

References _className, _selectPropertyNames, i, and OW_NAMESPACE::Array< T >::size().

void OW_NAMESPACE::WQLSelectStatement::setClassName const String className  )  [inline]
 

Modifier.

This method should not be called by the user (only by the parser).

Definition at line 69 of file OW_WQLSelectStatement.hpp.

References className.

Referenced by OW_NAMESPACE::WQLSelectStatementGen::visit_relationExpr_strRelationName().

String OW_NAMESPACE::WQLSelectStatement::toString  )  const
 

Definition at line 319 of file OW_WQLSelectStatement.cpp.

References _selectPropertyNames, i, and OW_NAMESPACE::Array< T >::size().


Friends And Related Function Documentation

friend class WQLCompile [friend]
 

Definition at line 236 of file OW_WQLSelectStatement.hpp.


Member Data Documentation

String OW_NAMESPACE::WQLSelectStatement::_className [private]
 

Definition at line 165 of file OW_WQLSelectStatement.hpp.

Referenced by clear(), and print().

Array<OperandOrOperation> OW_NAMESPACE::WQLSelectStatement::_operStack [private]
 

Definition at line 235 of file OW_WQLSelectStatement.hpp.

Referenced by OW_NAMESPACE::WQLCompile::_buildEvalHeap(), clear(), evaluateWhereClause(), and WQLSelectStatement().

Array<String> OW_NAMESPACE::WQLSelectStatement::_selectPropertyNames [private]
 

Definition at line 174 of file OW_WQLSelectStatement.hpp.

Referenced by clear(), print(), and toString().

Array<String> OW_NAMESPACE::WQLSelectStatement::_wherePropertyNames [private]
 

Definition at line 180 of file OW_WQLSelectStatement.hpp.

Referenced by appendWherePropertyName().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:16:57 2006 for openwbem by  doxygen 1.4.6