Ignore:
Timestamp:
06/06/17 17:58:16 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/scalar.cpp

    r1144 r1158  
    6363  { 
    6464 
     65  } 
     66 
     67  /*! 
     68    Compare two scalar objects.  
     69    They are equal if only if they have identical attributes as well as their values. 
     70    Moreover, they must have the same transformations. 
     71  \param [in] scalar Compared scalar 
     72  \return result of the comparison 
     73  */ 
     74  bool CScalar::isEqual(CScalar* obj) 
     75  { 
     76    vector<StdString> excludedAttr; 
     77    excludedAttr.push_back("scalar_ref"); 
     78    bool objEqual = SuperClass::isEqual(obj, excludedAttr); 
     79    if (!objEqual) return objEqual; 
     80 
     81    TransMapTypes thisTrans = this->getAllTransformations(); 
     82    TransMapTypes objTrans  = obj->getAllTransformations(); 
     83 
     84    TransMapTypes::const_iterator it, itb, ite; 
     85    std::vector<ETranformationType> thisTransType, objTransType; 
     86    for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 
     87      thisTransType.push_back(it->first); 
     88    for (it = objTrans.begin(); it != objTrans.end(); ++it) 
     89      objTransType.push_back(it->first); 
     90 
     91    if (thisTransType.size() != objTransType.size()) return false; 
     92    for (int idx = 0; idx < thisTransType.size(); ++idx) 
     93      objEqual &= (thisTransType[idx] == objTransType[idx]); 
     94 
     95    return objEqual; 
    6596  } 
    6697 
Note: See TracChangeset for help on using the changeset viewer.