Version: 9.16.0
YACS::bloctypeParser< T > Struct Template Reference

#include <blocParsers.hxx>

Inheritance diagram for YACS::bloctypeParser< T >:
Collaboration diagram for YACS::bloctypeParser< T >:

Public Member Functions

 bloctypeParser ()
 
virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const char *el, parser *child)
 
virtual void buildAttr (const XML_Char **attr)
 
void name (const std::string &name)
 
virtual void state (const std::string &name)
 
virtual void property (const myprop &prop)
 
virtual void inline_ (YACS::ENGINE::InlineNode *const &n)
 
virtual void sinline (YACS::ENGINE::ServiceInlineNode *const &n)
 
virtual void service (YACS::ENGINE::ServiceNode *const &n)
 
virtual void remote (YACS::ENGINE::InlineNode *const &n)
 
virtual void server (YACS::ENGINE::ServerNode *const &n)
 
virtual void node (YACS::ENGINE::InlineNode *const &n)
 
virtual void forloop (YACS::ENGINE::ForLoop *const &b)
 
virtual void optimizer (YACS::ENGINE::OptimizerLoop *const &b)
 
virtual void foreach (YACS::ENGINE::ForEachLoopGen *const &b)
 
virtual void while_ (YACS::ENGINE::WhileLoop *const &b)
 
virtual void switch_ (YACS::ENGINE::Switch *const &b)
 
virtual void bloc (YACS::ENGINE::Bloc *const &b)
 
virtual void control (const mycontrol &l)
 
virtual void datalink (const mylink &l)
 
virtual void stream (const mystream &l)
 
virtual void parameter (const myparam &param)
 
virtual void preset (ENGINE::DataNode *const &n)
 
virtual void outnode (ENGINE::DataNode *const &n)
 
T post ()
 
void name (const std::string &name)
 
- Public Member Functions inherited from YACS::parser
 parser ()
 
virtual ~parser ()
 
virtual void SetUserDataAndPush (parser *pp)
 
virtual void onStart (const XML_Char *el, const XML_Char **attr)
 
virtual void onEnd (const XML_Char *el, parser *child)
 
virtual void charData (const XML_Char *s, int len)
 
virtual void endParser ()
 
virtual void init ()
 
virtual void incrCount (const XML_Char *elem)
 
virtual void checkOrder (std::string &el)
 
virtual void maxcount (std::string name, int max, std::string &el)
 
virtual void mincount (std::string name, int min)
 
virtual void maxchoice (std::string *names, int max, std::string &el)
 
virtual void minchoice (std::string *names, int min)
 
virtual void pre ()
 
virtual void required (const std::string &name, const XML_Char **attr)
 
virtual void buildAttr (const XML_Char **attr)
 
std::stack< parser * > & getStack ()
 
template<class T >
T post ()
 
void logError (const std::string &reason)
 

Public Attributes

T _bloc
 
std::string _state
 
std::vector< YACS::ENGINE::Bloc * > _blocs
 
- Public Attributes inherited from YACS::parser
std::string _file
 
std::string _content
 
std::map< std::string, int > * _counts
 
std::map< std::string, int > _orders
 
int _orderState
 
int _level
 
std::stack< std::map< std::string, int > * > _stackCount
 
std::stack< int > _stackOrder
 
std::map< std::string, parser * > * _defaultParsersMap
 

Static Public Attributes

static bloctypeParser< TblocParser
 
- Static Public Attributes inherited from YACS::parser
static parser main_parser
 
static std::stack< parser * > _stackParser
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::parser
static void XMLCALL start_document (void *data)
 
static void XMLCALL end_document (void *data)
 
static void XMLCALL start_element (void *data, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *data, const xmlChar *name)
 
static void XMLCALL characters (void *data, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *data, const xmlChar *value)
 
static void XMLCALL cdata_block (void *data, const xmlChar *value, int len)
 
static void XMLCALL warning (void *data, const char *fmt,...)
 
static void XMLCALL error (void *data, const char *fmt,...)
 
