Ignore:
Timestamp:
06/19/13 10:09:36 (11 years ago)
Author:
ymipsl
Message:

Add possibility to make inheritance of attributes and reference before closing the context definition.
New fortran fonction : xios_solve inheritance()
After this call, the value of attribute have the inherited value of their parent.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/attribute_template_impl.hpp

    r432 r445  
    109109    }  
    110110 
     111    template <class T> 
     112    void CAttributeTemplate<T>::setInheritedValue(const CAttribute& attr) 
     113    { 
     114      this->setInheritedValue(dynamic_cast<const CAttributeTemplate<T>& >(attr)) ; 
     115    }  
     116 
     117    template <class T> 
     118    void CAttributeTemplate<T>::setInheritedValue(const CAttributeTemplate& attr) 
     119    { 
     120      if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 
     121    }  
     122 
     123    template <class T> 
     124    T CAttributeTemplate<T>::getInheritedValue(void) const 
     125    { 
     126      if (this->isEmpty()) return inheritedValue.get() ; 
     127      else return getValue() ; 
     128    }  
     129     
     130    template <class T> 
     131    bool CAttributeTemplate<T>::hasInheritedValue(void) const 
     132    { 
     133      return !this->isEmpty() || !inheritedValue.isEmpty() ; 
     134    }  
     135     
    111136      //--------------------------------------------------------------- 
    112137 
Note: See TracChangeset for help on using the changeset viewer.