Changeset 2206 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.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/domain.cpp
r2203 r2206 79 79 CATCH 80 80 81 CDomain* CDomain::get(const string& id )81 CDomain* CDomain::get(const string& id, bool noError) 82 82 { 83 83 const regex r("::"); … … 89 89 if (fieldId.empty()) ERROR("CDomain* CDomain::get(string& id)", <<" id = "<<id<< " -> bad format id, field name is empty"); 90 90 string suffix=m.suffix() ; 91 if (!CField::has(fieldId)) 92 if (noError) return nullptr ; 93 else ERROR("CDomain* CDomain::get(string& id)", <<" id = "<<id<< " -> field Id : < "<<fieldId<<" > doesn't exist"); 91 94 CField* field=CField::get(fieldId) ; 92 return field->getAssociatedDomain(suffix) ; 93 } 94 else return CObjectFactory::GetObject<CDomain>(id).get(); 95 } 96 95 return field->getAssociatedDomain(suffix, noError) ; 96 } 97 else 98 { 99 if (noError) if(!CObjectFactory::HasObject<CDomain>(id)) return nullptr ; 100 return CObjectFactory::GetObject<CDomain>(id).get(); 101 } 102 } 103 104 bool CDomain::has(const string& id) 105 { 106 if (CDomain::get(id,true)==nullptr) return false ; 107 else return true ; 108 } 109 110 CField* CDomain::getFieldFromId(const string& id) 111 { 112 const regex r("::"); 113 smatch m; 114 if (regex_search(id, m, r)) 115 { 116 if (m.size()!=1) ERROR("CField* CDomain::getFieldFromId(const string& id)", <<" id = "<<id<< " -> bad format id, separator :: append more than one time"); 117 string fieldId=m.prefix() ; 118 if (fieldId.empty()) ERROR("CField* CDomain::getFieldFromId(const string& id)", <<" id = "<<id<< " -> bad format id, field name is empty"); 119 string suffix=m.suffix() ; 120 CField* field=CField::get(fieldId) ; 121 return field ; 122 } 123 else return nullptr; 124 } 97 125 98 126 const std::set<StdString> & CDomain::getRelFiles(void) const … … 2337 2365 CATCH_DUMP_ATTR 2338 2366 2367 2368 bool CDomain::activateFieldWorkflow(CGarbageCollector& gc) 2369 TRY 2370 { 2371 if (!domain_ref.isEmpty()) 2372 { 2373 CField* field=getFieldFromId(domain_ref) ; 2374 if (field!=nullptr) 2375 { 2376 bool ret = field->buildWorkflowGraph(gc) ; 2377 if (!ret) return false ; // cannot build workflow graph at this state 2378 } 2379 else 2380 { 2381 CDomain* domain = get(domain_ref) ; 2382 bool ret = domain->activateFieldWorkflow(gc) ; 2383 if (!ret) return false ; // cannot build workflow graph at this state 2384 domain_ref=domain->getId() ; // replace domain_ref by solved reference 2385 } 2386 } 2387 activateFieldWorkflow_done_=true ; 2388 return true ; 2389 } 2390 CATCH_DUMP_ATTR 2339 2391 ///////////////////////////////////////////////////////////////////////////////////////////// 2340 2392 /////////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.