Ignore:
Timestamp:
06/19/13 10:09:36 (7 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_array_impl.hpp

    r369 r445  
    6565      this->setValue(attr) ; 
    6666    }  
     67     
     68     
     69    template <typename T_numtype, int N_rank> 
     70    void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttribute& attr) 
     71    { 
     72      this->setInheritedValue(dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)) ; 
     73    }  
     74 
     75    template <typename T_numtype, int N_rank> 
     76    void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttributeArray& attr) 
     77    { 
     78      if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue=attr ; 
     79     }  
     80 
     81    template <typename T_numtype, int N_rank> 
     82    CArray<T_numtype,N_rank> CAttributeArray<T_numtype,N_rank>::getInheritedValue(void) const 
     83    { 
     84      if (this->isEmpty()) return inheritedValue.copy() ; 
     85      else return getValue() ; 
     86    }  
     87     
     88    template <typename T_numtype, int N_rank> 
     89    bool CAttributeArray<T_numtype,N_rank>::hasInheritedValue(void) const 
     90    { 
     91      return !this->isEmpty() || !inheritedValue.isEmpty() ; 
     92    }  
     93     
    6794 
    6895    template <typename T_numtype, int N_rank> 
Note: See TracChangeset for help on using the changeset viewer.