(file) Return to CQLFactor.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

Diff for /pegasus/src/Pegasus/CQL/CQLFactor.cpp between version 1.1.2.6 and 1.1.2.7

version 1.1.2.6, 2004/09/01 20:07:58 version 1.1.2.7, 2004/09/02 19:57:59
Line 2 
Line 2 
 #include <Pegasus/CQL/CQLExpression.h> #include <Pegasus/CQL/CQLExpression.h>
 #include <Pegasus/CQL/CQLFunction.h> #include <Pegasus/CQL/CQLFunction.h>
 #include <Pegasus/CQL/CQLFactory.h> #include <Pegasus/CQL/CQLFactory.h>
   #include <Pegasus/CQL/CQLFactorRep.h>
   #include <Pegasus/CQL/QueryContext.h>
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 #define PEGASUS_ARRAY_T CQLFactor #define PEGASUS_ARRAY_T CQLFactor
Line 10 
Line 13 
  
 CQLFactor::CQLFactor(const CQLFactor& inCQLFact) CQLFactor::CQLFactor(const CQLFactor& inCQLFact)
 { {
    _CQLVal = inCQLFact._CQLVal;          _rep = inCQLFact._rep;
    _CQLFunct = inCQLFact._CQLFunct;  
    _CQLExp = inCQLFact._CQLExp;  
    _invert = inCQLFact._invert;  
 } }
  
 CQLFactor::CQLFactor(CQLValue inCQLVal)  CQLFactor::CQLFactor(CQLValue& inCQLVal)
 { {
    _CQLVal = inCQLVal;          _rep = new CQLFactorRep(inCQLVal);
 } }
  
 CQLFactor::CQLFactor(CQLExpression& inCQLExp) CQLFactor::CQLFactor(CQLExpression& inCQLExp)
 { {
    _CQLExp = new CQLExpression(inCQLExp);          _rep = new CQLFactorRep(inCQLExp);
 } }
  
 CQLFactor::CQLFactor(CQLFunction inCQLFunc)  CQLFactor::CQLFactor(CQLFunction& inCQLFunc)
 { {
    _CQLFunct = new CQLFunction(inCQLFunc);          _rep = new CQLFactorRep(inCQLFunc);
 } }
  
 CQLValue CQLFactor::getValue() CQLValue CQLFactor::getValue()
 { {
    return _CQLVal;          return _rep->getValue();
 } }
  
 CQLValue CQLFactor::resolveValue(CIMInstance CI, QueryContext& QueryCtx) CQLValue CQLFactor::resolveValue(CIMInstance CI, QueryContext& QueryCtx)
 { {
    if(_CQLExp != NULL)          return _rep->resolveValue(CI, QueryCtx);
    {  
       return _CQLExp->resolveValue(CI,QueryCtx);  
    }  
    else if (_CQLFunct != NULL)  
    {  
       return _CQLFunct->resolveValue(CI,QueryCtx);  
    }  
    else  
    {  
       _CQLVal.resolve(CI,QueryCtx);  
       return _CQLVal;  
    }  
 } }
  
 Boolean CQLFactor::isSimpleValue() Boolean CQLFactor::isSimpleValue()
 { {
    return (_CQLExp == NULL && _CQLFunct == NULL);          return _rep->isSimpleValue();
 } }
  
 CQLFunction CQLFactor::getCQLFunction() CQLFunction CQLFactor::getCQLFunction()
 { {
    return *_CQLFunct;     return _rep->getCQLFunction();
 } }
  
 CQLExpression CQLFactor::getCQLExpression() CQLExpression CQLFactor::getCQLExpression()
 { {
    return *_CQLExp;     return _rep->getCQLExpression();
 } }
  
 String CQLFactor::toString() String CQLFactor::toString()
 { {
    if(_CQLFunct != NULL)          return _rep->toString();
    {  
       return _CQLFunct->toString();  
    }  
    else if(_CQLExp != NULL)  
    {  
       return _CQLExp->toString();  
    }  
    else  
    {  
       return _CQLVal.toString();  
    }  
 } }
  
 void CQLFactor::applyScopes(Array<CQLScope> inScopes) void CQLFactor::applyScopes(Array<CQLScope> inScopes)
 { {
           _rep->applyScopes(inScopes);
    if(_CQLFunct != NULL)  
    {  
       _CQLFunct->applyScopes(inScopes);  
    }    }
    else if(_CQLExp != NULL)  
    {  Boolean CQLFactor::operator==(const CQLFactor& factor){
       _CQLExp->applyScopes(inScopes);          return (_rep == factor._rep);
    }  
    else  
    {  
       _CQLVal.applyScopes(inScopes);  
    }    }
    return;  Boolean CQLFactor::operator!=(const CQLFactor& factor){
           return (!operator==(factor));
 } }
  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2