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

Diff for /pegasus/src/Pegasus/CQL/CQLValueRep.cpp between version 1.1.2.12 and 1.1.2.13

version 1.1.2.12, 2004/10/15 14:37:02 version 1.1.2.13, 2004/10/15 19:25:46
Line 584 
Line 584 
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
             if(_theValue._U64 == x._theValue._R64)                  Real64 temp;
                   memcpy(&temp, &_theValue._U64, sizeof(temp));
               if(temp == x._theValue._R64)
             {             {
                return true;                return true;
             }             }
Line 600 
Line 602 
          }          }
          else if(x._valueType == Uint64_type)          else if(x._valueType == Uint64_type)
          {          {
             if(_theValue._R64 == x._theValue._U64)                  Real64 temp;
                   memcpy(&temp, &x._theValue._U64, sizeof(temp));
               if(_theValue._R64 == temp)
             {             {
                return true;                return true;
             }             }
Line 667 
Line 671 
       throw(Exception(String("CQLValueRep::operator<=")));       throw(Exception(String("CQLValueRep::operator<=")));
    }    }
  
    if(x._valueType == Null_type ||     if (this->operator<(x) || this->operator==(x))
       _valueType == Null_type)  
    {  
       throw(Exception(String("CQLValueRep::operator<=")));  
    }  
   
    switch(_valueType)  
    {  
       case Boolean_type:  
       {  
          if(x._valueType == Boolean_type)  
          {  
             if(_theValue._B <= x._theValue._B)  
             {  
                return true;  
             }  
          }  
          break;  
       }  
       case Sint64_type:  
          if(x._valueType == Sint64_type)  
          {  
             if(_theValue._S64 <= x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._S64 <= (Sint64)x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._S64 <= x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case Uint64_type:  
          if(x._valueType == Sint64_type)  
          {  
             if((Sint64)_theValue._U64 <= x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._U64 <= x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._U64 <= x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case Real_type:  
          if(x._valueType == Sint64_type)  
          {  
             if(_theValue._R64 <= x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._R64 <= x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._R64 <= x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case String_type:  
          if(*_theValue._S <= *x._theValue._S)  
          {  
             return true;             return true;
          }  
          break;  
       case CIMDateTime_type:  
          throw(Exception(String("CQLValueRep::operator<=")));  
          break;  
       case CIMReference_type:  
          throw(Exception(String("CQLValueRep::operator<=")));  
          break;  
       case CIMInstance_type:  
             throw(Exception(String("CQLValueRep::operator<=")));  
          break;  
       case CQLIdentifier_type:  
             throw(Exception(String("CQLValueRep::operator<=")));  
          break;  
   
       default:  
          throw(Exception(String("CQLValueRep::operator<=")));  
          break;  
    }  
    return false;    return false;
 } }
  
Line 788 
Line 683 
    {    {
       throw(Exception(String("CQLValueRep::operator>=")));       throw(Exception(String("CQLValueRep::operator>=")));
    }    }
      return !(this->operator<(x));
    if(x._valueType == Null_type ||  
       _valueType == Null_type)  
    {  
       throw(Exception(String("CQLValueRep::operator>=")));  
    }  
   
    switch(_valueType)  
    {  
       case Boolean_type:  
       {  
          if(x._valueType == Boolean_type)  
          {  
             if(_theValue._B >= x._theValue._B)  
             {  
                return true;  
             }  
          }  
          break;  
       }  
       case Sint64_type:  
          if(x._valueType == Sint64_type)  
          {  
             if(_theValue._S64 >= x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._S64 >= (Sint64)x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._S64 >= x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case Uint64_type:  
          if(x._valueType == Sint64_type)  
          {  
             if((Sint64)_theValue._U64 >= x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._U64 >= x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._U64 >= x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case Real_type:  
          if(x._valueType == Sint64_type)  
          {  
             if(_theValue._R64 >= x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._R64 >= x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._R64 >= x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case String_type:  
          if(*_theValue._S >= *x._theValue._S)  
          {  
             return true;  
          }  
          break;  
       case CIMDateTime_type:  
          throw(Exception(String("CQLValueRep::operator>=")));  
          break;  
       case CIMReference_type:  
          throw(Exception(String("CQLValueRep::operator>=")));  
          break;  
       case CIMInstance_type:  
             throw(Exception(String("CQLValueRep::operator>=")));  
          break;  
       case CQLIdentifier_type:  
             throw(Exception(String("CQLValueRep::operator>=")));  
          break;  
   
       default:  
          throw(Exception(String("CQLValueRep::operator>=")));  
          break;  
    }  
    return false;  
 } }
  
  
Line 970 
Line 753 
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
             if(_theValue._U64 < x._theValue._R64)                  Real64 temp;
                   memcpy(&temp, &_theValue._U64, sizeof(temp));
               if(temp < x._theValue._R64)
             {             {
                return true;                return true;
             }             }
Line 986 
Line 771 
          }          }
          else if(x._valueType == Uint64_type)          else if(x._valueType == Uint64_type)
          {          {
             if(_theValue._R64 < x._theValue._U64)                  Real64 temp;
                   memcpy(&temp, &x._theValue._U64, sizeof(temp));
               if(_theValue._R64 < temp)
             {             {
                return true;                return true;
             }             }
Line 1032 
Line 819 
    {    {
       throw(Exception(String("CQLValueRep::operator>")));       throw(Exception(String("CQLValueRep::operator>")));
    }    }
      if (this->operator<(x) || this->operator==(x))
    if(x._valueType == Null_type ||  
       _valueType == Null_type)  
    {  
       throw(Exception(String("CQLValueRep::operator>")));  
    }  
   
    switch(_valueType)  
    {  
       case Boolean_type:  
       {  
          if(x._valueType == Boolean_type)  
          {  
             if(_theValue._B > x._theValue._B)  
             {  
                return true;  
             }  
          }  
          break;  
       }  
       case Sint64_type:  
          if(x._valueType == Sint64_type)  
          {  
             if(_theValue._S64 > x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._S64 > (Sint64)x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._S64 > x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case Uint64_type:  
          if(x._valueType == Sint64_type)  
          {  
             if((Sint64)_theValue._U64 > x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._U64 > x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._U64 > x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case Real_type:  
          if(x._valueType == Sint64_type)  
          {  
             if(_theValue._R64 > x._theValue._S64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Uint64_type)  
          {  
             if(_theValue._R64 > x._theValue._U64)  
             {  
                return true;  
             }  
          }  
          else if(x._valueType == Real_type)  
          {  
             if(_theValue._R64 > x._theValue._R64)  
             {  
                return true;  
             }  
          }  
          break;  
       case String_type:  
          if(*_theValue._S > *x._theValue._S)  
          {  
             return true;  
          }  
          break;  
       case CIMDateTime_type:  
          throw(Exception(String("CQLValueRep::operator>")));  
          break;  
       case CIMReference_type:  
          throw(Exception(String("CQLValueRep::operator>")));  
          break;  
       case CIMInstance_type:  
             throw(Exception(String("CQLValueRep::operator>")));  
          break;  
       case CQLIdentifier_type:  
             throw(Exception(String("CQLValueRep::operator>")));  
          break;  
   
       default:  
          throw(Exception(String("CQLValueRep::operator>")));  
          break;  
    }  
    return false;    return false;
      return true;
 } }
  
  
Line 1192 
Line 869 
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
             return CQLValueRep(_theValue._U64 + x._theValue._R64);                  Real64 temp;
                   memcpy(&temp, &_theValue._U64, sizeof(temp));
               return CQLValueRep(temp + x._theValue._R64);
          }          }
          break;          break;
       case Real_type:       case Real_type:
Line 1202 
Line 881 
          }          }
          else if(x._valueType == Uint64_type)          else if(x._valueType == Uint64_type)
          {          {
             return CQLValueRep(_theValue._R64 + x._theValue._U64);                  Real64 temp;
                   memcpy(&temp, &x._theValue._U64, sizeof(temp));
               return CQLValueRep(_theValue._R64 + temp);
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
Line 1277 
Line 958 
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
             return CQLValueRep(_theValue._U64 - x._theValue._R64);                  Real64 temp;
                   memcpy(&temp, &_theValue._U64, sizeof(temp));
               return CQLValueRep(temp - x._theValue._R64);
          }          }
          break;          break;
       case Real_type:       case Real_type:
Line 1287 
Line 970 
          }          }
          else if(x._valueType == Uint64_type)          else if(x._valueType == Uint64_type)
          {          {
             return CQLValueRep(_theValue._R64 - x._theValue._U64);                  Real64 temp;
                   memcpy(&temp, &x._theValue._U64, sizeof(temp));
               return CQLValueRep(_theValue._R64 - temp);
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
Line 1363 
Line 1048 
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
             return CQLValueRep(_theValue._U64 * x._theValue._R64);                  Real64 temp;
                   memcpy(&temp, &_theValue._U64, sizeof(temp));
               return CQLValueRep(temp * x._theValue._R64);
          }          }
          break;          break;
       case Real_type:       case Real_type:
Line 1373 
Line 1060 
          }          }
          else if(x._valueType == Uint64_type)          else if(x._valueType == Uint64_type)
          {          {
             return CQLValueRep(_theValue._R64 * x._theValue._U64);                  Real64 temp;
                   memcpy(&temp, &x._theValue._U64, sizeof(temp));
               return CQLValueRep(_theValue._R64 * temp);
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
Line 1449 
Line 1138 
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
             return CQLValueRep(_theValue._U64 / x._theValue._R64);                  Real64 temp;
                   memcpy(&temp, &_theValue._U64, sizeof(temp));
               return CQLValueRep(temp / x._theValue._R64);
          }          }
          break;          break;
       case Real_type:       case Real_type:
Line 1459 
Line 1150 
          }          }
          else if(x._valueType == Uint64_type)          else if(x._valueType == Uint64_type)
          {          {
             return CQLValueRep(_theValue._R64 / x._theValue._U64);                  Real64 temp;
                   memcpy(&temp, &x._theValue._U64, sizeof(temp));
               return CQLValueRep(_theValue._R64 / temp);
          }          }
          else if(x._valueType == Real_type)          else if(x._valueType == Real_type)
          {          {
Line 2080 
Line 1773 
  
 void CQLValueRep::applyContext(QueryContext& _ctx, void CQLValueRep::applyContext(QueryContext& _ctx,
                               CQLChainedIdentifier& inCid)                               CQLChainedIdentifier& inCid)
 {cout << "CQLValueRep::applyContext 0" << endl;  {
      printf("CQLValueRep::applyContext 0\n");
    if(inCid.size() != 0 && _CQLChainId.size() == 1)    if(inCid.size() != 0 && _CQLChainId.size() == 1)
    {    {
  


Legend:
Removed from v.1.1.2.12  
changed lines
  Added in v.1.1.2.13

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2