version 1.3.2.11, 2004/10/20 14:55:25
|
version 1.3.2.12, 2004/11/17 16:19:54
|
|
|
#include <Pegasus/CQL/CQLValue.h> | #include <Pegasus/CQL/CQLValue.h> |
#include <Pegasus/CQL/CQLScope.h> | #include <Pegasus/CQL/CQLScope.h> |
#include <Pegasus/CQL/QueryContext.h> | #include <Pegasus/CQL/QueryContext.h> |
|
#include <Pegasus/Common/Tracer.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
/* |
|
#define PEGASUS_ARRAY_T CQLFactorRep |
|
#include <Pegasus/Common/ArrayImpl.h> |
|
#undef PEGASUS_ARRAY_T |
|
*/ |
|
CQLFactorRep::CQLFactorRep(const CQLFactorRep* rep) | CQLFactorRep::CQLFactorRep(const CQLFactorRep* rep) |
{ | { |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::CQLFactorRep()"); |
|
|
_CQLVal = rep->_CQLVal; | _CQLVal = rep->_CQLVal; |
_CQLFunct = rep->_CQLFunct; | _CQLFunct = rep->_CQLFunct; |
_CQLExp = rep->_CQLExp; | _CQLExp = rep->_CQLExp; |
_invert = rep->_invert; | _invert = rep->_invert; |
_simpleValue = rep->_simpleValue; | _simpleValue = rep->_simpleValue; |
_containedType = rep->_containedType; | _containedType = rep->_containedType; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
CQLFactorRep::CQLFactorRep(const CQLValue& inCQLVal) | CQLFactorRep::CQLFactorRep(const CQLValue& inCQLVal) |
{ | { |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::CQLFactorRep()"); |
|
|
_CQLVal = inCQLVal; | _CQLVal = inCQLVal; |
_simpleValue = true; | _simpleValue = true; |
_containedType = VALUE; | _containedType = VALUE; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
CQLFactorRep::CQLFactorRep(const CQLExpression& inCQLExp) | CQLFactorRep::CQLFactorRep(const CQLExpression& inCQLExp) |
{ | { |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::CQLFactorRep()"); |
|
|
_CQLExp = inCQLExp; | _CQLExp = inCQLExp; |
_simpleValue = false; | _simpleValue = false; |
_containedType = EXPRESSION; | _containedType = EXPRESSION; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
CQLFactorRep::CQLFactorRep(const CQLFunction& inCQLFunc) | CQLFactorRep::CQLFactorRep(const CQLFunction& inCQLFunc) |
{ | { |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::CQLFactorRep()"); |
|
|
_CQLFunct = inCQLFunc; | _CQLFunct = inCQLFunc; |
_simpleValue = false; | _simpleValue = false; |
_containedType = FUNCTION; | _containedType = FUNCTION; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
CQLValue CQLFactorRep::getValue()const | CQLValue CQLFactorRep::getValue()const |
|
|
| |
CQLValue CQLFactorRep::resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx) | CQLValue CQLFactorRep::resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx) |
{ | { |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::resolveValue()"); |
| |
if(_containedType == EXPRESSION) | if(_containedType == EXPRESSION) |
{ | { |
|
PEG_METHOD_EXIT(); |
return _CQLExp.resolveValue(CI,QueryCtx); | return _CQLExp.resolveValue(CI,QueryCtx); |
} | } |
else if (_containedType == FUNCTION) | else if (_containedType == FUNCTION) |
{ | { |
|
PEG_METHOD_EXIT(); |
return _CQLFunct.resolveValue(CI,QueryCtx); | return _CQLFunct.resolveValue(CI,QueryCtx); |
} | } |
else | else |
{ | { |
_CQLVal.resolve(CI,QueryCtx); | _CQLVal.resolve(CI,QueryCtx); |
|
PEG_METHOD_EXIT(); |
return _CQLVal; | return _CQLVal; |
} | } |
} | } |
|
|
| |
String CQLFactorRep::toString()const | String CQLFactorRep::toString()const |
{ | { |
if(_containedType == VALUE){ |
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::toString()"); |
|
|
|
if(_containedType == VALUE) |
|
{ |
|
PEG_METHOD_EXIT(); |
return _CQLVal.toString(); | return _CQLVal.toString(); |
} | } |
| |
if(_containedType == FUNCTION) | if(_containedType == FUNCTION) |
{ | { |
|
PEG_METHOD_EXIT(); |
return _CQLFunct.toString(); | return _CQLFunct.toString(); |
}else |
} |
|
else |
{ | { |
|
PEG_METHOD_EXIT(); |
return _CQLExp.toString(); | return _CQLExp.toString(); |
} | } |
} | } |
|
|
void CQLFactorRep::applyContext(QueryContext& inContext, | void CQLFactorRep::applyContext(QueryContext& inContext, |
CQLChainedIdentifier& inCid) | CQLChainedIdentifier& inCid) |
{ | { |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::applyContext()"); |
| |
if(_containedType == FUNCTION) | if(_containedType == FUNCTION) |
{ | { |
|
|
{ | { |
_CQLVal.applyContext(inContext,inCid); | _CQLVal.applyContext(inContext,inCid); |
} | } |
|
|
|
PEG_METHOD_EXIT(); |
return; | return; |
} | } |
| |
Boolean CQLFactorRep::operator==(const CQLFactorRep& rep)const{ |
Boolean CQLFactorRep::operator==(const CQLFactorRep& rep)const |
|
{ |
|
PEG_METHOD_ENTER(TRC_CQL,"CQLFactorRep::operator==()"); |
|
|
|
if(_CQLExp != rep._CQLExp) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
if(CQLValue(_CQLVal) != rep._CQLVal) // Why? |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
if(_CQLFunct != rep._CQLFunct) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
if(_invert != rep._invert) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
if(_simpleValue != rep._simpleValue) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
if(_containedType != rep._containedType) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
|
|
PEG_METHOD_EXIT(); |
return true; | return true; |
} | } |
Boolean CQLFactorRep::operator!=(const CQLFactorRep& rep)const{ |
|
|
Boolean CQLFactorRep::operator!=(const CQLFactorRep& rep)const |
|
{ |
return (!operator==(rep)); | return (!operator==(rep)); |
} | } |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |