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/attribute_array_impl.hpp

    r778 r1105  
    103103    } 
    104104 
     105    template <typename T_numtype, int N_rank> 
     106    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttributeArray& attr) 
     107    { 
     108      return ((dynamic_cast<CArray<T_numtype,N_rank>& >(*this)) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(attr)));       
     109    } 
     110 
     111    template <typename T_numtype, int N_rank> 
     112    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute& attr) 
     113    { 
     114      return ((*this) == (dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)));       
     115    } 
    105116 
    106117    template <typename T_numtype, int N_rank> 
Note: See TracChangeset for help on using the changeset viewer.