Changeset 2206 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
- Timestamp:
- 08/24/21 13:48:12 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
r2203 r2206 221 221 CATCH 222 222 223 CAxis* CAxis::get(const string& id )223 CAxis* CAxis::get(const string& id, bool noError) 224 224 { 225 225 const regex r("::"); … … 231 231 if (fieldId.empty()) ERROR("CAxis* CAxis::get(string& id)", <<" id = "<<id<< " -> bad format id, field name is empty"); 232 232 string suffix=m.suffix() ; 233 if (!CField::has(fieldId)) 234 if (noError) return nullptr ; 235 else ERROR("CAxis* CAxis::get(string& id, bool noError)", <<" id = "<<id<< " -> field Id : < "<<fieldId<<" > doesn't exist"); 233 236 CField* field=CField::get(fieldId) ; 234 return field->getAssociatedAxis(suffix ) ;237 return field->getAssociatedAxis(suffix, noError) ; 235 238 } 236 else return CObjectFactory::GetObject<CAxis>(id).get(); 239 { 240 if (noError) if(!CObjectFactory::HasObject<CAxis>(id)) return nullptr ; 241 return CObjectFactory::GetObject<CAxis>(id).get(); 242 } 243 } 244 245 bool CAxis::has(const string& id) 246 { 247 if (CAxis::get(id,true)==nullptr) return false ; 248 else return true ; 249 } 250 251 CField* CAxis::getFieldFromId(const string& id) 252 { 253 const regex r("::"); 254 smatch m; 255 if (regex_search(id, m, r)) 256 { 257 if (m.size()!=1) ERROR("CField* CAxis::getFieldFromId(const string& id)", <<" id = "<<id<< " -> bad format id, separator :: append more than one time"); 258 string fieldId=m.prefix() ; 259 if (fieldId.empty()) ERROR("CField* CAxis::getFieldFromId(const string& id)", <<" id = "<<id<< " -> bad format id, field name is empty"); 260 string suffix=m.suffix() ; 261 CField* field=CField::get(fieldId) ; 262 return field ; 263 } 264 else return nullptr; 237 265 } 238 266 … … 635 663 } 636 664 CATCH_DUMP_ATTR 665 666 bool CAxis::activateFieldWorkflow(CGarbageCollector& gc) 667 TRY 668 { 669 if (!axis_ref.isEmpty()) 670 { 671 CField* field=getFieldFromId(axis_ref) ; 672 if (field!=nullptr) 673 { 674 bool ret = field->buildWorkflowGraph(gc) ; 675 if (!ret) return false ; // cannot build workflow graph at this state 676 } 677 else 678 { 679 CAxis* axis = get(axis_ref) ; 680 bool ret = axis->activateFieldWorkflow(gc) ; 681 if (!ret) return false ; // cannot build workflow graph at this state 682 axis_ref=axis->getId() ; // replace domain_ref by solved reference 683 } 684 } 685 activateFieldWorkflow_done_=true ; 686 return true ; 687 } 688 CATCH_DUMP_ATTR 689 637 690 638 691 void CAxis::setContextClient(CContextClient* contextClient)
Note: See TracChangeset
for help on using the changeset viewer.