Changeset 1219
- Timestamp:
- 07/18/17 11:50:10 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/attribute_array.hpp
r1158 r1219 43 43 CArray<T_numtype, N_rank> getInheritedValue(void) const ; 44 44 bool hasInheritedValue(void) const; 45 46 bool isEqual(const CAttributeArray& attr); 45 47 46 bool isEqual(const CAttribute& attr); 48 47 … … 67 66 68 67 private : 68 bool isEqual_(const CAttributeArray& attr); 69 69 CArray<T_numtype, N_rank> inheritedValue ; 70 70 StdString _toString(void) const; -
XIOS/dev/XIOS_DEV_CMIP6/src/attribute_array_impl.hpp
r1158 r1219 104 104 105 105 template <typename T_numtype, int N_rank> 106 bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute Array& attr)106 bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute& attr) 107 107 { 108 return ((dynamic_cast<CArray<T_numtype,N_rank>& >(*this)) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(attr))); 108 const CAttributeArray<T_numtype,N_rank>& tmp = dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr); 109 return this->isEqual_(tmp); 109 110 } 110 111 111 112 template <typename T_numtype, int N_rank> 112 bool CAttributeArray<T_numtype,N_rank>::isEqual (const CAttribute& attr)113 bool CAttributeArray<T_numtype,N_rank>::isEqual_(const CAttributeArray& attr) 113 114 { 114 return ((*this) == (dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr))); 115 if ((!this->hasInheritedValue() && !attr.hasInheritedValue())) 116 return true; 117 if (this->hasInheritedValue() && attr.hasInheritedValue()) 118 return (this->getInheritedValue() == attr.getInheritedValue()); 119 else 120 return false; 115 121 } 116 122 -
XIOS/dev/XIOS_DEV_CMIP6/src/attribute_enum.hpp
r1158 r1219 49 49 T_enum getInheritedValue(void) const; 50 50 string getInheritedStringValue(void) const; 51 bool hasInheritedValue(void) const; 52 53 bool isEqual(const CAttributeEnum& attr ); 51 bool hasInheritedValue(void) const; 52 54 53 bool isEqual(const CAttribute& attr ); 55 54 … … 74 73 virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ; 75 74 virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ; 76 virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 75 virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 77 76 78 77 private : 78 bool isEqual_(const CAttributeEnum& attr ); 79 79 StdString _toString(void) const; 80 80 void _fromString(const StdString & str); -
XIOS/dev/XIOS_DEV_CMIP6/src/attribute_enum_impl.hpp
r1158 r1219 114 114 bool CAttributeEnum<T>::isEqual(const CAttribute& attr) 115 115 { 116 return (this->isEqual(dynamic_cast<const CAttributeEnum<T>& >(attr))); 117 } 118 119 template <class T> 120 bool CAttributeEnum<T>::isEqual(const CAttributeEnum& attr) 121 { 122 return ((dynamic_cast<const CEnum<T>& >(*this)) == (dynamic_cast<const CEnum<T>& >(attr))); 116 const CAttributeEnum<T>& tmp = dynamic_cast<const CAttributeEnum<T>& >(attr); 117 return this->isEqual_(tmp); 118 } 119 120 template <class T> 121 bool CAttributeEnum<T>::isEqual_(const CAttributeEnum& attr) 122 { 123 if ((!this->hasInheritedValue() && !attr.hasInheritedValue())) 124 return true; 125 if (this->hasInheritedValue() && attr.hasInheritedValue()) 126 return (this->getInheritedValue() == attr.getInheritedValue()); 127 else 128 return false; 123 129 } 124 130 -
XIOS/dev/XIOS_DEV_CMIP6/src/attribute_template.hpp
r1158 r1219 57 57 T getInheritedValue(void) const ; 58 58 bool hasInheritedValue(void) const; 59 60 bool isEqual_(const CAttributeTemplate& attr ); 59 61 60 bool isEqual(const CAttribute& attr ); 62 61 … … 95 94 // CAttributeTemplate(void); // Not implemented. 96 95 private : 96 bool isEqual_(const CAttributeTemplate& attr); 97 97 StdString _toString(void) const; 98 98 void _fromString(const StdString & str);
Note: See TracChangeset
for help on using the changeset viewer.