Changeset 891 for XIOS/trunk/src/interface/c/icxml_tree.cpp
- Timestamp:
- 07/05/16 15:59:23 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/interface/c/icxml_tree.cpp
r836 r891 15 15 #include "timer.hpp" 16 16 #include "context.hpp" 17 #include "grid.hpp" 18 #include "file.hpp" 19 #include "field.hpp" 20 #include "axis.hpp" 21 #include "domain.hpp" 22 #include "variable.hpp" 23 #include "zoom_domain.hpp" 24 #include "interpolate_domain.hpp" 25 #include "generate_rectilinear_domain.hpp" 26 #include "zoom_axis.hpp" 27 #include "interpolate_axis.hpp" 28 #include "inverse_axis.hpp" 17 #include "node_type.hpp" 29 18 30 19 extern "C" … … 47 36 typedef xios::CDomain * XDomainPtr; 48 37 typedef xios::CDomainGroup * XDomainGroupPtr; 38 39 typedef xios::CScalar * XScalarPtr; 40 typedef xios::CScalarGroup * XScalarGroupPtr; 49 41 50 42 typedef xios::CAxis * XAxisPtr; … … 64 56 typedef xios::CInverseAxis * XInverseAxisPtr; 65 57 58 typedef xios::CTransformation<CScalar> * XTransformationScalarPtr; 59 typedef xios::CReduceAxisToScalar * XReduceAxisToScalarPtr; 60 66 61 // ----------------------- Ajout d'enfant à un parent ----------------------- 67 62 … … 130 125 } 131 126 127 void cxios_xml_tree_add_scalar 128 (XScalarGroupPtr parent_, XScalarPtr * child_, const char * child_id, int child_id_size) 129 { 130 std::string child_id_str; 131 CTimer::get("XIOS").resume() ; 132 if (cstr2string(child_id, child_id_size, child_id_str)) 133 { 134 *child_ = parent_->createChild(child_id_str) ; 135 } 136 else 137 { 138 *child_ = parent_->createChild() ; 139 } 140 CTimer::get("XIOS").suspend() ; 141 } 142 132 143 void cxios_xml_tree_add_domain 133 144 (XDomainGroupPtr parent_, XDomainPtr * child_, const char * child_id, int child_id_size) … … 246 257 } 247 258 259 void cxios_xml_tree_add_scalargroup 260 (XScalarGroupPtr parent_, XScalarGroupPtr * child_, const char * child_id, int child_id_size) 261 { 262 std::string child_id_str; 263 CTimer::get("XIOS").resume() ; 264 if (cstr2string(child_id, child_id_size, child_id_str)) 265 { 266 *child_ = parent_->createChildGroup(child_id_str) ; 267 } 268 else 269 { 270 *child_ = parent_->createChildGroup() ; 271 } 272 CTimer::get("XIOS").suspend() ; 273 } 274 248 275 void cxios_xml_tree_add_axisgroup 249 276 (XAxisGroupPtr parent_, XAxisGroupPtr * child_, const char * child_id, int child_id_size) … … 326 353 } 327 354 355 void cxios_xml_tree_add_scalartogrid 356 (XGridPtr parent_, XScalarPtr * child_, const char * child_id, int child_id_size) 357 { 358 std::string child_id_str; 359 CTimer::get("XIOS").resume() ; 360 if (cstr2string(child_id, child_id_size, child_id_str)) 361 { 362 *child_ = parent_->addScalar(child_id_str); 363 } 364 else 365 { 366 *child_ = parent_->addScalar(); 367 } 368 CTimer::get("XIOS").suspend() ; 369 } 370 328 371 void cxios_xml_tree_add_axistogrid 329 372 (XGridPtr parent_, XAxisPtr * child_, const char * child_id, int child_id_size) … … 463 506 } 464 507 *child_ = static_cast<XInverseAxisPtr>(tmpChild_); 508 CTimer::get("XIOS").suspend() ; 509 } 510 511 void cxios_xml_tree_add_reduceaxistoscalartoscalar 512 (XScalarPtr parent_, XReduceAxisToScalarPtr * child_, const char * child_id, int child_id_size) 513 { 514 std::string child_id_str; 515 XTransformationScalarPtr tmpChild_; 516 CTimer::get("XIOS").resume() ; 517 if (cstr2string(child_id, child_id_size, child_id_str)) 518 { 519 tmpChild_ = parent_->addTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, child_id_str); 520 } 521 else 522 { 523 tmpChild_ = parent_->addTransformation(TRANS_REDUCE_AXIS_TO_SCALAR); 524 } 525 *child_ = static_cast<XReduceAxisToScalarPtr>(tmpChild_); 465 526 CTimer::get("XIOS").suspend() ; 466 527 }
Note: See TracChangeset
for help on using the changeset viewer.