46 _indexPort(NAME_OF_INDEX,this,
Runtime::_tc_int)
51 _nbOfTimesPort(other._nbOfTimesPort,this),
52 _indexPort(other._indexPort,this)
56 std::vector< std::pair<OutPort *, InPort *> >::iterator iter=linksToReproduce.begin();
57 for(;iter!=linksToReproduce.end();++iter)
60 InPort* pin = iter->second;
67 return new ForLoop(*
this,father,editionOnly);
148 DEBTRACE(
"ForLoop::updateStateOnFinishedEventFrom " << node->
getName());
180 list<InputPort *> ret;
201 list<OutputPort *> ret;
208 std::vector<OutPort *>& fwCross,
216 throw Exception(
"Internal error occured - cross type link detected on decision port of a loop. Forbidden !");
221 bool direction,
LinkInfo& info)
const
223 const char what[]=
"ForLoop::checkCFLinks : internal error.";
238 Node *nodeStart=(*(starts.begin()))->getNode();
248 if(nodeEnd!=nodeStart)
254 else if(alreadyFed==
FED_ST)
273 if (aNbStepsPort && !aNbStepsPort->
isEmpty())
280 std::stringstream aProgress;
288 return aProgress.str();
299 list<ProgressWeight> ret;
303 for(list<Node *>::const_iterator iter=setOfNode.begin();iter!=setOfNode.end();iter++)
305 list<ProgressWeight> myCurrentSet=(*iter)->getProgressWeight();
306 for(list<ProgressWeight>::iterator iter=myCurrentSet.begin();iter!=myCurrentSet.end();iter++)
308 (*iter).weightDone=((*iter).weightTotal) * nbStepsDone;
309 (*iter).weightTotal*=nbStepsTotal;
311 ret.insert(ret.end(),myCurrentSet.begin(),myCurrentSet.end());
virtual void put(const void *data)
: Interface for management of storage of data formated dynamically in its TypeCode....
static AtomAny * New(T val)
Base class for all composed nodes.
static const unsigned char FREE_ST
OutPort * getOutPort(const std::string &name) const
std::vector< std::pair< OutPort *, InPort * > > getSetOfInternalLinks() const
std::string getName() const
void solveObviousOrDelegateCFLinks(const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const
OutputPort * getOutputPort(const std::string &name) const
Get an output port given its name.
InputPort * getInputPort(const std::string &name) const
Get an input port given its name.
std::list< OutputPort * > getSetOfOutputPort() const
std::set< OutPort * > getAllOutPortsLeavingCurrentScope() const
List all output ports of children nodes that are linked to out of scope input ports.
std::string getPortName(const PORT *port) const
static const unsigned char FED_ST
bool edAddLink(OutPort *start, InPort *end)
Add a dataflow link between two data ports.
Node * isInMyDescendance(Node *nodeToTest) const
Returns the parent of a node that is the direct child of this node.
OutputPort * getOutputPort(const std::string &name) const
Get an output port given its name.
std::list< InputPort * > getLocalInputPorts() const
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
void exUpdateState()
Update the state of the for loop.
virtual void accept(Visitor *visitor)
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
std::string getProgress() const
std::list< OutputPort * > getSetOfOutputPort() const
void checkCFLinks(const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const
check control flow links
InputPort * getInputPort(const std::string &name) const
Get an input port given its name.
ForLoop(const ForLoop &other, ComposedNode *father, bool editionOnly)
static const char NAME_OF_NSTEPS_NUMBER[]
OutPort * getOutPort(const std::string &name) const
void init(bool start=true)
Initialize the node.
static const char NAME_OF_INDEX[]
YACS::Event updateStateOnFinishedEventFrom(Node *node)
Method used to notify the node that a child node has ended.
AnyInputPort _nbOfTimesPort
std::list< ProgressWeight > getProgressWeight() const
Get the progress weight for all elementary nodes.
std::list< OutputPort * > getLocalOutputPorts() const
redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself
Node * simpleClone(ComposedNode *father, bool editionOnly=true) const
Class that deal with list of semantics links for high level analysis.
void pushInfoLink(OutPort *semStart, InPort *end, InfoReason reason)
Base class for loop node.
void init(bool start=true)
std::list< Node * > edGetDirectDescendants() const
friend class FakeNodeForLoop
FakeNodeForLoop * _nodeForNullTurnOfLoops
Base class for all nodes.
virtual void exUpdateState()
Update the node state.
virtual void init(bool start=true)
void setState(YACS::StatesForNode theState)
Sets the given state for node.
virtual void sendEvent(const std::string &event)
emit notification to all observers registered with the dispatcher
InPort * getInPort(const std::string &name) const
const std::string & getName() const
YACS::StatesForNode _state
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
virtual void visitForLoop(ForLoop *node)=0