Ignore:
Timestamp:
04/25/17 10:57:48 (7 years ago)
Author:
mhnguyen
Message:

Adding comparison operator between objects of XIOS.
Two objects of a same type are considered equal if they have same non-empty
attributes which have same values

+) Add operator== to class CArray
+) Add comparison operator to some basic attribute classes
+) Add operator== to date and duration (It seems that they don't serve much)

Test
+) On Curie
+) No Unit tests but test with transformation work (the next commit)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/object_template_impl.hpp

    r769 r1105  
    136136   } 
    137137 
     138   /*! 
     139     Compare two object of same type 
     140   */ 
     141   template <class T> 
     142   bool CObjectTemplate<T>::isEqual(const string& id) 
     143   { 
     144      T* obj = CObjectTemplate<T>::get(id); 
     145      return this->isEqual(obj); 
     146   } 
     147 
     148   template <class T> 
     149   bool CObjectTemplate<T>::isEqual(T* obj) 
     150   { 
     151 
     152      CAttributeMap& attrMapThis = *this; 
     153      CAttributeMap& attrMapObj  = *obj; 
     154      return (attrMapThis.isEqual(attrMapObj)); 
     155   } 
     156 
    138157   //--------------------------------------------------------------- 
    139158 
Note: See TracChangeset for help on using the changeset viewer.