OWBI1::WQLOperand Class Reference

Used to represent SQL where clause operands. More...

#include <OWBI1_WQLOperand.hpp>

Collaboration diagram for OWBI1::WQLOperand:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Type {
  NULL_VALUE, INTEGER_VALUE, DOUBLE_VALUE, BOOLEAN_VALUE,
  STRING_VALUE, PROPERTY_NAME
}
 Defines allowed types of WQL operands (NULL_VALUE, INTEGER_VALUE, DOUBLE_VALUE, BOOLEAN_VALUE, STRING_VALUE, PROPERTY_NAME). More...

Public Member Functions

 WQLOperand ()
 Desfault constructor.
 WQLOperand (Int64 x, WQLIntegerValueTag)
 Initializes object as INTEGER_VALUE.
 WQLOperand (Real64 x, WQLDoubleValueTag)
 Initializes object as DOUBLE_VALUE.
 WQLOperand (bool x, WQLBoolValueTag)
 Initializes object as BOOLEAN_VALUE.
 WQLOperand (const String &x, WQLStringValueTag)
 Initializes object as STRING_VALUE.
 WQLOperand (const String &x, WQLPropertyNameTag)
 Initializes object as PROPERTY_NAME.
Type getType () const
 Accessor for getting the type of the operand.
void setIntegerValue (Int32 x)
 Sets this object to an INTEGER_VALUE.
void setDoubleValue (Real64 x)
 Sets this object to an DOUBLE_VALUE.
void setBoolValue (bool x)
 Sets this object to a BOOLEAN_VALUE.
void setStringValue (const String &x)
 Sets this object to a STRING_VALUE.
void setPropertyName (const String &x)
 Sets this object to a PROPERTY_NAME.
Int64 getIntegerValue () const
 Gets this object as an INTEGER_VALUE.
Real64 getDoubleValue () const
 Gets this object as an DOUBLE_VALUE.
bool getBooleanValue () const
 Gets this object as an BOOLEAN_VALUE.
const StringgetStringValue () const
 Gets this object as a STRING_VALUE.
const StringgetPropertyName () const
 Gets this object as a PROPERTY_NAME.
String toString () const
 Converts this object to a string for output purposes.

Private Attributes

String _string
Type _type
Int64 _integerValue
Real64 _doubleValue
bool _booleanValue

Detailed Description

Used to represent SQL where clause operands.

Instances of WQLOperand are used to represent the operands of the SQL where clause. Instances of this class are created while parsing a SQL where clause and added to the WQLSelectStatement by calling the WQLSelectStatement::appendOperand() method. Consider the following example:

SELECT ratio, size, name, str
FROM MyClass
WHERE ratio > 1.4 AND size = 3 AND name = "Hello" AND str IS NULL
In this example, the following are operands:
ratio
1.4
size
3
name
"Hello"
str
Operands are of one of the following types:

Definition at line 106 of file OWBI1_WQLOperand.hpp.


Member Enumeration Documentation

enum OWBI1::WQLOperand::Type
 

Defines allowed types of WQL operands (NULL_VALUE, INTEGER_VALUE, DOUBLE_VALUE, BOOLEAN_VALUE, STRING_VALUE, PROPERTY_NAME).

Enumerator:
NULL_VALUE 
INTEGER_VALUE 
DOUBLE_VALUE 
BOOLEAN_VALUE 
STRING_VALUE 
PROPERTY_NAME 

Definition at line 112 of file OWBI1_WQLOperand.hpp.


Constructor & Destructor Documentation

OWBI1::WQLOperand::WQLOperand  )  [inline]
 

Desfault constructor.

Initializes to null value.

Definition at line 123 of file OWBI1_WQLOperand.hpp.

OWBI1::WQLOperand::WQLOperand Int64  x,
WQLIntegerValueTag 
[inline]
 

Initializes object as INTEGER_VALUE.

Definition at line 129 of file OWBI1_WQLOperand.hpp.

OWBI1::WQLOperand::WQLOperand Real64  x,
WQLDoubleValueTag 
[inline]
 

Initializes object as DOUBLE_VALUE.

Definition at line 136 of file OWBI1_WQLOperand.hpp.

OWBI1::WQLOperand::WQLOperand bool  x,
WQLBoolValueTag 
[inline]
 

Initializes object as BOOLEAN_VALUE.

Definition at line 143 of file OWBI1_WQLOperand.hpp.

