34 using namespace YACS::ENGINE;
68 Node::Node(
const std::string& name):_name(name),_inGate(this),_outGate(this),_father(0),_state(
YACS::
READY),
69 _implementation(
Runtime::RUNTIME_ENGINE_INTERACTION_IMPL_NAME),_modified(1)
80 _state(
YACS::
READY),_implementation(other._implementation),
81 _propertyMap(other._propertyMap),_modified(1)
167 std::string what(
"Name ");
169 what+=
" already exists in the scope of "; what+=
_father->
getName();
185 for(list<InGate *>::iterator iter=inGates.begin();iter!=inGates.end();iter++)
186 ret.push_back((*iter)->getNode());
240 ret=getInputPort(name);
244 ret=getInputDataStreamPort(name);
258 if (name ==
"__InPropertyPort__Node__YACS_")
259 return _inPropertyPort;
262 std::string what(
"Node::getInputPort : the port with name "); what+=name; what+=
" does not exist on the current level";
276 ret=getOutputPort(name);
280 ret=getOutputDataStreamPort(name);
289 ret.insert(ret.end(),data.begin(),data.end());
291 ret.insert(ret.end(),ds.begin(),ds.end());
299 ret.insert(ret.end(),data.begin(),data.end());
301 ret.insert(ret.end(),ds.begin(),ds.end());
315 list<ComposedNode *>
ret;
316 if(
this==levelToStop)
326 while(iter!=0 && iter!=
this)
334 while(iter!=0 && iter!=(&other))
336 return iter==(&other);
354 set<InputPort *> setOfUnitializedInputPort;
356 for(list<InputPort *>::const_iterator iter=allOfInputPorts.begin();iter!=allOfInputPorts.end();iter++)
358 if ( ! (*iter)->edIsInitialized() )
359 setOfUnitializedInputPort.insert(*iter);
361 return setOfUnitializedInputPort;
368 return ( setOfUnitializedInputPort.size() == 0);
384 DEBTRACE(
"Node::exForwardFinished");
414 throw Exception(
"No root node");
428 if(name.find(SEP_CHAR_IN_PORT, 0 )!=string::npos)
430 string what(
"Port name "); what+=name; what+=
"not valid because it contains character "; what+=SEP_CHAR_IN_PORT;
441 if(node1!=0 && node2!=0)
443 if(node1->_father==node2->_father)
446 throw Exception(
"check failed : nodes have not the same father");
454 string::size_type debut =
id.find_first_of(
'.');
455 while(debut != std::string::npos){
457 debut=
id.find_first_of(
'.',debut);
464 DEBTRACE(
"Node::setProperty " << name <<
" " << value);
470 std::map<std::string,std::string>::iterator it=
_propertyMap.find(name);
486 amap.insert(fatherMap.begin(),fatherMap.end());
529 switch(effectiveState)
584 os <<
getId() <<
"[fillcolor=\"" ;
627 std::vector< std::pair<std::string,int> >
ret;
630 while(work!=gfn && work!=0)
632 DynParaLoop *workc(dynamic_cast<DynParaLoop *>(work));
658 DEBTRACE(
"Node::sendEvent " << event);
716 return "<error node= "+
getName()+
"state= DISABLED/>\n";
725 std::string report=
"<error node= " ;
727 switch(effectiveState)
730 report=report+
" state= INVALID";
733 report=report+
" state= ERROR";
736 report=report+
" state= FAILED";
739 report=report+
" state= INTERNALERR";
744 report=report +
">\n" ;
746 report=report+
"\n</error>";
788 return nodeStateNameMap[
state];
817 for (std::list<OutGate*>::iterator io = backlinks.begin(); io != backlinks.end(); io++)
819 Node* fromNode = (*io)->getNode();