70 _out <<
"</graphState>" << endl;
77 _out.open(xmlDump.c_str(), ios::out);
80 string what =
"Impossible to open file for writing: " + xmlDump;
83 _out <<
"<?xml version='1.0'?>" << endl;
84 _out <<
"<graphState>" << endl;
90 _out <<
"</graphState>" << endl;
98 DEBTRACE(
"VisitorSaveState::visitElementaryNode --- " << name);
99 _out <<
" <node type='elementaryNode'>" << endl;
100 _out <<
" <name>" << name <<
"</name>" << endl;
105 list<InputPort *>::iterator iter;
106 for(iter = setOfInputPort.begin(); iter != setOfInputPort.end(); iter++)
108 _out <<
" <inputPort>" << endl;
109 _out <<
" <name>" << (*iter)->getName() <<
"</name>" << endl;
113 _out << (*iter)->dump();
118 _out <<
"<value><error><![CDATA[" << e.
what() <<
"]]></error></value>" << endl;
120 _out <<
" </inputPort>" << endl;
124 list<OutputPort *>::iterator oiter;
125 for(oiter = setOfOutputPort.begin(); oiter != setOfOutputPort.end(); oiter++)
127 _out <<
" <outputPort>" << endl;
128 _out <<
" <name>" << (*oiter)->getName() <<
"</name>" << endl;
132 _out << (*oiter)->dump();
137 _out <<
"<value><error><![CDATA[" << e.
what() <<
"]]></error></value>" << endl;
139 _out <<
" </outputPort>" << endl;
142 _out <<
" </node>" << endl;
147 node->ComposedNode::accept(
this);
151 DEBTRACE(
"VisitorSaveState::visitBloc ------------- " << name);
152 _out <<
" <node type='bloc'>" << endl;
153 _out <<
" <name>" << name <<
"</name>" << endl;
156 _out <<
" </node>" << endl;
161 node->ComposedNode::accept(
this);
165 DEBTRACE(
"VisitorSaveState::visitProc ------------- " << name);
166 _out <<
" <node type='proc'>" << endl;
167 _out <<
" <name>" << name <<
"</name>" << endl;
170 _out <<
" </node>" << endl;
175 node->ComposedNode::accept(
this);
179 DEBTRACE(
"VisitorSaveState::visitForEachLoop ------ " << name);
180 _out <<
" <node type='forEachLoop'>" << endl;
181 _out <<
" <name>" << name <<
"</name>" << endl;
184 _out <<
" </node>" << endl;
189 node->ComposedNode::accept(
this);
193 DEBTRACE(
"VisitorSaveState::visitForEachLoopDyn ------ " << name);
194 _out <<
" <node type='forEachLoopDyn'>" << endl;
195 _out <<
" <name>" << name <<
"</name>" << endl;
197 _out <<
" </node>" << endl;
202 node->ComposedNode::accept(
this);
206 DEBTRACE(
"VisitorSaveState::visitOptimizerLoop ------ " << name);
207 _out <<
" <node type='optimizerLoop'>" << endl;
208 _out <<
" <name>" << name <<
"</name>" << endl;
211 _out <<
" </node>" << endl;
216 node->ComposedNode::accept(
this);
221 node->ComposedNode::accept(
this);
225 DEBTRACE(
"VisitorSaveState::visitLoop ------------- " << name);
226 _out <<
" <node type ='loop'>" << endl;
227 _out <<
" <name>" << name <<
"</name>" << endl;
231 _out <<
" </node>" << endl;
236 node->ComposedNode::accept(
this);
240 DEBTRACE(
"VisitorSaveState::visitForLoop ---------- " << name);
241 _out <<
" <node type='forLoop'>" << endl;
242 _out <<
" <name>" << name <<
"</name>" << endl;
247 throw Exception(
"NbOfTimesInputPort in forLoop empty, case not handled yet...");
250 _out <<
" <nsteps>" << nsteps <<
"</nsteps>" << endl;
252 _out <<
" </node>" << endl;
257 node->ComposedNode::accept(
this);
261 DEBTRACE(
"VisitorSaveState::visitWhileLoop -------- " << name);
262 _out <<
" <node type='whileLoop'>" << endl;
263 _out <<
" <name>" << name <<
"</name>" << endl;
268 throw Exception(
"condition in WhileLoop empty, case not handled yet...");
271 bool condition = cip->getValue();
272 _out <<
" <condition>" << condition <<
"</condition>" << endl;
275 _out <<
" </node>" << endl;
280 node->ComposedNode::accept(
this);
284 DEBTRACE(
"VisitorSaveState::visitSwitch ----------- " << name);
285 _out <<
" <node type='switch'>" << endl;
286 _out <<
" <name>" << name <<
"</name>" << endl;
290 throw Exception(
"condition in switch empty, case not handled yet...");
293 _out <<
" <condition>" << condition <<
"</condition>" << endl;
295 _out <<
" </node>" << endl;
: Interface for management of storage of data formated dynamically in its TypeCode....
virtual int getIntValue() const =0
Composed node to group elementary and composed nodes.
Base class for all composed nodes.
std::string getChildName(const Node *node) const
std::string getName() const
Class for data parameters specification.
Base class for dynamically (fully or semifully) built graphs.
Base class for all calculation nodes.
std::list< OutputPort * > getSetOfOutputPort() const
std::list< InputPort * > getSetOfInputPort() const
YACS::StatesForNode getState() const
Loop node for parametric calculation.
InputPort * edGetNbOfTimesInputPort()
Class for calculation node (function) inlined (and executed) in the schema.
Class for calculation node (script) inlined (and executed) in the schema.
Base class for loop node.
virtual YACS::StatesForNode getState() const
class to build optimization loops
Base class for all schema objects.
Class for calculation node associated with a component service.
Control node that emulates the C switch.
InputPort * edGetConditionPort()
virtual void visitOptimizerLoop(OptimizerLoop *node)
std::map< int, std::string > _nodeStateName
virtual void visitStudyInNode(DataNode *node)
void visitForEachLoop(ForEachLoop *node) override
virtual void visitServiceInlineNode(ServiceInlineNode *node)
virtual ~VisitorSaveState()
virtual void visitDynParaLoop(DynParaLoop *node)
virtual void visitWhileLoop(WhileLoop *node)
virtual void visitSwitch(Switch *node)
virtual void visitOutNode(DataNode *node)
VisitorSaveState(ComposedNode *root)
virtual void visitInlineFuncNode(InlineFuncNode *node)
virtual void visitElementaryNode(ElementaryNode *node)
virtual void visitServiceNode(ServiceNode *node)
void visitForEachLoopDyn(ForEachLoopDyn *node) override
virtual void visitServerNode(ServerNode *node)
virtual void visitBloc(Bloc *node)
virtual void visitLoop(Loop *node)
virtual void visitProc(Proc *node)
virtual void visitStudyOutNode(DataNode *node)
void openFileDump(const std::string &xmlDump)
virtual void visitInlineNode(InlineNode *node)
virtual void visitForLoop(ForLoop *node)
virtual void visitPresetNode(DataNode *node)
InputPort * edGetConditionPort()
const char * what(void) const noexcept