Changeset 1112
- Timestamp:
- 05/03/17 14:59:25 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/attribute.cpp
r1107 r1112 6 6 namespace xios 7 7 { 8 9 const StdString CAttribute::resetInheritanceStr("_reset_") ; 10 8 11 /// ////////////////////// Définitions ////////////////////// /// 9 12 CAttribute::CAttribute(const StdString & id) 10 : CObject(id), CBaseType() 13 : CObject(id), CBaseType(), _canInherite(true) 11 14 // , value() 12 15 { /* Ne rien faire de plus */ } -
XIOS/trunk/src/attribute.hpp
r1105 r1112 65 65 virtual void setInheritedValue(const CAttribute& ) = 0 ; 66 66 virtual bool hasInheritedValue(void) const = 0; 67 67 68 bool canInherite(void) {return _canInherite ;} 68 69 protected : 70 bool _canInherite ; 71 static const StdString resetInheritanceStr ; 69 72 70 73 }; // class CAttribute -
XIOS/trunk/src/attribute_array.hpp
r1107 r1112 53 53 /// Autre /// 54 54 virtual string toString(void) const { return _toString();} 55 virtual void fromString(const StdString & str) { _fromString(str);}55 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 56 56 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} 57 57 virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } -
XIOS/trunk/src/attribute_array_impl.hpp
r1105 r1112 83 83 void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttributeArray& attr) 84 84 { 85 if (this->isEmpty() && attr.hasInheritedValue())85 if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) 86 86 { 87 87 inheritedValue.resize(attr.shape()) ; -
XIOS/trunk/src/attribute_enum.hpp
r1107 r1112 62 62 /// Autre /// 63 63 virtual StdString toString(void) const { return _toString();} 64 virtual void fromString(const StdString & str) { _fromString(str);}64 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 65 65 66 66 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} -
XIOS/trunk/src/attribute_enum_impl.hpp
r1105 r1112 88 88 void CAttributeEnum<T>::setInheritedValue(const CAttributeEnum& attr) 89 89 { 90 if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue());90 if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()); 91 91 } 92 92 -
XIOS/trunk/src/attribute_map.cpp
r1105 r1112 170 170 if (apply) 171 171 { 172 if (currentAtt->isEmpty() && !el.second->isEmpty())172 if (currentAtt->isEmpty() && currentAtt->canInherite() && !el.second->isEmpty()) 173 173 { 174 174 this->setAttribute(el.first, el.second); -
XIOS/trunk/src/attribute_template.hpp
r1105 r1112 65 65 /// Autre /// 66 66 virtual StdString toString(void) const { return _toString();} 67 virtual void fromString(const StdString & str) { _fromString(str);}67 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 68 68 // virtual CAttributeTemplate* clone() const {} 69 69 // virtual void toBinary (StdOStream & os) const; -
XIOS/trunk/src/attribute_template_impl.hpp
r1105 r1112 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
Note: See TracChangeset
for help on using the changeset viewer.