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_map.cpp

    r432 r445  
    107107      //--------------------------------------------------------------- 
    108108       
    109       void CAttributeMap::setAttributes(const CAttributeMap * const _parent) 
     109      void CAttributeMap::setAttributes(const CAttributeMap * const _parent, bool apply) 
    110110      { 
    111111         typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
     
    117117            if (this->hasAttribute(el.first)) 
    118118            { 
    119                CAttribute * currAtt = CAttributeMap::operator[](el.first); 
    120                if (currAtt->isEmpty() && !el.second->isEmpty()) 
     119               CAttribute * currentAtt = CAttributeMap::operator[](el.first); 
     120               CAttribute * parentAtt = el.second ; 
     121               if (apply) 
    121122               { 
    122                   this->setAttribute(el.first, el.second); 
     123                 if (currentAtt->isEmpty() && !el.second->isEmpty()) 
     124                 { 
     125                    this->setAttribute(el.first, el.second); 
     126                 } 
    123127               } 
     128               else currentAtt->setInheritedValue(*parentAtt) ; 
    124129            } 
    125130         } 
Note: See TracChangeset for help on using the changeset viewer.