static void XMLCALL fatal_error (void *data, const char *fmt,...)
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, parser *par)
 

Detailed Description

template<class T = YACS::ENGINE::Bloc*>
struct YACS::bloctypeParser< T >

Definition at line 60 of file blocParsers.hxx.

Constructor & Destructor Documentation

◆ bloctypeParser()

template<class T = YACS::ENGINE::Bloc*>
YACS::bloctypeParser< T >::bloctypeParser ( )
inline

Definition at line 64 of file blocParsers.hxx.

64 :parser()
65 {
66 _orders["property"]=0;
67 _orders["inline"]=2;
68 _orders["service"]=2;
69 _orders["server"]=2;
70 _orders["remote"]=2;
71 _orders["sinline"]=2;
72 _orders["node"]=2;
73 _orders["datanode"]=2;
74 _orders["outnode"]=2;
75 _orders["forloop"]=2;
76 _orders["foreach"]=2;
77 _orders["optimizer"]=2;
78 _orders["while"]=2;
79 _orders["switch"]=2;
80 _orders["bloc"]=2;
81 _orders["control"]=3;
82 _orders["datalink"]=3;
83 _orders["stream"]=3;
84 _orders["parameter"]=3;
85 }
std::map< std::string, int > _orders
Definition: parserBase.hxx:99

References YACS::parser::_orders.

Member Function Documentation

◆ bloc()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::bloc ( YACS::ENGINE::Bloc *const &  b)
inlinevirtual

Definition at line 204 of file blocParsers.hxx.

