41 using namespace YACS::ENGINE;
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::visitOptimizerLoop ------ " << name);
194 _out <<
" <node type='optimizerLoop'>" << endl;
195 _out <<
" <name>" << name <<
"</name>" << endl;
198 _out <<
" </node>" << endl;
203 node->ComposedNode::accept(
this);
208 node->ComposedNode::accept(
this);
212 DEBTRACE(
"VisitorSaveState::visitLoop ------------- " << name);
213 _out <<
" <node type ='loop'>" << endl;
214 _out <<
" <name>" << name <<
"</name>" << endl;
218 _out <<
" </node>" << endl;
223 node->ComposedNode::accept(
this);
227 DEBTRACE(
"VisitorSaveState::visitForLoop ---------- " << name);
228 _out <<
" <node type='forLoop'>" << endl;
229 _out <<
" <name>" << name <<
"</name>" << endl;
234 throw Exception(
"NbOfTimesInputPort in forLoop empty, case not handled yet...");
237 _out <<
" <nsteps>" << nsteps <<
"</nsteps>" << endl;
239 _out <<
" </node>" << endl;
244 node->ComposedNode::accept(
this);
248 DEBTRACE(
"VisitorSaveState::visitWhileLoop -------- " << name);
249 _out <<
" <node type='whileLoop'>" << endl;
250 _out <<
" <name>" << name <<
"</name>" << endl;
255 throw Exception(
"condition in WhileLoop empty, case not handled yet...");
258 bool condition = cip->getValue();
259 _out <<
" <condition>" << condition <<
"</condition>" << endl;
262 _out <<
" </node>" << endl;
267 node->ComposedNode::accept(
this);
271 DEBTRACE(
"VisitorSaveState::visitSwitch ----------- " << name);
272 _out <<
" <node type='switch'>" << endl;
273 _out <<
" <name>" << name <<
"</name>" << endl;
277 throw Exception(
"condition in switch empty, case not handled yet...");
280 _out <<
" <condition>" << condition <<
"</condition>" << endl;
282 _out <<
" </node>" << endl;