OW_NAMESPACE::WQLOperand Class Reference

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

#include <OW_WQLOperand.hpp>

Collaboration diagram for OW_NAMESPACE::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 OW_WQLOperand.hpp.


Member Enumeration Documentation

enum OW_NAMESPACE::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 OW_WQLOperand.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::WQLOperand::WQLOperand  )  [inline]
 

Desfault constructor.

Initializes to null value.

Definition at line 123 of file OW_WQLOperand.hpp.

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

Initializes object as INTEGER_VALUE.

Definition at line 129 of file OW_WQLOperand.hpp.

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

Initializes object as DOUBLE_VALUE.

Definition at line 136 of file OW_WQLOperand.hpp.

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

Initializes object as BOOLEAN_VALUE.

Definition at line 143 of file OW_WQLOperand.hpp.

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

Initializes object as STRING_VALUE.

Definition at line 150 of file OW_WQLOperand.hpp.

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

Initializes object as PROPERTY_NAME.

Definition at line 157 of file OW_WQLOperand.hpp.


Member Function Documentation

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

Gets this object as an BOOLEAN_VALUE.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 220 of file OW_WQLOperand.hpp.

References OW_THROW.

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

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

Gets this object as an DOUBLE_VALUE.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 211 of file OW_WQLOperand.hpp.

References OW_THROW.

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

Gets this object as an INTEGER_VALUE.

Definition at line 202 of file OW_WQLOperand.hpp.

References OW_THROW.

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

Gets this object as a PROPERTY_NAME.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 238 of file OW_WQLOperand.hpp.

References OW_THROW.

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

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

Gets this object as a STRING_VALUE.

Exceptions:
TypeMismatchException is not the expected type.

Definition at line 229 of file OW_WQLOperand.hpp.

References OW_THROW.

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

Accessor for getting the type of the operand.

Definition at line 164 of file OW_WQLOperand.hpp.

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

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

Sets this object to a BOOLEAN_VALUE.

Definition at line 181 of file OW_WQLOperand.hpp.

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

Sets this object to an DOUBLE_VALUE.

Definition at line 174 of file OW_WQLOperand.hpp.

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

Sets this object to an INTEGER_VALUE.

Definition at line 167 of file OW_WQLOperand.hpp.

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

Sets this object to a PROPERTY_NAME.

Definition at line 195 of file OW_WQLOperand.hpp.

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

Sets this object to a STRING_VALUE.

Definition at line 188 of file OW_WQLOperand.hpp.

String OW_NAMESPACE::WQLOperand::toString  )  const
 

Converts this object to a string for output purposes.

Definition at line 39 of file OW_WQLOperand.cpp.

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


Member Data Documentation

bool OW_NAMESPACE::WQLOperand::_booleanValue [private]
 

Definition at line 252 of file OW_WQLOperand.hpp.

Referenced by toString().

Real64 OW_NAMESPACE::WQLOperand::_doubleValue [private]
 

Definition at line 251 of file OW_WQLOperand.hpp.

Referenced by toString().

Int64 OW_NAMESPACE::WQLOperand::_integerValue [private]
 

Definition at line 250 of file OW_WQLOperand.hpp.

Referenced by toString().

String OW_NAMESPACE::WQLOperand::_string [private]
 

Definition at line 254 of file OW_WQLOperand.hpp.

Referenced by toString().

Type OW_NAMESPACE::WQLOperand::_type [private]
 

Definition at line 255 of file OW_WQLOperand.hpp.

Referenced by toString().


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