205 {
206 DEBTRACE( "bloc_bloc_set: " << b->getName() )
207 _bloc->edAddChild(b);
208 std::string fullname=currentProc->names.back()+ b->getName();
209 currentProc->nodeMap[fullname]=b;
210 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
YACS::ENGINE::Proc * currentProc
Definition: parserBase.cxx:30

References YACS::bloctypeParser< T >::_bloc, gui.CONNECTOR::b, currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ buildAttr()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::buildAttr ( const XML_Char **  attr)
inlinevirtual

Reimplemented from YACS::parser.

Reimplemented in YACS::proctypeParser< T >.

Definition at line 88 of file blocParsers.hxx.

89 {
90 if (!attr)
91 return;
92 this->required("name",attr);
93 for (int i = 0; attr[i]; i += 2)
94 {
95 if(std::string(attr[i]) == "name")name(attr[i+1]);
96 if(std::string(attr[i]) == "state")state(attr[i+1]);
97 }
98 }
void name(const std::string &name)
Definition: blocParsers.hxx:99
virtual void state(const std::string &name)
virtual void required(const std::string &name, const XML_Char **attr)
Definition: parserBase.cxx:186

References yacsorb.CORBAEngineTest::i, YACS::bloctypeParser< T >::name(), YACS::parser::required(), and YACS::bloctypeParser< T >::state().

◆ control()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::control ( const mycontrol l)
inlinevirtual

Definition at line 211 of file blocParsers.hxx.

212 {
213 DEBTRACE( "bloc_control_set: " << l.fromnode() << " "<< l.tonode() )
214 std::string msg;
215
216 if(currentProc->nodeMap.count(currentProc->names.back()+l.fromnode()) == 0)
217 {
218 msg="from node " + l.fromnode() + " does not exist in control link: ";
219 msg=msg+l.fromnode()+"->"+l.tonode();
220 msg=msg+ " context: "+currentProc->names.back();
221 this->logError(msg);
222 return;
223 }
224 if(currentProc->nodeMap.count(currentProc->names.back()+l.tonode()) == 0)
225 {
226 msg="to node " + l.tonode() + " does not exist in control link: ";
227 msg=msg+l.fromnode()+"->"+l.tonode();
228 msg=msg+ " context: "+currentProc->names.back();
229 this->logError(msg);
230 return;
231 }
232 // We only link local nodes
233 try
234 {
235 _bloc->edAddCFLink(currentProc->nodeMap[currentProc->names.back()+l.fromnode()],
236 currentProc->nodeMap[currentProc->names.back()+l.tonode()]);
237 }
238 catch(YACS::Exception& e)
239 {
240 this->logError(e.what());
241 }
242 }
std::map< std::string, Node * > nodeMap
Definition: Proc.hxx:87
std::vector< std::string > names
Definition: Proc.hxx:93
const char * what(void) const noexcept
Definition: Exception.cxx:50
void logError(const std::string &reason)
Definition: parserBase.cxx:214

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, testCppPluginInvokation::l, YACS::parser::logError(), YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and YACS::Exception::what().

◆ datalink()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::datalink ( const mylink l)
inlinevirtual

Definition at line 243 of file blocParsers.hxx.

244 {
245 DEBTRACE( "bloc_datalink_set: "<<l.fromnode()<<"("<<l.fromport()<<")->"<<l.tonode()<<"("<<l.toport()<<")")
246 std::string msg;
247
248 //Try only relative name for from node
249 std::string fromname = currentProc->names.back()+l.fromnode();
250 if(currentProc->nodeMap.count(fromname) == 0)
251 {
252 msg="from node " + l.fromnode() + " does not exist in data link: ";
253 msg=msg+l.fromnode()+"("+l.fromport()+")->"+l.tonode()+"("+l.toport()+")";
254 this->logError(msg);
255 return;
256 }
257 //Try relative name for to node and then absolute one
258 std::string toname = currentProc->names.back()+l.tonode();
259 if(currentProc->nodeMap.count(toname) == 0)
260 {
261 //It's not a relative name. Try an absolute one (I think it's not possible)
262 toname=l.tonode();
263 if(currentProc->nodeMap.count(toname) == 0)
264 {
265 // The TO node does not exist -> error
266 msg="to node " + l.tonode() + " does not exist in data link: ";
267 msg=msg+l.fromnode()+"("+l.fromport()+")->"+l.tonode()+"("+l.toport()+")";
268 this->logError(msg);
269 return;
270 }
271 }
272 // We only link local node and other nodes (relative or absolute name in this order)
273 DEBTRACE(fromname <<":"<<l.fromport()<<toname<<":"<<l.toport());
274 try
275 {
276 if (l.withControl())
277 _bloc->edAddDFLink(currentProc->nodeMap[fromname]->getOutputPort(l.fromport()),
278 currentProc->nodeMap[toname]->getInputPort(l.toport()));
279 else
280 _bloc->edAddLink(currentProc->nodeMap[fromname]->getOutputPort(l.fromport()),
281 currentProc->nodeMap[toname]->getInputPort(l.toport()));
282 }
283 catch(YACS::Exception& e)
284 {
285 this->logError(e.what());
286 }
287 }

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, testCppPluginInvokation::l, YACS::parser::logError(), YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and YACS::Exception::what().

◆ foreach()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::foreach ( YACS::ENGINE::ForEachLoopGen *const &  b)
inlinevirtual

Definition at line 181 of file blocParsers.hxx.

182 {
183 DEBTRACE( "bloc_foreach_set: " << b->getName() )
184 _bloc->edAddChild(b);
185 std::string fullname = currentProc->names.back()+b->getName();
186 currentProc->nodeMap[fullname]=b;
187 fullname += ".splitter";
188 currentProc->nodeMap[fullname]=b->getChildByShortName("splitter");
189 }

References YACS::bloctypeParser< T >::_bloc, gui.CONNECTOR::b, currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ forloop()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::forloop ( YACS::ENGINE::ForLoop *const &  b)
inlinevirtual

Definition at line 165 of file blocParsers.hxx.

166 {
167 DEBTRACE( "bloc_forloop_set: " << b->getName() )
168 _bloc->edAddChild(b);
169 std::string fullname = currentProc->names.back()+b->getName();
170 currentProc->nodeMap[fullname]=b;
171 }

References YACS::bloctypeParser< T >::_bloc, gui.CONNECTOR::b, currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ inline_()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::inline_ ( YACS::ENGINE::InlineNode *const &  n)
inlinevirtual

Definition at line 116 of file blocParsers.hxx.

117 {
118 DEBTRACE( "bloc_pynode_set: " << n->getName() )
119 _bloc->edAddChild(n);
120 std::string fullname = currentProc->names.back()+n->getName();
121 currentProc->nodeMap[fullname]=n;
122 currentProc->inlineMap[fullname]=n;
123 }

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, YACS::ENGINE::Proc::inlineMap, gui.Appli::n, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ name() [1/2]

template<class T = YACS::ENGINE::Bloc*>
void YACS::bloctypeParser< T >::name ( const std::string &  name)
inline

Definition at line 99 of file blocParsers.hxx.

100 {
101 }

Referenced by YACS::bloctypeParser< T >::buildAttr(), and YACS::bloctypeParser< T >::state().

◆ name() [2/2]

void YACS::bloctypeParser< YACS::ENGINE::Bloc * >::name ( const std::string &  name)

Definition at line 388 of file blocParsers.hxx.

389{
390 DEBTRACE( "bloc_name: " << name )
391 std::string fullname=currentProc->names.back()+name;
393 _blocs.push_back(_bloc);
394 currentProc->names.push_back(fullname+'.');
395}
YACS::ENGINE::Runtime * theRuntime
Definition: parsers.cxx:40
virtual Bloc * createBloc(const std::string &name)
Definition: Runtime.cxx:231
std::vector< YACS::ENGINE::Bloc * > _blocs

References YACS::ENGINE::Runtime::createBloc(), currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and theRuntime.

◆ node()

◆ onEnd()

template<class T >
void YACS::bloctypeParser< T >::onEnd ( const char *  el,
parser child 
)
virtual

Reimplemented from YACS::parser.

Reimplemented in YACS::proctypeParser< T >.

Definition at line 445 of file blocParsers.hxx.

446{
447 DEBTRACE( "bloctypeParser::onEnd: " << el )
448 std::string element(el);
449 if(element == "property")property(((propertytypeParser*)child)->post());
450 else if(element == "inline")inline_(((inlinetypeParser<>*)child)->post());
451 else if(element == "sinline")sinline(((sinlinetypeParser<>*)child)->post());
452 else if(element == "service")service(((servicetypeParser<>*)child)->post());
453 else if(element == "server")server(((servertypeParser<>*)child)->post());
454 else if(element == "remote")remote(((remotetypeParser<>*)child)->post());
455 else if(element == "node")node(((nodetypeParser<>*)child)->post());
456 else if(element == "datanode")preset(((presettypeParser<>*)child)->post());
457 else if(element == "outnode")outnode(((outnodetypeParser<>*)child)->post());
458
459 else if(element == "bloc")bloc(((bloctypeParser<>*)child)->post());
460 else if(element == "forloop")forloop(((forlooptypeParser<>*)child)->post());
461 else if(element == "optimizer")optimizer(((optimizerlooptypeParser<>*)child)->post());
462 else if(element == "foreach")foreach(((foreachlooptypeParser<ENGINE::ForEachLoop *>*)child)->post());
463 else if(element == "foreachdyn")foreach(((foreachlooptypeParser<ENGINE::ForEachLoopDyn *>*)child)->post());
464 else if(element == "while")while_(((whilelooptypeParser<>*)child)->post());
465 else if(element == "switch")switch_(((switchtypeParser*)child)->post());
466
467 else if(element == "control") control(((controltypeParser<>*)child)->post());
468 else if(element == "datalink") datalink(((linktypeParser<>*)child)->post());
469 else if(element == "stream") stream(((streamtypeParser<>*)child)->post());
470 else if(element == "parameter") parameter(((parametertypeParser*)child)->post());
471}
virtual void outnode(ENGINE::DataNode *const &n)
virtual void optimizer(YACS::ENGINE::OptimizerLoop *const &b)
virtual void while_(YACS::ENGINE::WhileLoop *const &b)
virtual void remote(YACS::ENGINE::InlineNode *const &n)
virtual void server(YACS::ENGINE::ServerNode *const &n)
virtual void sinline(YACS::ENGINE::ServiceInlineNode *const &n)
virtual void datalink(const mylink &l)
virtual void service(YACS::ENGINE::ServiceNode *const &n)
virtual void property(const myprop &prop)
virtual void node(YACS::ENGINE::InlineNode *const &n)
virtual void switch_(YACS::ENGINE::Switch *const &b)
virtual void parameter(const myparam &param)
virtual void control(const mycontrol &l)
virtual void forloop(YACS::ENGINE::ForLoop *const &b)
virtual void inline_(YACS::ENGINE::InlineNode *const &n)
virtual void preset(ENGINE::DataNode *const &n)
virtual void bloc(YACS::ENGINE::Bloc *const &b)
virtual void stream(const mystream &l)

References DEBTRACE.

◆ onStart()

template<class T >
void YACS::bloctypeParser< T >::onStart ( const XML_Char el,
const XML_Char **  attr 
)
virtual

Reimplemented from YACS::parser.

Reimplemented in YACS::proctypeParser< T >.

Definition at line 408 of file blocParsers.hxx.

409{
410 DEBTRACE( "bloctypeParser::onStart: " << el )
411 std::string element(el);
412 checkOrder(element);
414 if(element == "property")pp=&propertytypeParser::propertyParser;
415
416 else if(element == "inline")pp=&inlinetypeParser<>::inlineParser;
417 else if(element == "sinline")pp=&sinlinetypeParser<>::sinlineParser;
418 else if(element == "service")pp=&servicetypeParser<>::serviceParser;
419 else if(element == "server")pp=&servertypeParser<>::serverParser;
420 else if(element == "remote")pp=&remotetypeParser<>::remoteParser;
421 else if(element == "node")pp=&nodetypeParser<>::nodeParser;
422 else if(element == "datanode")pp=&presettypeParser<>::presetParser;
423 else if(element == "outnode")pp=&outnodetypeParser<>::outnodeParser;
424
425 else if(element == "bloc")pp=&bloctypeParser<>::blocParser;
426 else if(element == "forloop")pp=&forlooptypeParser<>::forloopParser;
429 else if(element == "optimizer")pp=&optimizerlooptypeParser<>::optimizerloopParser;
430 else if(element == "while")pp=&whilelooptypeParser<>::whileloopParser;
431 else if(element == "switch")pp=&switchtypeParser::switchParser;
432
433 else if(element == "control")pp=&controltypeParser<>::controlParser;
434 else if(element == "datalink")pp=&linktypeParser<>::linkParser;
435 else if(element == "stream")pp=&streamtypeParser<>::streamParser;
436 else if(element == "parameter")pp=&parametertypeParser::parameterParser;
437
438 this->SetUserDataAndPush(pp);
439 pp->init();
440 pp->pre();
441 pp->buildAttr(attr);
442}
static bloctypeParser< T > blocParser
Definition: blocParsers.hxx:62
static controltypeParser< T > controlParser
Definition: linkParsers.hxx:34
static foreachlooptypeParser< T > foreachloopParser
static forlooptypeParser< T > forloopParser
static inlinetypeParser< T > inlineParser
static linktypeParser< T > linkParser
Definition: linkParsers.hxx:84
static nodetypeParser< T > nodeParser
Definition: nodeParsers.hxx:55
static optimizerlooptypeParser< T > optimizerloopParser
static outnodetypeParser< T > outnodeParser
static parametertypeParser parameterParser
virtual void SetUserDataAndPush(parser *pp)
Definition: parserBase.cxx:55
virtual void checkOrder(std::string &el)
Definition: parserBase.cxx:108
static parser main_parser
Definition: parserBase.hxx:41
static presettypeParser< T > presetParser
static propertytypeParser propertyParser
static remotetypeParser< T > remoteParser
static servertypeParser< T > serverParser
static servicetypeParser< T > serviceParser
static sinlinetypeParser< T > sinlineParser
static streamtypeParser< T > streamParser
static switchtypeParser switchParser
static whilelooptypeParser< T > whileloopParser

References YACS::parser::buildAttr(), DEBTRACE, YACS::parser::init(), YACS::parser::main_parser, YACS::parametertypeParser::parameterParser, YACS::parser::pre(), YACS::propertytypeParser::propertyParser, and YACS::switchtypeParser::switchParser.

◆ optimizer()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::optimizer ( YACS::ENGINE::OptimizerLoop *const &  b)
inlinevirtual

Definition at line 172 of file blocParsers.hxx.

173 {
174 DEBTRACE( "bloc_optimizer_set: " << b->getName() );
175 _bloc->edAddChild(b);
176 std::string fullname = currentProc->names.back()+b->getName();
177 currentProc->nodeMap[fullname]=b;
178 //fullname += ".splitter";
179 //currentProc->nodeMap[fullname]=b->getChildByShortName("splitter");
180 }

References YACS::bloctypeParser< T >::_bloc, gui.CONNECTOR::b, currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ outnode()

template<class T >
void YACS::bloctypeParser< T >::outnode ( ENGINE::DataNode *const &  n)
virtual

Definition at line 379 of file blocParsers.hxx.

380{
381 DEBTRACE("bloc_outnode: " << n->getName() );
382 _bloc->edAddChild(n);
383 std::string fullname = currentProc->names.back()+n->getName();
384 currentProc->nodeMap[fullname]=n;
385}

References currentProc, DEBTRACE, gui.Appli::n, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ parameter()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::parameter ( const myparam param)
inlinevirtual

Definition at line 320 of file blocParsers.hxx.

321 {
322 DEBTRACE( "++++++++++++++++++++Parameter+++++++++++++++++++++" );
323 std::string msg;
324 std::string toname = currentProc->names.back()+param._tonode;
325 if(currentProc->nodeMap.count(toname) == 0)
326 {
327 msg="to node " + param._tonode + " does not exist in parameter: ";
328 msg=msg+"->"+param._tonode+"("+param._toport+")";
329 this->logError(msg);
330 return;
331 }
332 YACS::ENGINE::InputPort* inport=currentProc->nodeMap[toname]->getInputPort(param._toport);
333 //We don't know the parameter type. So we try to initialize the port
334 //with the value. If it's not the right type, edInit throws an exception
335 try
336 {
337 inport->edInit("XML",param._value.c_str());
338 }
339 catch(YACS::Exception& e)
340 {
341 this->logError(e.what());
342 }
343 DEBTRACE( "++++++++++++++++++++End parameter+++++++++++++++++++++" );
344 }
Base class for Input Ports.
Definition: InputPort.hxx:44
void edInit(T value)
Definition: InputPort.hxx:129
std::string _toport
Definition: factory.hxx:75
std::string _value
Definition: factory.hxx:76
std::string _tonode
Definition: factory.hxx:74

References myparam::_tonode, myparam::_toport, myparam::_value, currentProc, DEBTRACE, YACS::ENGINE::InputPort::edInit(), YACS::parser::logError(), YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and YACS::Exception::what().

◆ post()

template<class T = YACS::ENGINE::Bloc*>
T YACS::bloctypeParser< T >::post ( )
inline

Definition at line 349 of file blocParsers.hxx.

350 {
351 DEBTRACE( "bloc_post" )
352 currentProc->names.pop_back();
353 T b=_bloc;
354 _blocs.pop_back();
355 if(_blocs.empty())
356 _bloc=NULL;
357 else
358 _bloc=_blocs.back();
359 return b;
360 }

References YACS::bloctypeParser< T >::_bloc, YACS::bloctypeParser< T >::_blocs, gui.CONNECTOR::b, currentProc, DEBTRACE, and YACS::ENGINE::Proc::names.

◆ preset()

template<class T >
void YACS::bloctypeParser< T >::preset ( ENGINE::DataNode *const &  n)
virtual

Definition at line 370 of file blocParsers.hxx.

371{
372 DEBTRACE("bloc_preset_set: " << n->getName() );
373 _bloc->edAddChild(n);
374 std::string fullname = currentProc->names.back()+n->getName();
375 currentProc->nodeMap[fullname]=n;
376}

References currentProc, DEBTRACE, gui.Appli::n, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ property()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::property ( const myprop prop)
inlinevirtual

Definition at line 111 of file blocParsers.hxx.

112 {
113 DEBTRACE( "property_set: " << prop._name << prop._value )
114 _bloc->setProperty(prop._name,prop._value);
115 }
std::string _name
Definition: factory.hxx:96
std::string _value
Definition: factory.hxx:97

References YACS::bloctypeParser< T >::_bloc, myprop::_name, myprop::_value, and DEBTRACE.

◆ remote()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::remote ( YACS::ENGINE::InlineNode *const &  n)
inlinevirtual

Definition at line 140 of file blocParsers.hxx.

141 {
142 DEBTRACE( "bloc_remote_set: " << n->getName() )
143 _bloc->edAddChild(n);
144 std::string fullname = currentProc->names.back()+n->getName();
145 currentProc->nodeMap[fullname]=n;
146 currentProc->inlineMap[fullname]=n;
147 }

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, YACS::ENGINE::Proc::inlineMap, gui.Appli::n, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ server()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::server ( YACS::ENGINE::ServerNode *const &  n)
inlinevirtual

Definition at line 148 of file blocParsers.hxx.

149 {
150 DEBTRACE( "bloc_server_set: " << n->getName() )
151 _bloc->edAddChild(n);
152 std::string fullname = currentProc->names.back()+n->getName();
153 currentProc->nodeMap[fullname]=n;
154 currentProc->inlineMap[fullname]=n;
155 }

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, YACS::ENGINE::Proc::inlineMap, gui.Appli::n, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ service()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::service ( YACS::ENGINE::ServiceNode *const &  n)
inlinevirtual

Definition at line 132 of file blocParsers.hxx.

133 {
134 DEBTRACE( "bloc_service_set: " << n->getName() )
135 _bloc->edAddChild(n);
136 std::string fullname = currentProc->names.back()+n->getName();
137 currentProc->nodeMap[fullname]=n;
138 currentProc->serviceMap[fullname]=n;
139 }

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, gui.Appli::n, YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and YACS::ENGINE::Proc::serviceMap.

Referenced by gui.cataitems.ItemService::addNode(), and gui.cataitems.ItemService::getChildren().

◆ sinline()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::sinline ( YACS::ENGINE::ServiceInlineNode *const &  n)
inlinevirtual

Definition at line 124 of file blocParsers.hxx.

125 {
126 DEBTRACE( "bloc_sinline: " << n->getName() )
127 _bloc->edAddChild(n);
128 std::string fullname = currentProc->names.back()+n->getName();
129 currentProc->nodeMap[fullname]=n;
130 currentProc->serviceMap[fullname]=n;
131 }

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, gui.Appli::n, YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and YACS::ENGINE::Proc::serviceMap.

◆ state()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::state ( const std::string &  name)
inlinevirtual

Definition at line 102 of file blocParsers.hxx.

102 {
103 DEBTRACE( "bloc_state: " << name )
104 _state=name;
105 if(_state == "disabled")
106 {
107 DEBTRACE( "Bloc disabled: " << _bloc->getName())
108 _bloc->exDisabledState();
109 }
110 }

References YACS::bloctypeParser< T >::_bloc, YACS::bloctypeParser< T >::_state, DEBTRACE, and YACS::bloctypeParser< T >::name().

Referenced by YACS::bloctypeParser< T >::buildAttr().

◆ stream()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::stream ( const mystream l)
inlinevirtual

Definition at line 288 of file blocParsers.hxx.

289 {
290 DEBTRACE( "bloc_stream_set: " << l.fromnode() << l.fromport() << l.tonode() << l.toport() )
291 std::string msg;
292 std::string fromname = currentProc->names.back()+l.fromnode();
293 std::string toname = currentProc->names.back()+l.tonode();
294 //only relative names
295 if(currentProc->nodeMap.count(fromname) == 0)
296 {
297 msg="from node " + l.fromnode() + " does not exist in stream link: ";
298 msg=msg+l.fromnode()+"("+l.fromport()+")->"+l.tonode()+"("+l.toport()+")";
299 this->logError(msg);
300 return;
301 }
302 if(currentProc->nodeMap.count(toname) == 0)
303 {
304 msg="to node " + l.tonode() + " does not exist in stream link: ";
305 msg=msg+l.fromnode()+"("+l.fromport()+")->"+l.tonode()+"("+l.toport()+")";
306 this->logError(msg);
307 return;
308 }
309 YACS::ENGINE::OutputDataStreamPort* pout=currentProc->nodeMap[fromname]->getOutputDataStreamPort(l.fromport());
310 YACS::ENGINE::InputDataStreamPort* pin=currentProc->nodeMap[toname]->getInputDataStreamPort(l.toport());
311 _bloc->edAddLink(pout,pin);
312 // Set all properties for this link
313 std::map<std::string, std::string>::const_iterator pt;
314 for(pt=l._props.begin();pt!=l._props.end();pt++)
315 {
316 pin->setProperty((*pt).first,(*pt).second);
317 pout->setProperty((*pt).first,(*pt).second);
318 }
319 }
virtual void setProperty(const std::string &name, const std::string &value)
Set a new value for a property of the port.

References YACS::bloctypeParser< T >::_bloc, currentProc, DEBTRACE, testCppPluginInvokation::l, YACS::parser::logError(), YACS::ENGINE::Proc::names, YACS::ENGINE::Proc::nodeMap, and YACS::ENGINE::DataStreamPort::setProperty().

◆ switch_()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::switch_ ( YACS::ENGINE::Switch *const &  b)
inlinevirtual

Definition at line 197 of file blocParsers.hxx.

198 {
199 DEBTRACE( "bloc_switch_set: " << b->getName() )
200 _bloc->edAddChild(b);
201 std::string fullname = currentProc->names.back()+b->getName();
202 currentProc->nodeMap[fullname]=b;
203 }

References YACS::bloctypeParser< T >::_bloc, gui.CONNECTOR::b, currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

◆ while_()

template<class T = YACS::ENGINE::Bloc*>
virtual void YACS::bloctypeParser< T >::while_ ( YACS::ENGINE::WhileLoop *const &  b)
inlinevirtual

Definition at line 190 of file blocParsers.hxx.

191 {
192 DEBTRACE( "bloc_while_set: " << b->getName() )
193 _bloc->edAddChild(b);
194 std::string fullname = currentProc->names.back()+b->getName();
195 currentProc->nodeMap[fullname]=b;
196 }

References YACS::bloctypeParser< T >::_bloc, gui.CONNECTOR::b, currentProc, DEBTRACE, YACS::ENGINE::Proc::names, and YACS::ENGINE::Proc::nodeMap.

Member Data Documentation

◆ _bloc

◆ _blocs

template<class T = YACS::ENGINE::Bloc*>
std::vector<YACS::ENGINE::Bloc *> YACS::bloctypeParser< T >::_blocs

Definition at line 364 of file blocParsers.hxx.

Referenced by YACS::bloctypeParser< T >::post().

◆ _state

template<class T = YACS::ENGINE::Bloc*>
std::string YACS::bloctypeParser< T >::_state

Definition at line 363 of file blocParsers.hxx.

Referenced by YACS::bloctypeParser< T >::state().

◆ blocParser

template<class T >
bloctypeParser< T > YACS::bloctypeParser< T >::blocParser
static

Definition at line 62 of file blocParsers.hxx.


The documentation for this struct was generated from the following file: