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/type/enum.hpp

    r591 r1105  
    100100    __INLINE__ const CEnum_ref& operator = (const CEnum_ref& val) const; 
    101101    __INLINE__ operator T_enum&() const; 
    102     bool operator == (const CEnum_ref &other) {return this->get()==other.get() ;} 
     102     
    103103 
    104104    inline virtual CBaseType* clone(void) const   { return _clone(); } 
     
    134134  } ; 
    135135   
     136  template <typename T> __INLINE__ bool operator== (const CEnum<T>& lhs, const typename T::t_enum& rhs); 
     137  template <typename T> __INLINE__ bool operator== (const typename T::t_enum& lhs, const CEnum<T>& rhs); 
     138  template <typename T> __INLINE__ bool operator== (const CEnum<T>& lhs, const CEnum<T>& rhs);   
     139  template <typename T> __INLINE__ bool operator== (const CEnum_ref<T>& lhs, const CEnum_ref<T>& rhs); 
     140  template <typename T> __INLINE__ bool operator== (const CEnum_ref<T>& lhs, const typename T::t_enum& rhs); 
     141  template <typename T> __INLINE__ bool operator== (const typename T::t_enum& lhs, const CEnum_ref<T>& rhs); 
     142  template <typename T> __INLINE__ bool operator== (const CEnum<T>& lhs, const CEnum_ref<T>& rhs) {return (lhs.get() == rhs.get());} 
     143  template <typename T> __INLINE__ bool operator== (const CEnum_ref<T>& lhs, const CEnum<T>& rhs) {return (rhs == lhs); } 
     144 
    136145  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) ; 
    137146  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type) ;   
Note: See TracChangeset for help on using the changeset viewer.