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/node/context.cpp

    r430 r445  
    245245   //---------------------------------------------------------------- 
    246246 
    247    void CContext::solveDescInheritance(const CAttributeMap * const UNUSED(parent)) 
     247   void CContext::solveDescInheritance(bool apply, const CAttributeMap * const UNUSED(parent)) 
    248248   { 
    249249#define DECLARE_NODE(Name_, name_)    \ 
    250250   if (C##Name_##Definition::has(C##Name_##Definition::GetDefName())) \ 
    251      C##Name_##Definition::get(C##Name_##Definition::GetDefName())->solveDescInheritance(); 
     251     C##Name_##Definition::get(C##Name_##Definition::GetDefName())->solveDescInheritance(apply); 
    252252#define DECLARE_NODE_PAR(Name_, name_) 
    253253#include "node_type.conf" 
     
    268268   //---------------------------------------------------------------- 
    269269 
    270    void CContext::solveFieldRefInheritance(void) 
     270   void CContext::solveFieldRefInheritance(bool apply) 
    271271   { 
    272272      if (!this->hasId()) return; 
     
    279279      { 
    280280         CField* field = *it; 
    281          field->solveRefInheritance(); 
     281         field->solveRefInheritance(apply); 
    282282      } 
    283283   } 
     
    370370   } 
    371371 
    372    void CContext::solveAllInheritance(void) 
     372   void CContext::solveAllInheritance(bool apply) 
    373373   { 
    374374     // Résolution des héritages descendants (càd des héritages de groupes) 
    375375     // pour chacun des contextes. 
    376       solveDescInheritance(); 
     376      solveDescInheritance(apply); 
    377377 
    378378     // Résolution des héritages par référence au niveau des fichiers. 
     
    380380 
    381381      for (unsigned int i = 0; i < allFiles.size(); i++) 
    382          allFiles[i]->solveFieldRefInheritance(); 
     382         allFiles[i]->solveFieldRefInheritance(apply); 
    383383   } 
    384384 
Note: See TracChangeset for help on using the changeset viewer.