Salome HOME
Use tempfile.mkdtemp to create temporary directory
[modules/yacs.git] / src / engine / VisitorSaveState.cxx
index 5982e4f291d817a6cfb6ca6d409e8344109a7843..440f09feb31ce94239f098c87a0ce353c2f3c383 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -72,7 +72,7 @@ VisitorSaveState::~VisitorSaveState()
     }
 }
 
-void VisitorSaveState::openFileDump(const std::string& xmlDump) throw(YACS::Exception)
+void VisitorSaveState::openFileDump(const std::string& xmlDump)
 {
   _out.open(xmlDump.c_str(), ios::out);
   if (!_out)
@@ -184,6 +184,19 @@ void VisitorSaveState::visitForEachLoop(ForEachLoop *node)
   _out << "  </node>" << endl;
 }
 
+void VisitorSaveState::visitForEachLoopDyn(ForEachLoopDyn *node)
+{
+  node->ComposedNode::accept(this);
+  if (!_out) throw Exception("No file open for dump state");
+  string name = _root->getName();
+  if (static_cast<ComposedNode*>(node) != _root) name = _root->getChildName(node);
+  DEBTRACE("VisitorSaveState::visitForEachLoopDyn ------ " << name);
+  _out << "  <node type='forEachLoopDyn'>" << endl;
+  _out << "    <name>" << name << "</name>" << endl;
+  _out << "    <state>" << _nodeStateName[node->getState()] << "</state>" << endl;
+  _out << "  </node>" << endl;
+}
+
 void VisitorSaveState::visitOptimizerLoop(OptimizerLoop *node)
 {
   node->ComposedNode::accept(this);