version 1.8, 2006/01/30 16:16:39
|
version 1.9, 2007/04/18 20:14:35
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Authors: David Rosckes (rosckes@us.ibm.com) |
|
// Bert Rivero (hurivero@us.ibm.com) |
|
// Chuck Carmack (carmack@us.ibm.com) |
|
// Brian Lucier (lucier@us.ibm.com) |
|
// |
|
// Modified By: Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590 |
|
// Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3591 |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/CQL/CQLTerm.h> | #include <Pegasus/CQL/CQLTerm.h> |
|
|
CQLTermRep::~CQLTermRep(){ | CQLTermRep::~CQLTermRep(){ |
} | } |
| |
CQLValue CQLTermRep::resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx) |
CQLValue CQLTermRep::resolveValue(const CIMInstance& CI, |
|
const QueryContext& QueryCtx) |
{ | { |
PEG_METHOD_ENTER(TRC_CQL,"CQLTermRep:resolveValue()"); | PEG_METHOD_ENTER(TRC_CQL,"CQLTermRep:resolveValue()"); |
CQLValue returnVal = _Factors[0].resolveValue(CI,QueryCtx); | CQLValue returnVal = _Factors[0].resolveValue(CI,QueryCtx); |
|
|
for(Uint32 i = 0; i < _FactorOperators.size(); ++i) | for(Uint32 i = 0; i < _FactorOperators.size(); ++i) |
{ | { |
switch(_FactorOperators[i]) | switch(_FactorOperators[i]) |
{/* |
{ |
|
/* |
case mult: | case mult: |
returnVal = returnVal * | returnVal = returnVal * |
_Factors[i+1].resolveValue(CI,QueryCtx); | _Factors[i+1].resolveValue(CI,QueryCtx); |
|
|
break; | break; |
| |
default: | default: |
MessageLoaderParms mload(String("CQL.CQLTermRep.OPERATION_NOT_SUPPORTED"), |
MessageLoaderParms mload( |
|
String("CQL.CQLTermRep.OPERATION_NOT_SUPPORTED"), |
String("Operation is not supported.")); | String("Operation is not supported.")); |
throw CQLRuntimeException(mload); | throw CQLRuntimeException(mload); |
} | } |
|
|
return returnVal; | return returnVal; |
} | } |
| |
void CQLTermRep::appendOperation(FactorOpType inFactorOpType, const CQLFactor& inFactor) |
void CQLTermRep::appendOperation(FactorOpType inFactorOpType, |
|
const CQLFactor& inFactor) |
{ | { |
PEG_METHOD_ENTER(TRC_CQL,"CQLTermRep::appendOperation()"); | PEG_METHOD_ENTER(TRC_CQL,"CQLTermRep::appendOperation()"); |
| |
|
|
{ | { |
/* | /* |
returnStr.append(_FactorOperators[i] == | returnStr.append(_FactorOperators[i] == |
mult ? String(" * ") : divide ? String(" / ") : String(" concat ")); |
mult ? String(" * ") : divide ? String(" / ") |
|
: String(" concat ")); |
*/ | */ |
if(_FactorOperators[i] == concat) | if(_FactorOperators[i] == concat) |
returnStr.append(String(" || ")); | returnStr.append(String(" || ")); |