Salome HOME
Useful access method to available resources
[modules/yacs.git] / src / engine / VisitorSaveSchema.cxx
index 28816d983a85f2cebed0563324b6a2d534a77c41..ef6890f4fccc4ba18ee2e73b087d9398c6acc842 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2016  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
@@ -222,7 +222,7 @@ void VisitorSaveSchema::visitInlineNode(InlineNode *node)
   DEBTRACE("START visitInlineNode " << _root->getChildName(node));
   beginCase(node);
   int depth = depthNode(node);
-  if(node->getExecutionMode()=="local")
+  if(node->getExecutionMode()==InlineNode::LOCAL_STR)
     _out << indent(depth) << "<inline name=\"" << node->getName() << "\"";
   else
     _out << indent(depth) << "<remote name=\"" << node->getName() << "\"";
@@ -245,7 +245,7 @@ void VisitorSaveSchema::visitInlineNode(InlineNode *node)
   writeOutputPorts(node);
   writeOutputDataStreamPorts(node);
 
-  if(node->getExecutionMode()=="local")
+  if(node->getExecutionMode()==InlineNode::LOCAL_STR)
     _out << indent(depth) << "</inline>" << endl;
   else
     _out << indent(depth) << "</remote>" << endl;
@@ -259,7 +259,7 @@ void VisitorSaveSchema::visitInlineFuncNode(InlineFuncNode *node)
   DEBTRACE("START visitInlineFuncNode " << _root->getChildName(node));
   beginCase(node);
   int depth = depthNode(node);
-  if(node->getExecutionMode()=="local")
+  if(node->getExecutionMode()==InlineNode::LOCAL_STR)
     _out << indent(depth) << "<inline name=\"" << node->getName() << "\"";
   else
     _out << indent(depth) << "<remote name=\"" << node->getName() << "\"";
@@ -284,7 +284,7 @@ void VisitorSaveSchema::visitInlineFuncNode(InlineFuncNode *node)
   writeOutputPorts(node);
   writeOutputDataStreamPorts(node);
 
-  if(node->getExecutionMode()=="local")
+  if(node->getExecutionMode()==InlineNode::LOCAL_STR)
     _out << indent(depth) << "</inline>" << endl;
   else
     _out << indent(depth) << "</remote>" << endl;
@@ -701,10 +701,15 @@ void VisitorSaveSchema::writeContainers(Proc *proc)
       string name = it->first;
       _out << indent(depth) << "<container name=\"" << name << "\">" << endl;
       _out << indent(depth+1) << "<property name=\"" << Container::KIND_ENTRY << "\" value=\"" << it->second->getKind() << "\"/>" << endl;
+      _out << indent(depth+1) << "<property name=\"" << Container::AOC_ENTRY << "\" value=\"" << (int)it->second->isAttachedOnCloning() << "\"/>" << endl;
       map<string, string> properties = (it->second)->getProperties();
       map<string, string>::iterator itm;
       for(itm = properties.begin(); itm != properties.end(); ++itm)
         {
+          if((*itm).first==Container::KIND_ENTRY)
+            continue;
+          if((*itm).first==Container::AOC_ENTRY)
+            continue;
           if((*itm).first!=HomogeneousPoolContainer::INITIALIZE_SCRIPT_KEY)
             {
               _out << indent(depth+1) << "<property name=\"" << (*itm).first << "\" value=\"" << (*itm).second << "\"/>" << endl;
@@ -792,8 +797,8 @@ void VisitorSaveSchema::writeControls(ComposedNode *node)
   for (list<Node*>::iterator ic = setOfChildren.begin(); ic != setOfChildren.end(); ++ic)
     {
       // --- Control links from direct descendant to nodes inside the bloc
-      set<InGate*> setOfInGates = (*ic)->getOutGate()->edSetInGate();
-      for (set<InGate*>::iterator ig = setOfInGates.begin(); ig != setOfInGates.end(); ++ig)
+      list<InGate*> setOfInGates = (*ic)->getOutGate()->edSetInGate();
+      for (list<InGate*>::iterator ig = setOfInGates.begin(); ig != setOfInGates.end(); ++ig)
         {
           Node *to = (*ig)->getNode();
           if (node->isInMyDescendance(to))
@@ -1077,11 +1082,6 @@ void VisitorSaveSchema::writeParametersNode(ComposedNode *proc, Node *node)
 {
   int depth = 1;
   list<InputPort *> setOfInputPort = node->getLocalInputPorts();
-  if (ForEachLoop* foreach = dynamic_cast<ForEachLoop*>(node))
-    {
-      DEBTRACE("writeParametersNode foreach");
-      setOfInputPort.push_back( foreach->edGetSeqOfSamplesPort());
-    }
   list<InputPort *>::iterator iter;
   for(iter = setOfInputPort.begin(); iter != setOfInputPort.end(); ++iter)
     {