(file) Return to CMPI_Wql2Dnf.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / CMPI

Diff for /pegasus/src/Pegasus/ProviderManager2/CMPI/CMPI_Wql2Dnf.cpp between version 1.16 and 1.17

version 1.16, 2006/06/21 21:55:43 version 1.17, 2007/07/25 07:16:01
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author:      Markus Mueller (sedgewick_de@yahoo.de)  
 //  
 // Modified By: Adrian Schuur, schuur@de.ibm.com  
 //                              Konrad Rzeszutek, konradr@us.ibm.com  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
  
Line 55 
Line 50 
 { {
     switch (op)     switch (op)
     {     {
         case WQL_EQ: op = WQL_NE; break;          case WQL_EQ: op = WQL_NE;
         case WQL_NE: op = WQL_EQ; break;              break;
         case WQL_LT: op = WQL_GE; break;          case WQL_NE: op = WQL_EQ;
         case WQL_LE: op = WQL_GT; break;              break;
         case WQL_GT: op = WQL_LE; break;          case WQL_LT: op = WQL_GE;
         case WQL_GE: op = WQL_LT; break;              break;
         default: break;          case WQL_LE: op = WQL_GT;
               break;
           case WQL_GT: op = WQL_LE;
               break;
           case WQL_GE: op = WQL_LT;
               break;
           default:
               break;
     }     }
 }; };
  
 /* /*
 String opnd2string(const WQLOperand &o) {  String opnd2string(const WQLOperand &o)
   {
     switch (o.getType()) {     switch (o.getType()) {
     case WQLOperand::PROPERTY_NAME:     case WQLOperand::PROPERTY_NAME:
        return o.getPropertyName();        return o.getPropertyName();
Line 84 
Line 87 
 } }
  
  
 CMPIPredOp mapOperation(WQLOperation op) {  CMPIPredOp mapOperation(WQLOperation op)
   {
    static CMPIPredOp ops[]={(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,    static CMPIPredOp ops[]={(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,
       CMPI_PredOp_Equals,       CMPI_PredOp_Equals,
       CMPI_PredOp_NotEquals,       CMPI_PredOp_NotEquals,
Line 92 
Line 96 
       CMPI_PredOp_LessThanOrEquals,       CMPI_PredOp_LessThanOrEquals,
       CMPI_PredOp_GreaterThan,       CMPI_PredOp_GreaterThan,
       CMPI_PredOp_GreaterThanOrEquals,       CMPI_PredOp_GreaterThanOrEquals,
       (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0};        (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,
         (CMPIPredOp)0,(CMPIPredOp)0};
    return ops[(int)op];    return ops[(int)op];
 } }
  
 CMPIType mapType(WQLOperand::Type typ) {  CMPIType mapType(WQLOperand::Type typ)
   {
    switch (typ) {    switch (typ) {
     case WQLOperand::PROPERTY_NAME:     case WQLOperand::PROPERTY_NAME:
        return CMPI_nameString;        return CMPI_nameString;
Line 114 
Line 120 
   return CMPI_null;   return CMPI_null;
 } }
  
 int term_el::toStrings(CMPIType &typ, CMPIPredOp &opr, String &o1, String &o2) const {  int term_el::toStrings(
                          CMPIType &typ,
                          CMPIPredOp &opr,
                          String &o1,
                          String &o2 ) const
   {
    opr=mapOperation(op);    opr=mapOperation(op);
    o1=opnd2string(opn1);    o1=opnd2string(opn1);
    o2=opnd2string(opn2);    o2=opnd2string(opn2);
Line 124 
Line 135 
 } }
 */ */
  
 CMPIPredOp mapOperation(WQLOperation op) {  CMPIPredOp mapOperation(WQLOperation op)
   {
    static CMPIPredOp ops[]={(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,    static CMPIPredOp ops[]={(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,
       CMPI_PredOp_Equals,       CMPI_PredOp_Equals,
       CMPI_PredOp_NotEquals,       CMPI_PredOp_NotEquals,
Line 132 
Line 144 
       CMPI_PredOp_LessThanOrEquals,       CMPI_PredOp_LessThanOrEquals,
       CMPI_PredOp_GreaterThan,       CMPI_PredOp_GreaterThan,
       CMPI_PredOp_GreaterThanOrEquals,       CMPI_PredOp_GreaterThanOrEquals,
       (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0};          (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,
           (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0};
    return ops[(int)op];    return ops[(int)op];
 } }
  
 CMPIType mapType(WQLOperand::Type typ) {  CMPIType mapType(WQLOperand::Type typ)
    switch (typ) {  {
       switch( typ )
       {
     case WQLOperand::PROPERTY_NAME:     case WQLOperand::PROPERTY_NAME:
        return CMPI_nameString;        return CMPI_nameString;
     case WQLOperand::STRING_VALUE:     case WQLOperand::STRING_VALUE:
Line 189 
Line 204 
  
 static bool operator==(const WQLOperand& x, const WQLOperand& y) static bool operator==(const WQLOperand& x, const WQLOperand& y)
 { {
    if (x.getType()==y.getType()) switch (x.getType()) {      if( x.getType()==y.getType() )
       {
           switch( x.getType() )
           {
    case WQLOperand::PROPERTY_NAME:    case WQLOperand::PROPERTY_NAME:
       return x.getPropertyName()==y.getPropertyName();       return x.getPropertyName()==y.getPropertyName();
    case WQLOperand::INTEGER_VALUE:    case WQLOperand::INTEGER_VALUE:
Line 203 
Line 221 
    case WQLOperand::NULL_VALUE:    case WQLOperand::NULL_VALUE:
       return true;       return true;
    }    }
       }
    return false;    return false;
 } }
  
Line 215 
Line 234 
  
 static void addIfNotExists(TableauRow_WQL &tr, const term_el_WQL& el) static void addIfNotExists(TableauRow_WQL &tr, const term_el_WQL& el)
 { {
    for (int i=0,m=tr.size(); i<m; i++) {      for( int i=0,m=tr.size(); i<m; i++ )
       if (tr[i]==el) return;      {
           if( tr[i]==el )
           {
               return;
           }
    }    }
    tr.append(el);    tr.append(el);
 } }
Line 318 
Line 341 
     compile(wqs);     compile(wqs);
 } }
  
 CMPI_Wql2Dnf::~CMPI_Wql2Dnf() {}  CMPI_Wql2Dnf::~CMPI_Wql2Dnf()
   {
   }
  
 void CMPI_Wql2Dnf::compile(const WQLSelectStatement * wqs) void CMPI_Wql2Dnf::compile(const WQLSelectStatement * wqs)
 { {
     if (!wqs->hasWhereClause()) return;      if( !wqs->hasWhereClause() )
       {
           return;
       }
     _tableau.clear();     _tableau.clear();
  
     _buildEvalHeap(wqs);     _buildEvalHeap(wqs);
Line 332 
Line 360 
     Array<CMPI_stack_el> disj;     Array<CMPI_stack_el> disj;
     _gatherDisj(disj);     _gatherDisj(disj);
     if (disj.size() == 0)     if (disj.size() == 0)
       {
         if (terminal_heap.size() > 0)         if (terminal_heap.size() > 0)
           {
            // point to the remaining terminal element            // point to the remaining terminal element
             disj.append(CMPI_stack_el(0,true));             disj.append(CMPI_stack_el(0,true));
           }
       }
  
     for (Uint32 i=0, n =disj.size(); i< n; i++)     for (Uint32 i=0, n =disj.size(); i< n; i++)
     {     {
Line 345 
Line 377 
         {         {
            _gatherConj(conj, disj[i]);            _gatherConj(conj, disj[i]);
             for( Uint32 j=0, m = conj.size(); j < m; j++)             for( Uint32 j=0, m = conj.size(); j < m; j++)
               {
                 addIfNotExists(tr,terminal_heap[conj[j].opn]);                 addIfNotExists(tr,terminal_heap[conj[j].opn]);
 //                tr.append(terminal_heap[conj[j].opn]); //                tr.append(terminal_heap[conj[j].opn]);
         }         }
           }
         else         else
           {
            addIfNotExists(tr,terminal_heap[disj[i].opn]);            addIfNotExists(tr,terminal_heap[disj[i].opn]);
 //         tr.append(terminal_heap[disj[i].opn]); //         tr.append(terminal_heap[disj[i].opn]);
           }
         _tableau.append(tr);         _tableau.append(tr);
     }     }
  
Line 378 
Line 414 
            CMPI_Wql2Dnf::_ResolveProperty(rhs,source);            CMPI_Wql2Dnf::_ResolveProperty(rhs,source);
  
            if (rhs.getType() != lhs.getType())            if (rhs.getType() != lhs.getType())
               {
                throw TypeMismatchException();                throw TypeMismatchException();
               }
  
            if (!_Evaluate(lhs, rhs, tr[j].op))            if (!_Evaluate(lhs, rhs, tr[j].op))
            {            {
Line 386 
Line 424 
                break;                break;
            }            }
            else            else
               {
                b = true;                b = true;
        }        }
        if (b) return true;          }
           if( b )
           {
               return true;
           }
    }    }
    return false;    return false;
 } }
  
 void CMPI_Wql2Dnf::print(void) void CMPI_Wql2Dnf::print(void)
 { {
 for (Uint32 i=0, n=eval_heap.size();i < n;i++) {      for( Uint32 i=0, n=eval_heap.size();i < n;i++ )
       {
     WQLOperation wop = eval_heap[i].op;     WQLOperation wop = eval_heap[i].op;
     if (wop == WQL_IS_TRUE) continue;          if( wop == WQL_IS_TRUE )
           {
               continue;
           }
     cout << "Eval element " << i << ": ";     cout << "Eval element " << i << ": ";
     if (eval_heap[i].is_terminal1) cout << "T(";          if( eval_heap[i].is_terminal1 )
     else cout << "E(";          {
               cout << "T(";
           }
           else
           {
               cout << "E(";
           }
     cout << eval_heap[i].opn1 << ") ";     cout << eval_heap[i].opn1 << ") ";
     cout << WQLOperationToString(eval_heap[i].op);     cout << WQLOperationToString(eval_heap[i].op);
     if (eval_heap[i].is_terminal2) cout << " T(";          if( eval_heap[i].is_terminal2 )
     else cout << " E(";          {
               cout << " T(";
           }
           else
           {
               cout << " E(";
           }
     cout << eval_heap[i].opn2 << ")" << endl;     cout << eval_heap[i].opn2 << ")" << endl;
 } }
 for (Uint32 i=0, n=terminal_heap.size();i < n;i++) {  
       for( Uint32 i=0, n=terminal_heap.size();i < n;i++ )
       {
     cout << "Terminal expression " << i << ": ";     cout << "Terminal expression " << i << ": ";
     cout << terminal_heap[i].opn1.toString() << " ";     cout << terminal_heap[i].opn1.toString() << " ";
     cout << WQLOperationToString(terminal_heap[i].op) << " "     cout << WQLOperationToString(terminal_heap[i].op) << " "
Line 427 
Line 488 
            cout << WQLOperationToString(tr[j].op) << " "            cout << WQLOperationToString(tr[j].op) << " "
                 << tr[j].opn2.toString() << endl;                 << tr[j].opn2.toString() << endl;
        }        }
   
    }    }
  
 } }
  
 String  String WQL2String(const WQLOperand &o)
 WQL2String(const WQLOperand &o) {  {
     switch (o.getType()) {      switch( o.getType() )
       {
     case WQLOperand::PROPERTY_NAME:     case WQLOperand::PROPERTY_NAME:
        return o.getPropertyName();        return o.getPropertyName();
     case WQLOperand::STRING_VALUE:     case WQLOperand::STRING_VALUE:
Line 450 
Line 511 
    return "NULL_VALUE";    return "NULL_VALUE";
 } }
  
 CMPIPredOp  CMPIPredOp WQL2PredOp(const WQLOperation &op)
 WQL2PredOp(const WQLOperation &op) {  {
  
    static CMPIPredOp ops[]={(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,    static CMPIPredOp ops[]={(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,
       CMPI_PredOp_Equals,       CMPI_PredOp_Equals,
Line 460 
Line 521 
       CMPI_PredOp_LessThanOrEquals,       CMPI_PredOp_LessThanOrEquals,
       CMPI_PredOp_GreaterThan,       CMPI_PredOp_GreaterThan,
       CMPI_PredOp_GreaterThanOrEquals,       CMPI_PredOp_GreaterThanOrEquals,
       (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0};          (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0,
           (CMPIPredOp)0,(CMPIPredOp)0,(CMPIPredOp)0};
  
    return ops[(int)op];    return ops[(int)op];
 } }
  
 CMPI_QueryOperand::Type  CMPI_QueryOperand::Type WQL2Type(WQLOperand::Type typ)
 WQL2Type(WQLOperand::Type typ) {  {
    switch (typ) {      switch( typ )
       {
     case WQLOperand::PROPERTY_NAME:     case WQLOperand::PROPERTY_NAME:
        return CMPI_QueryOperand::PROPERTY_TYPE;        return CMPI_QueryOperand::PROPERTY_TYPE;
     case WQLOperand::STRING_VALUE:     case WQLOperand::STRING_VALUE:
Line 496 
Line 559 
                    term_el_WQL t = tr_wql[j];                    term_el_WQL t = tr_wql[j];
  
                    CMPI_TableauRow tr;                    CMPI_TableauRow tr;
                 CMPI_QueryOperand lhs(WQL2String(t.opn1), WQL2Type(t.opn1.getType()));              CMPI_QueryOperand lhs(WQL2String(t.opn1),
                 CMPI_QueryOperand rhs(WQL2String(t.opn2), WQL2Type(t.opn2.getType()));              WQL2Type(t.opn1.getType()));
               CMPI_QueryOperand rhs(WQL2String(t.opn2),
               WQL2Type(t.opn2.getType()));
  
                 tr.append(CMPI_term_el(t.mark, WQL2PredOp(t.op), lhs, rhs));                 tr.append(CMPI_term_el(t.mark, WQL2PredOp(t.op), lhs, rhs));
                 _CMPI_tableau.append (tr);                 _CMPI_tableau.append (tr);
Line 540 
Line 605 
                 CMPI_stack_el op2 = stack.top();                 CMPI_stack_el op2 = stack.top();
  
                 // generate Eval expression                 // generate Eval expression
                 eval_heap.append(CMPI_eval_el(0, op , op1.opn, op1.is_terminal,                      eval_heap.append(CMPI_eval_el(
                                  op2.opn , op2.is_terminal));                                           0, op , op1.opn,
                                            op1.is_terminal,op2.opn ,
                                            op2.is_terminal));
  
                 stack.top() = CMPI_stack_el(eval_heap.size()-1, false);                 stack.top() = CMPI_stack_el(eval_heap.size()-1, false);
  
Line 557 
Line 624 
                 CMPI_stack_el op1 = stack.top();                 CMPI_stack_el op1 = stack.top();
  
                 // generate Eval expression                 // generate Eval expression
                 eval_heap.append(CMPI_eval_el(0, op , op1.opn, op1.is_terminal,                      eval_heap.append(CMPI_eval_el(
                                  -1, true));                                           0, op , op1.opn,
                                            op1.is_terminal,-1, true));
  
                 stack.top() = CMPI_stack_el(eval_heap.size()-1, false);                 stack.top() = CMPI_stack_el(eval_heap.size()-1, false);
  
Line 648 
Line 716 
             {             {
                // Test first operand                // Test first operand
                if ((!eval_heap[j].is_terminal1) && (eval_heap[j].opn1 == i))                if ((!eval_heap[j].is_terminal1) && (eval_heap[j].opn1 == i))
                   {
  
                    eval_heap[j].assign_unary_to_first(eval_heap[i]);                    eval_heap[j].assign_unary_to_first(eval_heap[i]);
                   }
  
                // Test second operand                // Test second operand
                if ((!eval_heap[j].is_terminal2) && (eval_heap[j].opn2 == i))                if ((!eval_heap[j].is_terminal2) && (eval_heap[j].opn2 == i))
                   {
  
                    eval_heap[j].assign_unary_to_second(eval_heap[i]);                    eval_heap[j].assign_unary_to_second(eval_heap[i]);
             }             }
               }
  
             // Test: Double NOT created by moving down             // Test: Double NOT created by moving down
  
             if (eval_heap[i].mark)             if (eval_heap[i].mark)
               {
                eval_heap[i].mark = false;                eval_heap[i].mark = false;
               }
             else             else
               {
                _found = true;                _found = true;
               }
             // else indicate a pending NOT to be pushed down further             // else indicate a pending NOT to be pushed down further
         }         }
  
Line 674 
Line 750 
             // further and switch operators (AND / OR)             // further and switch operators (AND / OR)
  
             eval_heap[i].mark=false;             eval_heap[i].mark=false;
             if (eval_heap[i].op == WQL_OR) eval_heap[i].op = WQL_AND;              if( eval_heap[i].op == WQL_OR )
             else if (eval_heap[i].op == WQL_AND) eval_heap[i].op = WQL_OR;              {
                   eval_heap[i].op = WQL_AND;
               }
               else
               {
                   if( eval_heap[i].op == WQL_AND )
                   {
                       eval_heap[i].op = WQL_OR;
                   }
               }
  
             // NOT operator is already ruled out             // NOT operator is already ruled out
             _found = true;             _found = true;
Line 688 
Line 773 
  
              int j = eval_heap[i].opn1;              int j = eval_heap[i].opn1;
              if (eval_heap[i].is_terminal1)              if (eval_heap[i].is_terminal1)
               {
                  // Flip NOT mark                  // Flip NOT mark
                  terminal_heap[j].negate();                  terminal_heap[j].negate();
               }
              else              else
               {
                  eval_heap[j].mark = !(eval_heap[j].mark);                  eval_heap[j].mark = !(eval_heap[j].mark);
               }
  
              //Second operand (if it exists)              //Second operand (if it exists)
  
              if ((j = eval_heap[i].opn2) >= 0)              if ((j = eval_heap[i].opn2) >= 0)
              {              {
                  if (eval_heap[i].is_terminal2)                  if (eval_heap[i].is_terminal2)
                   {
                      // Flip NOT mark                      // Flip NOT mark
                      terminal_heap[j].negate();                      terminal_heap[j].negate();
                   }
                  else                  else
                   {
                      eval_heap[j].mark = !(eval_heap[j].mark);                      eval_heap[j].mark = !(eval_heap[j].mark);
              }              }
         }         }
     }     }
 } }
   }
  
 void CMPI_Wql2Dnf::_factoring(void) void CMPI_Wql2Dnf::_factoring(void)
 { {
Line 722 
Line 815 
             if (!eval_heap[i].is_terminal1)             if (!eval_heap[i].is_terminal1)
             {             {
                 index = eval_heap[i].opn1; // remember the index                 index = eval_heap[i].opn1; // remember the index
                 if (eval_heap[index].op == WQL_OR) _found = 1;                  if( eval_heap[index].op == WQL_OR )
                   {
                       _found = 1;
             }             }
  
             if ((_found == 0) && (!eval_heap[i].is_terminal2))             if ((_found == 0) && (!eval_heap[i].is_terminal2))
             {             {
                 index = eval_heap[i].opn2; // remember the index                 index = eval_heap[i].opn2; // remember the index
                 if (eval_heap[index].op == WQL_OR) _found = 2;                      if( eval_heap[index].op == WQL_OR )
                       {
                           _found = 2;
                       }
             }             }
  
             if (_found != 0)             if (_found != 0)
Line 737 
Line 835 
                  CMPI_stack_el s;                  CMPI_stack_el s;
  
                  if (_found == 1)                  if (_found == 1)
                       {
                      s = eval_heap[i].getSecond();                      s = eval_heap[i].getSecond();
                       }
                  else                  else
                       {
                      s = eval_heap[i].getFirst();                      s = eval_heap[i].getFirst();
                       }
  
                  // insert two new expression before entry i                  // insert two new expression before entry i
                  CMPI_eval_el evl;                  CMPI_eval_el evl;
  
                  evl = CMPI_eval_el(false, WQL_OR, i+1, false, i, false);                  evl = CMPI_eval_el(false, WQL_OR, i+1, false, i, false);
                  if ((Uint32 )i < eval_heap.size()-1)                  if ((Uint32 )i < eval_heap.size()-1)
                       {
                      eval_heap.insert(i+1, evl);                      eval_heap.insert(i+1, evl);
                       }
                  else                  else
                       {
                      eval_heap.append(evl);                      eval_heap.append(evl);
                       }
                  eval_heap.insert(i+1, evl);                  eval_heap.insert(i+1, evl);
  
                  for (int j=eval_heap.size()-1; j > i + 2; j--)                  for (int j=eval_heap.size()-1; j > i + 2; j--)
Line 759 
Line 865 
  
                      if ((!eval_heap[j].is_terminal1)&&                      if ((!eval_heap[j].is_terminal1)&&
                          (eval_heap[j].opn1 >= i))                          (eval_heap[j].opn1 >= i))
                           {
                          eval_heap[j].opn1 += 2;                          eval_heap[j].opn1 += 2;
                           }
   
                      if ((!eval_heap[j].is_terminal2)&&                      if ((!eval_heap[j].is_terminal2)&&
                          (eval_heap[j].opn2 >= i))                          (eval_heap[j].opn2 >= i))
                           {
                          eval_heap[j].opn2 += 2;                          eval_heap[j].opn2 += 2;
                  }                  }
                       }
  
                  n+=2; // increase size of array                  n+=2; // increase size of array
  
Line 796 
Line 907 
         i++; // increase pointer         i++; // increase pointer
     }     }
 } }
   }
 void CMPI_Wql2Dnf::_gatherDisj(Array<CMPI_stack_el>& stk) void CMPI_Wql2Dnf::_gatherDisj(Array<CMPI_stack_el>& stk)
 { {
     _gather(stk, CMPI_stack_el(0,true), true);     _gather(stk, CMPI_stack_el(0,true), true);
 } }
  
 void CMPI_Wql2Dnf::_gatherConj(Array<CMPI_stack_el>& stk, CMPI_stack_el sel)      void CMPI_Wql2Dnf::_gatherConj(
           Array<CMPI_stack_el>& stk,
           CMPI_stack_el sel)
 { {
     _gather(stk, sel, false);     _gather(stk, sel, false);
 } }
  
 void CMPI_Wql2Dnf::_gather(Array<CMPI_stack_el>& stk, CMPI_stack_el sel, Boolean or_flag)      void CMPI_Wql2Dnf::_gather(
           Array<CMPI_stack_el>& stk,
           CMPI_stack_el sel,
           Boolean or_flag)
 { {
     Uint32 i = 0;     Uint32 i = 0;
  
     stk.clear();     stk.clear();
     stk.reserveCapacity(16);     stk.reserveCapacity(16);
  
     if ((i = eval_heap.size()) == 0) return;          if( (i = eval_heap.size()) == 0 )
           {
               return;
           }
  
     while (eval_heap[i-1].op == WQL_IS_TRUE)     while (eval_heap[i-1].op == WQL_IS_TRUE)
     {     {
         eval_heap.remove(i-1);         eval_heap.remove(i-1);
         i--;         i--;
         if (i == 0) return;              if( i == 0 )
               {
                  return;
               }
     }     }
     //if (i == 0) return;     //if (i == 0) return;
  
     if (or_flag)     if (or_flag)
           {
         stk.append(CMPI_stack_el(i-1,false));         stk.append(CMPI_stack_el(i-1,false));
           }
     else     else
     {     {
        if (sel.is_terminal) return;              if( sel.is_terminal )
               {
                   return;
               }
        stk.append(sel);        stk.append(sel);
     }     }
  
Line 839 
Line 966 
         int k = stk[i].opn;         int k = stk[i].opn;
  
         if ((k < 0) || (stk[i].is_terminal))         if ((k < 0) || (stk[i].is_terminal))
               {
            i++;            i++;
               }
         else         else
         {         {
             if ( ((eval_heap[k].op != WQL_OR) && (or_flag)) ||             if ( ((eval_heap[k].op != WQL_OR) && (or_flag)) ||
                  ((eval_heap[k].op != WQL_AND) && (!or_flag))  )                  ((eval_heap[k].op != WQL_AND) && (!or_flag))  )
                   {
                 i++;                 i++;
                   }
             else             else
             {             {
                 // replace the element with disjunction                 // replace the element with disjunction
                 stk[i] = eval_heap[k].getSecond();                 stk[i] = eval_heap[k].getSecond();
                 stk.insert(i, eval_heap[k].getFirst());                 stk.insert(i, eval_heap[k].getFirst());
                 if (or_flag)                 if (or_flag)
                       {
                     eval_heap[k].op = WQL_IS_TRUE;                     eval_heap[k].op = WQL_IS_TRUE;
             }             }
         }         }
     }     }
 } }
       }
  
 //==============================================================================  //=============================================================================
 // //
 // class CMPI_stack_el // class CMPI_stack_el
 // //
 //==============================================================================  //=============================================================================
  
 //==============================================================================  //=============================================================================
 // //
 // class CMPI_eval_el // class CMPI_eval_el
 // //
 //==============================================================================  //=============================================================================
  
 CMPI_stack_el CMPI_eval_el::getFirst() CMPI_stack_el CMPI_eval_el::getFirst()
 { {
Line 914 
Line 1047 
             opn2 = opn1;             opn2 = opn1;
             opn1 =  k;             opn1 =  k;
         }         }
     else if ((is_terminal1) && (!is_terminal2))          else
           {
               if( (is_terminal1) && (!is_terminal2) )
               {
         if ((k = opn2) > opn1)         if ((k = opn2) > opn1)
         {         {
             opn2 = opn1;             opn2 = opn1;
Line 923 
Line 1059 
             is_terminal2 = true;             is_terminal2 = true;
         }         }
 } }
           }
   }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2