Changeset 1117 for XIOS/trunk/src/attribute_map.cpp
- Timestamp:
- 05/04/17 15:14:37 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/attribute_map.cpp
r1112 r1117 122 122 Compare two attribute maps 123 123 \param [in] another attribute map to compare 124 \param [in] excludedAttrs attribute to be excluded from comparasion 124 125 \return true if these two maps have same attributes whose value are identical 125 126 */ 126 bool CAttributeMap::isEqual(const CAttributeMap& another )127 bool CAttributeMap::isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs) 127 128 { 128 129 SuperClassMap::const_iterator itb = another.begin(), ite = another.end(), it; 129 130 for (it = itb; it !=ite; ++it) 130 131 { 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) 132 134 { 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; 137 155 } 138 else139 return false;140 156 } 141 157 }
Note: See TracChangeset
for help on using the changeset viewer.