Changeset 478


Ignore:
Timestamp:
04/09/14 15:46:49 (7 years ago)
Author:
ymipsl
Message:

Bug fix : when a file is disabled, fields embeded was not considered as inactive.

YM

Location:
XIOS/trunk/src/node
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r476 r478  
    381381      { 
    382382        processed=true ; 
    383         solveRefInheritance(true) ; 
     383        solveBaseReference() ; 
    384384        solveOperation() ; 
    385385        solveGridReference() ; 
     
    390390      } 
    391391    } 
    392      
     392 
    393393   void CField::solveRefInheritance(bool apply) 
    394394   { 
     
    396396      CField* refer_sptr; 
    397397      CField * refer_ptr = this; 
    398        
    399       if (this->hasDirectFieldReference())  baseRefObject = getDirectFieldReference(); 
    400       else  baseRefObject = CField::get(this); 
    401        
     398      
    402399      while (refer_ptr->hasDirectFieldReference()) 
    403400      { 
     
    407404         if(sset.end() != sset.find(refer_ptr)) 
    408405         { 
    409             DEBUG (<< "Dépendance circulaire stoppée pour l'objet de type CField sur " 
     406            DEBUG (<< "Circular dependency stopped for field object on " 
    410407                   << "\"" + refer_ptr->getId() + "\" !"); 
    411408            break; 
     
    414411         SuperClassAttribute::setAttributes(refer_ptr, apply); 
    415412         sset.insert(refer_ptr); 
    416 //ym         baseRefObject = refer_sptr; 
    417 //ym         refObject.push_back(refer_sptr); 
     413      } 
     414       
     415   } 
     416 
     417   void CField::solveBaseReference(void) 
     418   { 
     419      std::set<CField *> sset; 
     420      CField* refer_sptr; 
     421      CField * refer_ptr = this; 
     422       
     423      if (this->hasDirectFieldReference())  baseRefObject = getDirectFieldReference(); 
     424      else  baseRefObject = CField::get(this); 
     425       
     426      while (refer_ptr->hasDirectFieldReference()) 
     427      { 
     428         refer_sptr = refer_ptr->getDirectFieldReference(); 
     429         refer_ptr  = refer_sptr; 
     430 
     431         if(sset.end() != sset.find(refer_ptr)) 
     432         { 
     433            DEBUG (<< "Circular dependency stopped for field object on " 
     434                   << "\"" + refer_ptr->getId() + "\" !"); 
     435            break; 
     436         } 
     437 
     438         sset.insert(refer_ptr); 
    418439      } 
    419440       
    420441      if (hasDirectFieldReference()) baseRefObject->addReference(this) ; 
    421442   } 
    422  
     443    
    423444   //---------------------------------------------------------------- 
    424445 
  • XIOS/trunk/src/node/field.hpp

    r472 r478  
    113113         void processEnabledField(void) ; 
    114114         void solveRefInheritance(bool apply); 
     115         void solveBaseReference(void); 
    115116         void solveGridReference(void); 
    116117         void solveOperation(void); 
Note: See TracChangeset for help on using the changeset viewer.