Changeset 1158 for XIOS/dev/dev_olga/src/attribute_template_impl.hpp
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/attribute_template_impl.hpp
r778 r1158 71 71 T CAttributeTemplate<T>::getValue(void) const 72 72 { 73 74 /* 75 76 77 78 79 80 81 73 return CType<T>::get() ; 74 /* 75 if (SuperClass::isEmpty()) 76 { 77 ERROR("T CAttributeTemplate<T>::getValue(void) const", 78 << "[ id = " << this->getId() << "]" 79 << " L'attribut est requis mais n'est pas défini !"); 80 } 81 return (SuperClass::getValue<T>()); 82 82 */ 83 83 } … … 125 125 void CAttributeTemplate<T>::setInheritedValue(const CAttributeTemplate& attr) 126 126 { 127 if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ;127 if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 128 128 } 129 129 … … 139 139 { 140 140 return !this->isEmpty() || !inheritedValue.isEmpty() ; 141 } 142 143 template <class T> 144 bool CAttributeTemplate<T>::isEqual(const CAttribute& attr) 145 { 146 const CAttributeTemplate<T>& tmp = dynamic_cast<const CAttributeTemplate<T>& >(attr); 147 return this->isEqual_(tmp); 148 } 149 150 template <class T> 151 bool CAttributeTemplate<T>::isEqual_(const CAttributeTemplate& attr) 152 { 153 if ((!this->hasInheritedValue() && !attr.hasInheritedValue())) 154 return true; 155 if (this->hasInheritedValue() && attr.hasInheritedValue()) 156 return (this->getInheritedValue() == attr.getInheritedValue()); 157 else 158 return false; 141 159 } 142 160
Note: See TracChangeset
for help on using the changeset viewer.