73 for(vector<Container *>::iterator iterCt=conts.begin();iterCt!=conts.end();iterCt++)
78 contCloned=(*iterCt)->
clone();
81 for(vector<ComponentInstance *>::iterator iterCp=comps.begin();iterCp!=comps.end();iterCp++)
86 for(vector<Task *>::iterator iterT=tasks.begin();iterT!=tasks.end();iterT++)
89 list< ElementaryNode * >::iterator res=find(clones.begin(),clones.end(),(
ElementaryNode *)(*iterT));
99 for(vector<Task *>::iterator iterT=tasks.begin();iterT!=tasks.end();iterT++)
101 std::list< ElementaryNode * >::iterator res=find(clones.begin(),clones.end(),(
ElementaryNode *)(*iterT));
119 for(vector<Container *>::iterator iterCt=conts.begin();iterCt!=conts.end();iterCt++)
125 for(vector<ComponentInstance *>::iterator iterCp=comps.begin();iterCp!=comps.end();iterCp++)
130 for(vector<Task *>::iterator iterT=tasks.begin();iterT!=tasks.end();iterT++)
133 list< ElementaryNode * >::iterator res=find(clones.begin(),clones.end(),(
ElementaryNode *)(*iterT));
142 for(vector<Task *>::iterator iterT=tasks.begin();iterT!=tasks.end();iterT++)
144 std::list< ElementaryNode * >::iterator res=find(clones.begin(),clones.end(),(
ElementaryNode *)(*iterT));
180 for(list< ElementaryNode * >::iterator iter=tasks.begin();iter!=tasks.end();iter++)
181 ret.
appendTask(*iter,(*iter)->getDynClonerIfExists(
this));
193 for(list< ElementaryNode * >::iterator iter=tasks.begin();iter!=tasks.end();iter++)
195 switch(ret.
appendTask(*iter,(*iter)->getDynClonerIfExists(
this)))
199 string what(
"ComposedNode::checkDeploymentTree : ServiceNode with name \""); what+=(*iter)->getName();
200 what+=
"\" coexists in a component with an another Task which context is incompatible with it.";
207 string what(
"ComposedNode::checkDeploymentTree : ServiceNode with name \""); what+=(*iter)->getName();
208 what+=
"\" is deployable but no component is specified on it.";
248 DEBTRACE(
"ComposedNode::notifyFrom " << event);
251 Node *lminus1LevelNode=taskTyped;
255 curEvent=curLevelNode->
updateStateFrom(lminus1LevelNode,curEvent,execInst);
258 lminus1LevelNode=curLevelNode;
259 curLevelNode=curLevelNode->
_father;
260 curEvent=curLevelNode->
updateStateFrom(lminus1LevelNode,curEvent,execInst);
275 DEBTRACE(
"ComposedNode::edAddLink");
276 set<OutPort *> represented;
279 if(represented.size()!=1)
282 for(set<OutPort *>::iterator iter=represented.begin();iter!=represented.end();iter++)
298 pair<OutPort *, OutPort *> pO(start,start);
299 while(iterS!=lwstCmnAnctr)
310 bool isLoopProofLink(
true),isFirstTurn(
true);
311 while(iterS!=lwstCmnAnctr)
313 if(!isFirstTurn && iterS->
isLoop())
314 isLoopProofLink=
false;
319 bool ret=(pO.first)->addInPort(currentPortI);
340 <<
" father=" << father->
getName() )
342 <<
" InPort=" << end->
getName() )
349 throw Exception(
"Back link authorized only in special context (loop for example)");
368 DEBTRACE(
"Cycle detected, remove CF link");
392 throw Exception(
"ComposedNode::edAddLink: can not add a control link to a node with itself",1);
395 throw Exception(
"ComposedNode::edAddLink: Trying to add CF link on orphan nodes.");
410 DEBTRACE(
"Cycle detected, remove CF link");
444 throw Exception(
"ComposedNode::edRemoveLink : unexisting link");
453 pair<OutPort *,OutPort *> currentPortO(start,start);
454 vector<pair< ComposedNode * , pair < OutPort* , OutPort *> > > needsToDestroyO;
457 if(*nodeOTemp<*lwstCmnAnctr)
460 while(iterS!=lwstCmnAnctr)
465 what <<
"ComposedNode::edRemoveLink: "
470 OutPort *tmp=currentPortO.first;
471 iterS->
getDelegateOf(currentPortO, end, allAscendanceOfNodeEnd);
472 needsToDestroyO.push_back(pair<
ComposedNode * , pair < OutPort* , OutPort *> >(iterS,pair<OutPort* , OutPort *> (tmp,currentPortO.first)));
477 InPort * currentPortI=end;
478 if(*nodeTemp<*lwstCmnAnctr)
481 while(iterS!=lwstCmnAnctr)
486 what <<
"ComposedNode::edRemoveLink: "
491 iterS->
getDelegateOf(currentPortI, start, allAscendanceOfNodeStart);
497 (currentPortO.first)->removeInPort(currentPortI,
false);
499 (currentPortO.second)->getAllRepresented(repr);
506 vector<pair< ComposedNode * , pair < OutPort* , OutPort *> > >::reverse_iterator iter;
507 for(iter=needsToDestroyO.rbegin();iter!=needsToDestroyO.rend();iter++)
508 (*iter).first->
releaseDelegateOf(((*iter).second).first, ((*iter).second).second, end,allAscendanceOfNodeEnd);
510 if(*nodeTemp<*lwstCmnAnctr)
514 while(iterS!=lwstCmnAnctr)
527 throw Exception(
"edRemoveLink : nodes not in direct descendance of this");
543 string what(
"node "); what+= node->
getName() ; what+=
" is not a child of node "; what +=
getName();
562 std::string& firstPart, std::string& lastPart,
bool priority)
564 const string delims(separator);
565 string portName, nodeName;
566 string::size_type idx;
568 idx = globalName.find_last_of(delims);
570 idx = globalName.find_first_of(delims);
571 if (idx == string::npos)
573 firstPart=globalName;
577 firstPart = globalName.substr(0,idx);
578 lastPart = globalName.substr(idx+1);
579 if ((firstPart.empty()) || (lastPart.empty()))
581 string what(
"the name "); what+= globalName ; what+=
" is not a valid port name";
589 vector< pair<OutPort *, InPort *> > ret;
591 for(list<OutPort *>::const_iterator iter2=temp.begin();iter2!=temp.end();iter2++)
593 set<InPort *> temp2=(*iter2)->edSetInPort();
594 for(set<InPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
596 ret.push_back(pair<OutPort *, InPort *>((*iter2),(*iter3)));
603 vector< pair<OutPort *, InPort *> > ret;
605 for(set<OutPort *>::iterator iter2=ports.begin();iter2!=ports.end();iter2++)
607 set<InPort *> temp2=(*iter2)->edSetInPort();
608 for(set<InPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
610 ret.push_back(pair<OutPort *, InPort *>(*iter2,*iter3));
621 for(list<InputPort *>::iterator iter1=setOfInToTest.begin();iter1!=setOfInToTest.end();iter1++)
623 vector<OutPort *> candidateForAdvCheck;
624 set<OutPort *> outPorts=(*iter1)->edSetOutPort();
626 for(set<OutPort *>::iterator iter2=outPorts.begin();iter2!=outPorts.end();iter2++)
628 (*iter2)->checkConsistency(info);
631 candidateForAdvCheck.push_back(*iter2);
633 if(!candidateForAdvCheck.empty())
641 std::string what=
ex.what();
642 what +=
"\nfor input port: ";
643 what += (*iter1)->getNode()->getName();
645 what += (*iter1)->getName();
652 if(!(*iter1)->canBeNull() && !(*iter1)->edIsManuallyInitialized())
668 if(find(ascendants.begin(),ascendants.end(),nodeC)!=ascendants.end())
670 const char what[]=
"ComposedNode::checkNoCrossHierachyWith : ComposedNode with name \"";
671 string stream(what); stream+=node->
getName(); stream+=
"\" is already in hierarchy ascendance of node with name \"";
672 stream+=
_name; stream+=
"\" ; So it can't be now in its descendance !";
681 for(list<Node *>::iterator iter=nodes.begin();iter!=nodes.end();iter++)
690 for(list<Node *>::iterator iter=nodes.begin();iter!=nodes.end();iter++)
702 list< OutPort *>::const_iterator iter=ports.begin();
703 Node *ret=(*iter)->getNode();
705 for(;iter!=ports.end();iter++)
707 Node *tmp=(*iter)->getNode();
719 map < ComposedNode *, list<OutPort *>,
SortHierarc > outputs;
720 vector<OutPort *> outputsCross;
721 map < ComposedNode *, list<OutPort *>,
SortHierarc > outputsBw;
722 vector<OutPort *>::const_iterator iter1;
725 for(iter1=starts.begin();iter1!=starts.end();iter1++)
731 unsigned char isAlreadyFed=
FREE_ST;
733 if(outputsCross.size()>0)
736 if(outputsCross.size()>1)
737 for(vector< OutPort *>::const_iterator iter1=outputsCross.begin();iter1!=(outputsCross.end()-2);iter1++)
740 map < ComposedNode *, list<OutPort *>,
SortHierarc >::iterator iter3=outputs.begin();
741 for(;iter3!=outputs.end();iter3++)
742 ((*iter3).first)->checkCFLinks((*iter3).second,end,isAlreadyFed,
true,info);
748 map < ComposedNode *, list<OutPort *>,
SortHierarc >::reverse_iterator iter5=outputsBw.rbegin();
749 for(;iter5!=outputsBw.rend();iter5++)
750 ((*iter5).first)->checkCFLinks((*iter5).second,end,isAlreadyFed,
false,info);
759 static const char what[]=
"ComposedNode::solveObviousOrDelegateCFLinks : Internal error occured - uncorrect hierarchy detected !";
768 else if(alreadyFed==
FED_ST)
776 if(levelOfDecision==
this)
790 for(list< OutPort *>::const_iterator iter=starts.begin();iter!=starts.end();iter++)
795 ((
ComposedNode *)levelOfDecision)->checkCFLinks(starts,end,alreadyFed,direction,info);
809 static const char what[]=
"ComposedNode::checkCFLinks : Internal error occured - uncorrect hierarchy detected !";
817 list< OutPort *>::const_iterator iter=starts.begin();
818 Node *nodeStart=(*iter)->getNode();
820 if(nodeEnd!=nodeStart)
823 for(;iter!=starts.end();iter++)
824 if((*iter)->getNode()!=nodeStart)
828 for(iter=starts.begin();iter!=starts.end();iter++)
837 vector< pair<InPort *, OutPort *> > ret;
839 for(set<InPort *>::iterator iter2=ports.begin();iter2!=ports.end();iter2++)
841 set<OutPort *> temp2=(*iter2)->edSetOutPort();
842 for(set<OutPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
845 std::set<OutPort *> trueOutPorts;
846 (*iter3)->getAllRepresented(trueOutPorts);
847 for(std::set<OutPort *>::iterator iter4=trueOutPorts.begin();iter4!=trueOutPorts.end();++iter4)
848 ret.push_back(pair<InPort *, OutPort *>(*iter2,*iter4));
865 for(list<OutPort *>::iterator iter2=temp.begin();iter2!=temp.end();iter2++)
867 set<InPort *> temp2=(*iter2)->edSetInPort();
868 for(set<InPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
889 for(list<InPort *>::iterator iter2=temp.begin();iter2!=temp.end();iter2++)
891 set<OutPort *> temp2=(*iter2)->edSetOutPort();
892 for(set<OutPort *>::iterator iter3=temp2.begin();iter3!=temp2.end();iter3++)
911 vector< pair<OutPort *, InPort *> >::iterator iter;
912 for(iter=linksToDestroy.begin();iter!=linksToDestroy.end();iter++)
915 (*iter).first->removeInPort((*iter).second,
true);
919 vector< pair<InPort *, OutPort *> >::iterator iter2;
920 for(iter2=linksToDestroy2.begin();iter2!=linksToDestroy2.end();iter2++)
923 (*iter2).second->removeInPort((*iter2).first,
true);
938 return find(nodeAncestors.begin(),nodeAncestors.end(),(
ComposedNode *)
this)!=nodeAncestors.end();
955 Node *iterBack=nodeToTest;
957 while(iter!=0 && iter!=
this)
973 if (node->
getName() ==
"thisIsAFakeNode")
975 string child = node->
getName()+
".thisIsAFakeNode";
980 string what(
"node "); what+= node->
getName() ; what+=
" is not a child of node "; what +=
getName();
986 while (father !=
this)
1001 string potentiallyDirectSonName, remainsPath;
1003 potentiallyDirectSonName,remainsPath,
false);
1019 const char whatC[]=
" is not the descendance of node ";
1022 string what(
"node "); what+= nodeToTest->
getName(); what+=
" ";
1023 what+=whatC; what+=
_name;
1029 while(iter!=0 && iter!=
this)
1033 string what(
"node "); what+= nodeToTest->
getName(); what+=
" ";
1034 what+=whatC; what+=
_name;
1052 const char what[]=
"The two nodes do not share the same genealogy";
1060 set<ComposedNode *> s;
1071 set<ComposedNode *>::iterator iter=s.find(temp);
1072 while(temp && iter==s.end())
1088 std::size_t it1_b(0),it1_e(0),it2_b(0),it2_e(0);
1089 while(it1_b!=std::string::npos && it2_b!=std::string::npos)
1093 if(it1_e!=it2_e && it1_e!=std::string::npos && it2_e!=std::string::npos)
1095 std::string elt1(
node1.substr(it1_b,it1_e-it1_b)),elt2(
node2.substr(it2_b,it2_e-it2_b));
1113 for(std::list<Node *>::const_iterator it=dd.begin();it!=dd.end();it++)
1123 list<ElementaryNode *> ret;
1125 for(list<Node *>::const_iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
1127 list<ElementaryNode *> myCurrentSet=(*iter)->getRecursiveConstituents();
1128 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
1138 for(list<Node *>::const_iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
1143 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
1144 ret.push_back(*iter);
1148 list<ElementaryNode *> myCurrentSet=(*iter)->getRecursiveConstituents();
1149 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
1160 for(list<Node *>::iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
1164 list<ElementaryNode *> myCurrentSet=(*iter)->getRecursiveConstituents();
1165 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
1170 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
1173 ret.push_back(
this);
1185 list<ProgressWeight> ret;
1187 for(list<Node *>::const_iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
1190 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
1202 return getPortName<InPort>(inPort);
1207 return getPortName<OutPort>(outPort);
1214 for(list<Node *>::iterator iter=constituents.begin();iter!=constituents.end();iter++)
1215 ret+=(*iter)->getNumberOfInputPorts();
1223 for(list<Node *>::iterator iter=constituents.begin();iter!=constituents.end();iter++)
1224 ret+=(*iter)->getNumberOfOutputPorts();
1231 list<InputPort *> ret;
1232 for(list<Node *>::iterator iter=constituents.begin();iter!=constituents.end();iter++)
1234 list<InputPort *> currentsPorts=(*iter)->getSetOfInputPort();
1235 ret.insert(ret.end(),currentsPorts.begin(),currentsPorts.end());
1243 list<OutputPort *> ret;
1244 for(list<Node *>::iterator iter=constituents.begin();iter!=constituents.end();iter++)
1246 list<OutputPort *> currentsPorts=(*iter)->getSetOfOutputPort();
1247 ret.insert(ret.end(),currentsPorts.begin(),currentsPorts.end());
1255 list<InputDataStreamPort *> ret;
1256 for(list<Node *>::iterator iter=constituents.begin();iter!=constituents.end();iter++)
1258 list<InputDataStreamPort *> currentsPorts=(*iter)->getSetOfInputDataStreamPort();
1259 ret.insert(ret.end(),currentsPorts.begin(),currentsPorts.end());
1267 list<OutputDataStreamPort *> ret;
1268 for(list<Node *>::iterator iter=constituents.begin();iter!=constituents.end();iter++)
1270 list<OutputDataStreamPort *> currentsPorts=(*iter)->getSetOfOutputDataStreamPort();
1271 ret.insert(ret.end(),currentsPorts.begin(),currentsPorts.end());
1278 string portName, nodeName;
1286 string what(
"ComposedNode::getOutPort : the port with name "); what+=name; what+=
" does not exist on the current level";
1304 string portName, nodeName;
1312 string what(
"ComposedNode::getInputPort : the port with name "); what+=name; what+=
" does not exist on the current level";
1324 string portName, nodeName;
1332 string what(
"ComposedNode::getOutputPort : the port with name "); what+=name; what+=
" does not exist on the current level";
1339 string portName, nodeName;
1347 string what(
"ComposedNode::getInputDataStreamPort : the port with name "); what+=name; what+=
" does not exist on the current level";
1354 string portName, nodeName;
1362 string what(
"ComposedNode::getOutputDataStreamPort : the port with name "); what+=name; what+=
" does not exist on the current level";
1410 DEBTRACE(
"updateStateFrom: " <<
ex.what() );
1448 InPort *end,
const std::list<ComposedNode *>& pointsOfViewEnd)
1454 list<ComposedNode *>::const_iterator iter;
1455 for(iter=pointsOfViewStart.begin();iter!=pointsOfViewStart.end() && !isOK;iter++)
1456 isOK=(*iter)->isRepeatedUnpredictablySeveralTimes();
1457 for(iter=pointsOfViewEnd.begin();iter!=pointsOfViewEnd.end() && !isOK;iter++)
1458 isOK=(*iter)->isRepeatedUnpredictablySeveralTimes();
1460 throw Exception(
"ComposedNode::checkLinkPossibility : Request for cross protocol link impossible.");
1498 for(list<Node *>::iterator iter=constituents.begin(); iter!=constituents.end(); iter++)
1500 (*iter)->accept(visitor);
1518 std::list<InputPort *> lip;
return lip;
1524 std::list<OutputPort *> lop;
return lop;
1551 for(list<Node *>::iterator iter=constituents.begin(); iter!=constituents.end(); iter++)
1553 if(!(*iter)->isValid())
1569 std::string report=
"<error node= " +
getName();
1570 switch(effectiveState)
1573 report=report+
" state= INVALID";
1576 report=report+
" state= ERROR";
1579 report=report+
" state= FAILED";
1584 report=report +
">\n" ;
1589 for(list<Node *>::iterator iter=constituents.begin(); iter!=constituents.end(); iter++)
1591 std::string rep=(*iter)->getErrorReport();
1594 report=report+rep+
"\n";
1597 report=report+
"</error>";
1605 DEBTRACE(
"ComposedNode::checkBasicConsistency");
1606 std::list<InputPort *>::const_iterator iter;
1608 for(iter=inports.begin();iter!=inports.end();iter++)
1609 (*iter)->checkBasicConsistency();
1619 DEBTRACE(
"ComposedNode::shutdown");
1621 for(list<Node *>::iterator iter=nodes.begin();iter!=nodes.end();iter++)
1622 (*iter)->shutdown(level);
1631 DEBTRACE(
"ComposedNode::cleanNodes");
1633 for(list<Node *>::iterator iter=nodes.begin();iter!=nodes.end();iter++)
1634 (*iter)->cleanNodes();
1647 for(std::list<Node *>::iterator iter=nodes.begin();iter!=nodes.end();iter++)
1648 (*iter)->resetState(level);
Base class for all component instances.
virtual bool setContainer(Container *cont)
virtual ComponentInstance * clone() const =0
Base class for all composed nodes.
std::list< InputDataStreamPort * > getSetOfInputDataStreamPort() const
std::string getChildName(const Node *node) const
Node * getChildByName(const std::string &name) const
void edDisconnectAllLinksWithMe()
static const unsigned char FREE_ST
DeploymentTree checkDeploymentTree(bool deep) const
Perform check of deployment consistency of the current graph.
std::list< ProgressWeight > getProgressWeight() const
Get the progress weight for all elementary nodes.
std::list< InputPort * > getSetOfInputPort() const
virtual void buildDelegateOf(InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView)
std::list< ElementaryNode * > getRecursiveConstituents() const
std::list< Node * > getAllRecursiveNodes()
Get all children nodes elementary and composed including this node.
void performDuplicationOfPlacement(const Node &other)
performs a duplication of placement using clone method of containers and components....
std::list< OutputPort * > getLocalOutputPorts() const
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
virtual void getDelegateOf(InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView)
OutPort * getOutPort(const std::string &name) const
virtual std::list< Node * > edGetDirectDescendants() const =0
DeploymentTree getDeploymentTree() const
Essentially for test. Use checkDeploymentTree instead to be sure that returned DeploymentTree is cons...
std::vector< std::pair< OutPort *, InPort * > > getSetOfInternalLinks() const
void checkNoCrossHierachyWith(Node *node) const
virtual bool isNameAlreadyUsed(const std::string &name) const
std::string getName() const
void edRemoveCFLink(Node *nodeS, Node *nodeE)
Remove a controlflow link.
void solveObviousOrDelegateCFLinks(const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const
void performShallowDuplicationOfPlacement(const Node &other)
performs a also duplication of placement but here containers and components are not copied at all wha...
OutputPort * getOutputPort(const std::string &name) const
Get an output port given its name.
static const char SEP_CHAR_BTW_LEVEL[]
InputPort * getInputPort(const std::string &name) const
Get an input port given its name.
virtual std::list< Node * > getAllRecursiveConstituents()
Idem getAllRecursiveNodes, but this node is NOT included.
std::list< OutputPort * > getSetOfOutputPort() const
std::list< InputPort * > getLocalInputPorts() const
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
Node * getLowestNodeDealingAll(const std::list< OutPort * > &ports) const
virtual void edRemoveChild(Node *node)
Remove a child node.
virtual void edUpdateState()
update the status of the node
virtual void checkBasicConsistency() const
bool isNodeAlreadyAggregated(const Node *node) const
Check that Node 'node' is already a direct son of this.
virtual std::string getErrorReport()
returns a string that contains an error report if the node is in error
virtual Node * getChildByShortName(const std::string &name) const =0
std::set< OutPort * > getAllOutPortsLeavingCurrentScope() const
List all output ports of children nodes that are linked to out of scope input ports.
static std::string getLowestCommonAncestorStr(const std::string &node1, const std::string &node2)
int getNumberOfOutputPorts() const
YACS::Event updateStateFrom(Node *node, YACS::Event event, const Executor *execInst)
Update node state on receiving event from a node.
void checkLinksCoherenceRegardingControl(const std::vector< OutPort * > &starts, InputPort *end, LinkInfo &info) const
std::list< OutputDataStreamPort * > getSetOfOutputDataStreamPort() const
virtual void removeRecursivelyRedundantCL()
virtual bool isLoop() const
virtual std::vector< std::pair< OutPort *, InPort * > > getSetOfLinksLeavingCurrentScope() const
virtual void shutdown(int level)
Stop all pending activities of the composed node.
virtual void performCFComputations(LinkInfo &info) const
perform recursively all CF computations.
std::string getProperty(const std::string &name) override
virtual std::string getMyQualifiedName(const Node *directSon) const
static bool splitNamesBySep(const std::string &globalName, const char separator[], std::string &firstPart, std::string &lastPart, bool priority)
Splits name globalName in 2 parts using separator.
void checkInMyDescendance(Node *nodeToTest) const
Check if a node is in the descendance of this node.
static const unsigned char FED_ST
virtual bool edAddDFLink(OutPort *start, InPort *end)
Connect an OutPort to an InPort and add the necessary control link.
std::string getOutPortName(const OutPort *) const
std::string getInPortName(const InPort *) const
Get the input port name.
virtual void resetState(int level)
Reset the state of the node and its children depending on the parameter level.
std::set< InPort * > getAllInPortsComingFromOutsideOfCurrentScope() const
List all input ports that are linked to out of scope ports.
virtual void releaseDelegateOf(InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView)
virtual void checkNoCyclePassingThrough(Node *node)=0
OutputDataStreamPort * getOutputDataStreamPort(const std::string &name) const
virtual YACS::Event updateStateOnFailedEventFrom(Node *node, const Executor *execInst)
Method used to notify the node that a child node has failed.
virtual YACS::Event updateStateOnFinishedEventFrom(Node *node)=0
std::string getTaskName(Task *task) const
virtual void checkControlDependancy(OutPort *start, InPort *end, bool cross, std::map< ComposedNode *, std::list< OutPort * >, SortHierarc > &fw, std::vector< OutPort * > &fwCross, std::map< ComposedNode *, std::list< OutPort * >, SortHierarc > &bw, LinkInfo &info) const =0
void accept(Visitor *visitor)
virtual void cleanNodes()
Clean the composed node in case of not clean exit.
virtual bool edAddChild(Node *DISOWNnode)
void init(bool start=true)
int getNumberOfInputPorts() const
static const unsigned char FED_DS_ST
bool edAddCFLink(Node *nodeS, Node *nodeE)
Add a controlflow link between two nodes.
bool edAddLink(OutPort *start, InPort *end)
Add a dataflow link between two data ports.
virtual void destructCFComputations(LinkInfo &info) const
destroy recursively all results of initial computations.
void setProperty(const std::string &name, const std::string &value) override
void checkConsistency(LinkInfo &info) const
void edRemoveLink(OutPort *start, InPort *end)
Remove a dataflow link.
std::vector< Task * > getNextTasks(bool &isMore)
Node * isInMyDescendance(Node *nodeToTest) const
Returns the parent of a node that is the direct child of this node.
virtual void checkLinkPossibility(OutPort *start, const std::list< ComposedNode * > &pointsOfViewStart, InPort *end, const std::list< ComposedNode * > &pointsOfViewEnd)
static ComposedNode * getLowestCommonAncestor(Node *node1, Node *node2)
Retrieves the lowest common ancestor of 2 nodes.
InputDataStreamPort * getInputDataStreamPort(const std::string &name) const
virtual std::vector< std::pair< InPort *, OutPort * > > getSetOfLinksComingInCurrentScope() const
ComposedNode * getRootNode() const
virtual void checkCFLinks(const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const
check control flow links
void notifyFrom(const Task *sender, YACS::Event event, const Executor *execInst)
Notify the node a task has emitted an event.
virtual YACS::Event updateStateOnStartEventFrom(Node *node)
Method used to notify the node that a child node has started.
virtual Container * clone() const =0
WARNING ! clone behaviour MUST be in coherence with what is returned by isAttachedOnCloning() method
std::string getName() const
std::vector< Task * > getTasksLinkedToComponent(ComponentInstance *comp) const
std::vector< ComponentInstance * > getComponentsLinkedToContainer(Container *cont) const
std::vector< Task * > getTasksLinkedToContainer(Container *cont) const
static const unsigned char DUP_TASK_NOT_COMPATIBLE_WITH_EXISTING_TREE
static const unsigned char DEPLOYABLE_BUT_NOT_SPECIFIED
unsigned char appendTask(Task *task, Scheduler *cloner)
std::vector< Container * > getAllContainers() const
Base class for all calculation nodes.
virtual void edNotifyDereferencedBy(OutPort *fromPort)
virtual void edNotifyReferencedBy(OutPort *fromPort, bool isLoopProof=true)
Class for calculation node (function) inlined (and executed) in the schema.
virtual void setContainer(Container *container)
Class that deal with list of semantics links for high level analysis.
void pushErrLink(OutPort *semStart, InPort *end, ErrReason reason)
void pushInfoLink(OutPort *semStart, InPort *end, InfoReason reason)
void pushWarnLink(OutPort *semStart, InPort *end, WarnReason reason)
void setPointOfView(ComposedNode *pov)
Base class for all nodes.
friend class ComposedNode
virtual ComposedNode * getRootNode() const
virtual void setProperty(const std::string &name, const std::string &value)
virtual void getReadyTasks(std::vector< Task * > &tasks)=0
virtual InputDataStreamPort * getInputDataStreamPort(const std::string &name) const =0
virtual void modified()
Sets Node in modified state and its father if it exists.
std::string getQualifiedName() const
same as Node::getName() in most cases, but differs for children of switch
static ComposedNode * checkHavingCommonFather(Node *node1, Node *node2)
virtual Node * getChildByName(const std::string &name) const =0
virtual void init(bool start=true)
virtual OutPort * getOutPort(const std::string &name) const
ComposedNode * getFather() const
std::list< OutPort * > getSetOfOutPort() const
std::list< ComposedNode * > getAllAscendanceOf(ComposedNode *levelToStop=0) const
virtual void resetState(int level)
Reset the node state depending on the parameter level.
std::list< InPort * > getSetOfInPort() const
void setState(YACS::StatesForNode theState)
Sets the given state for node.
static const char SEP_CHAR_IN_PORT[]
const std::string & getName() const
virtual InputPort * getInputPort(const std::string &name) const
virtual void exForwardFailed()
virtual OutputPort * getOutputPort(const std::string &name) const =0
std::string _errorDetails
virtual YACS::StatesForNode getEffectiveState() const
Return the node state in the context of its father.
YACS::StatesForNode _state
virtual std::string getProperty(const std::string &name)
virtual OutputDataStreamPort * getOutputDataStreamPort(const std::string &name) const =0
virtual void edDisconnectAllLinksWithMe()
void edRemoveInGate(InGate *inGate, bool coherenceWithInGate=true)
bool edAddInGate(InGate *inGate)
virtual bool isAlreadyLinkedWith(InPort *withp) const =0
virtual void getAllRepresented(std::set< OutPort * > &represented) const
Class for calculation node associated with a component service.
virtual void setComponent(ComponentInstance *compo)
Associate an existing component instance to this service node AND check the consistency regarding the...
const char * what(void) const noexcept
@ E_ONLY_BACKWARD_DEFINED
@ W_COLLAPSE_EL_AND_USELESS
@ W_BACK_COLLAPSE_EL_AND_USELESS