34 using namespace YACS::ENGINE;
47 repr.insert(s.begin(),s.end());
54 std::string what=
"InputPort4DF2DS::get : no value currently in input whith name \""; what+=
_name; what+=
"\"";
55 throw Exception(what);
85 throw Exception(
"InputPort4DF2DS::clone : internal error");
126 list<InputPort *>::const_iterator it =_setOfInputPort.begin();
132 list<OutputDataStreamPort *>::const_iterator it =_setOfOutputDataStreamPort.begin();
147 throw Exception(
"DFToDSForLoop::simpleClone : Internal error");
160 for(set<OutPort *>::iterator iter=setO.begin();iter!=setO.end();iter++)
161 (*iter)->getAllRepresented(represented);
172 throw Exception(
"OutputPort4DS2DF::clone : Internal error");
199 repr.insert(s.begin(),s.end());
212 throw Exception(
"DSToDFForLoop::simpleClone : Internal error");
226 list<OutputPort *>::const_iterator it = _setOfOutputPort.begin();
232 list<InputDataStreamPort *>::const_iterator it = _setOfInputDataStreamPort.begin();
247 _normalFinish(normalFinish),
248 _internalError(internalError)
255 _normalFinish(false),_internalError(true)
320 throw Exception(
"Loop::initLoop : no nodes specifies to be repeated ");
333 string what =
"Loop::edSetNode: node "; what += node->
getName(); what +=
" is not orphan ! ";
349 return edSetNode(node);
381 (*iter1)->getReadyTasks(tasks);
383 (*iter2)->getReadyTasks(tasks);
399 ret.push_back(
_node);
425 if(name==_node->getName())
427 string what(
"node "); what+= name ; what+=
" is not a child of loop node "; what += getName();
450 set<DSToDFForLoop*>::iterator iter;
453 if((*iter)->getOutputPort(
"")->isAlreadyInSet(portCasted))
459 (*iter)->getOutputPort(
"")->addInPort(portCasted);
462 (*iter)->loopHasOneMoreRef();
463 port=(*iter)->getInputDataStreamPort(
"");
468 string typeOfPortInstance=(port.first)->getNameOfTypeOfCurrentInstance();
474 OutPort *portCasted=port.first;
475 set<DFToDSForLoop*>::iterator iter;
485 pair<set<DFToDSForLoop*>::iterator,
bool> iter2=
_outputsTraducer.insert(kl);
487 portCasted->
addInPort((*iter)->getInputPort(
""));
495 port.first=(*iter)->getOutputDataStreamPort(
"");
500 string typeOfPortInstance=port->getNameOfTypeOfCurrentInstance();
504 !isNecessaryToBuildSpecificDelegateDF2DS(pointsOfView)) )
507 set<DSToDFForLoop*>::iterator iter;
508 for(iter=_inputsTraducer.begin();iter!=_inputsTraducer.end();iter++)
509 if((*iter)->getOutputPort(
"")->isAlreadyInSet(portCasted))
511 if(iter==_inputsTraducer.end())
513 string what(
"Loop::getDelegateOf : Port with name "); what+=portCasted->
getName(); what+=
" not exported by loop "; what+=_name;
517 port=(*iter)->getInputDataStreamPort(
"");
523 string typeOfPortInstance=(port.first)->getNameOfTypeOfCurrentInstance();
527 !isNecessaryToBuildSpecificDelegateDF2DS(pointsOfView)) )
529 OutPort *portCasted=port.first;
530 set<DFToDSForLoop*>::iterator iter;
531 for(iter=_outputsTraducer.begin();iter!=_outputsTraducer.end();iter++)
534 if(iter==_outputsTraducer.end())
536 string what(
"Loop::getDelegateOf : Port with name "); what+=portCasted->
getName(); what+=
" not exported by loop "; what+=_name;
540 port.first=(*iter)->getOutputDataStreamPort(
"");
545 string typeOfPortInstance=port->getNameOfTypeOfCurrentInstance();
549 !isNecessaryToBuildSpecificDelegateDF2DS(pointsOfView)) )
552 set<DSToDFForLoop*>::iterator iter;
553 for(iter=_inputsTraducer.begin();iter!=_inputsTraducer.end();iter++)
554 if((*iter)->getOutputPort(
"")->isAlreadyInSet(portCasted))
556 if(iter==_inputsTraducer.end())
558 string what(
"Loop::releaseDelegateOf Port with name "); what+=portCasted->
getName(); what+=
" not exported by loop "; what+=_name;
563 port=(*iter)->getInputDataStreamPort(
"");
564 if((*iter)->loopHasOneLessRef())
566 (*iter)->getOutputPort(
"")->removeInPort(portCasted,
false);
568 _inputsTraducer.erase(iter);
577 set<DFToDSForLoop*>::iterator iter;
578 for(iter=_outputsTraducer.begin();iter!=_outputsTraducer.end();iter++)
579 if((*iter)->getOutputDataStreamPort(
"")==portUp)
581 if((*iter)->loopHasOneLessRef())
583 portDwn->removeInPort((*iter)->getInputPort(
""),
false);
585 _outputsTraducer.erase(iter);
615 for(list<ComposedNode *>::const_iterator iter=pointsOfView.begin();iter!=pointsOfView.end() && !
ret;iter++)
616 ret=(*iter)->isRepeatedUnpredictablySeveralTimes();
631 return edAddLink(start,end);
640 os <<
" subgraph cluster_" <<
getId() <<
" {\n" ;
648 os <<
getId() <<
"[fillcolor=\"" ;
651 os <<
"\" label=\"" <<
"Loop:" ;
663 std::vector<OutPort *>& fwCross,
671 throw Exception(
"Internal error occured - cross type link detected on decision port of a loop. Forbidden !");
677 DEBTRACE(
"Loop::checkBasicConsistency");
680 throw Exception(
"For a loop, internal node is mandatory");