OWBI1::WQLOperand::WQLOperand const String x,
WQLStringValueTag 
[inline]
 

Initializes object as STRING_VALUE.

Definition at line 150 of file OWBI1_WQLOperand.hpp.

OWBI1::WQLOperand::WQLOperand const String x,
WQLPropertyNameTag 
[inline]
 

Initializes object as PROPERTY_NAME.

Definition at line 157 of file OWBI1_WQLOperand.hpp.


Member Function Documentation

bool OWBI1::WQLOperand::getBooleanValue  )  const [inline]
 

Gets this object as an BOOLEAN_VALUE.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 220 of file OWBI1_WQLOperand.hpp.

References OWBI1_THROW.

Referenced by OWBI1::WQLSelectStatement::evaluateWhereClause().

Real64 OWBI1::WQLOperand::getDoubleValue  )  const [inline]
 

Gets this object as an DOUBLE_VALUE.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 211 of file OWBI1_WQLOperand.hpp.

References OWBI1_THROW.

Int64 OWBI1::WQLOperand::getIntegerValue  )  const [inline]
 

Gets this object as an INTEGER_VALUE.

Definition at line 202 of file OWBI1_WQLOperand.hpp.

References OWBI1_THROW.

const String& OWBI1::WQLOperand::getPropertyName  )  const [inline]
 

Gets this object as a PROPERTY_NAME.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 238 of file OWBI1_WQLOperand.hpp.

References OWBI1_THROW.

Referenced by OWBI1::_ResolveProperty(), OWBI1::WQLCompile::_ResolveProperty(), and OWBI1::WQLSelectStatement::evaluateWhereClause().

const String& OWBI1::WQLOperand::getStringValue  )  const [inline]
 

Gets this object as a STRING_VALUE.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 229 of file OWBI1_WQLOperand.hpp.

References OWBI1_THROW.

Type OWBI1::WQLOperand::getType  )  const [inline]
 

Accessor for getting the type of the operand.

Definition at line 164 of file OWBI1_WQLOperand.hpp.

Referenced by OWBI1::_Evaluate(), OWBI1::_ResolveProperty(), OWBI1::WQLCompile::_ResolveProperty(), OWBI1::WQLSelectStatement::evaluateWhereClause(), and OWBI1::operator==().

void OWBI1::WQLOperand::setBoolValue bool  x  )  [inline]
 

Sets this object to a BOOLEAN_VALUE.

Definition at line 181 of file OWBI1_WQLOperand.hpp.

void OWBI1::WQLOperand::setDoubleValue Real64  x  )  [inline]
 

Sets this object to an DOUBLE_VALUE.

Definition at line 174 of file OWBI1_WQLOperand.hpp.

void OWBI1::WQLOperand::setIntegerValue Int32  x  )  [inline]
 

Sets this object to an INTEGER_VALUE.

Definition at line 167 of file OWBI1_WQLOperand.hpp.

void OWBI1::WQLOperand::setPropertyName const String x  )  [inline]
 

Sets this object to a PROPERTY_NAME.

Definition at line 195 of file OWBI1_WQLOperand.hpp.

void OWBI1::WQLOperand::setStringValue const String x  )  [inline]
 

Sets this object to a STRING_VALUE.

Definition at line 188 of file OWBI1_WQLOperand.hpp.

String OWBI1::WQLOperand::toString  )  const
 

Converts this object to a string for output purposes.

Definition at line 40 of file OWBI1_WQLOperand.cpp.

References _booleanValue, _doubleValue, _integerValue, _string, _type, BOOLEAN_VALUE, DOUBLE_VALUE, INTEGER_VALUE, PROPERTY_NAME, result, and STRING_VALUE.


Member Data Documentation

bool OWBI1::WQLOperand::_booleanValue [private]
 

Definition at line 252 of file OWBI1_WQLOperand.hpp.

Referenced by toString().

Real64 OWBI1::WQLOperand::_doubleValue [private]
 

Definition at line 251 of file OWBI1_WQLOperand.hpp.

Referenced by toString().

Int64 OWBI1::WQLOperand::_integerValue [private]
 

Definition at line 250 of file OWBI1_WQLOperand.hpp.

Referenced by toString().

String OWBI1::WQLOperand::_string [private]
 

Definition at line 254 of file OWBI1_WQLOperand.hpp.

Referenced by toString().

Type OWBI1::WQLOperand::_type [private]
 

Definition at line 255 of file OWBI1_WQLOperand.hpp.

Referenced by toString().


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