X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fengine%2FVisitorSaveState.cxx;h=8c27bbca63052543fbe0b81f8fcbf2bce1ce702f;hb=7e1ffb17a38095b6699ccd324ea03e88e6f88ed3;hp=5489ebab9df0cf00d5dc1a6a85b11ee8d00bd973;hpb=313a04631c63078d01c2f643a53500ec549d034e;p=modules%2Fyacs.git diff --git a/src/engine/VisitorSaveState.cxx b/src/engine/VisitorSaveState.cxx index 5489ebab9..8c27bbca6 100644 --- a/src/engine/VisitorSaveState.cxx +++ b/src/engine/VisitorSaveState.cxx @@ -1,8 +1,27 @@ +// Copyright (C) 2006-2015 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include "ElementaryNode.hxx" #include "Bloc.hxx" #include "Proc.hxx" #include "ForEachLoop.hxx" +#include "OptimizerLoop.hxx" #include "Loop.hxx" #include "ForLoop.hxx" #include "WhileLoop.hxx" @@ -10,6 +29,7 @@ #include "InputPort.hxx" #include "InlineNode.hxx" #include "ServiceNode.hxx" +#include "ServerNode.hxx" #include "ServiceInlineNode.hxx" #include "DataNode.hxx" @@ -52,7 +72,7 @@ VisitorSaveState::~VisitorSaveState() } } -void VisitorSaveState::openFileDump(std::string xmlDump) throw(Exception) +void VisitorSaveState::openFileDump(const std::string& xmlDump) throw(YACS::Exception) { _out.open(xmlDump.c_str(), ios::out); if (!_out) @@ -99,6 +119,26 @@ void VisitorSaveState::visitElementaryNode(ElementaryNode *node) } _out << " " << endl; } + + list setOfOutputPort = node->getSetOfOutputPort(); + list::iterator oiter; + for(oiter = setOfOutputPort.begin(); oiter != setOfOutputPort.end(); oiter++) + { + _out << " " << endl; + _out << " " << (*oiter)->getName() << "" << endl; + try + { + _out << " "; + _out << (*oiter)->dump(); + } + catch (YACS::Exception &e) + { + DEBTRACE("caught YACS:Exception: " << e.what()); + _out << "" << endl; + } + _out << " " << endl; + } + _out << " " << endl; } @@ -144,6 +184,25 @@ void VisitorSaveState::visitForEachLoop(ForEachLoop *node) _out << " " << endl; } +void VisitorSaveState::visitOptimizerLoop(OptimizerLoop *node) +{ + node->ComposedNode::accept(this); + if (!_out) throw Exception("No file open for dump state"); + string name = _root->getName(); + if (static_cast(node) != _root) name = _root->getChildName(node); + DEBTRACE("VisitorSaveState::visitOptimizerLoop ------ " << name); + _out << " " << endl; + _out << " " << name << "" << endl; + _out << " " << _nodeStateName[node->getState()] << "" << endl; + + _out << " " << endl; +} + +void VisitorSaveState::visitDynParaLoop(DynParaLoop *node) +{ + node->ComposedNode::accept(this); +} + void VisitorSaveState::visitLoop(Loop *node) { node->ComposedNode::accept(this); @@ -238,6 +297,10 @@ void VisitorSaveState::visitServiceNode(ServiceNode *node) visitElementaryNode(node); } +void VisitorSaveState::visitServerNode(ServerNode *node) +{ + visitElementaryNode(node); +} void VisitorSaveState::visitServiceInlineNode(ServiceInlineNode *node) {