Ignore:
Timestamp:
05/04/17 15:14:37 (7 years ago)
Author:
mhnguyen
Message:

Fixing bug of using *_ref on chaining transformations.

+) Correct isEqual function of attribute_template
+) Modify isEqual function of CAttributeMap to make sure that some attributes are
excluded from comparasion

Test
+) On Curie
+) toy_cmpi6 works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/attribute_map.cpp

    r1112 r1117  
    122122         Compare two attribute maps 
    123123         \param [in] another attribute map to compare 
     124         \param [in] excludedAttrs attribute to be excluded from comparasion 
    124125         \return true if these two maps have same attributes whose value are identical 
    125126      */ 
    126       bool CAttributeMap::isEqual(const CAttributeMap& another) 
     127      bool CAttributeMap::isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs) 
    127128      { 
    128129         SuperClassMap::const_iterator itb = another.begin(), ite = another.end(), it; 
    129130         for (it = itb; it !=ite; ++it) 
    130131         { 
    131             if ((*it).first.compare(StdString("id")) != 0 && (*it).first.compare(StdString("src")) != 0) 
     132            bool excluded = false; 
     133            for (int idx = 0; idx < excludedAttrs.size(); ++idx) 
    132134            { 
    133               if (this->hasAttribute(it->first)) 
    134               {  
    135                 if (!((*it).second->isEqual(*(*this)[it->first]))) 
    136                 return false; 
     135               if (0 == (*it).first.compare(excludedAttrs[idx])) 
     136               { 
     137                 excluded = true; 
     138                 break; 
     139               }  
     140            } 
     141 
     142            if (!excluded) 
     143            { 
     144              if ((*it).first.compare(StdString("id")) != 0 && (*it).first.compare(StdString("src")) != 0) 
     145              { 
     146                if (this->hasAttribute(it->first)) 
     147                {  
     148                  if (!((*it).second->isEqual(*(*this)[it->first]))) 
     149                  { 
     150                    return false; 
     151                  } 
     152                } 
     153                else 
     154                  return false; 
    137155              } 
    138               else 
    139                 return false; 
    140156            } 
    141157         } 
Note: See TracChangeset for help on using the changeset viewer.