Version: 9.15.0
YACS::ENGINE::WhileLoop Class Reference

Class for a while loop. More...

#include <WhileLoop.hxx>

Inheritance diagram for YACS::ENGINE::WhileLoop:
Collaboration diagram for YACS::ENGINE::WhileLoop:

Public Member Functions

 WhileLoop (const WhileLoop &other, ComposedNode *father, bool editionOnly)
 
 WhileLoop (const std::string &name)
 
void exUpdateState ()
 Update the node state. More...
 
void init (bool start=true)
 
InputPortedGetConditionPort ()
 
InputPortgetInputPort (const std::string &name) const
 Get an input port given its name. More...
 
std::list< InputPort * > getLocalInputPorts () const
 redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself More...
 
virtual void accept (Visitor *visitor)
 
InputPortgetDecisionPort () const
 Returns the port which value is used to take decision about the continuation of the loop. More...
 
virtual std::string typeName ()
 
- Public Member Functions inherited from YACS::ENGINE::Loop
 Loop (const Loop &other, ComposedNode *father, bool editionOnly)
 
 Loop (const std::string &name)
 
 ~Loop ()
 
int getNbOfTurns () const
 
NodeedSetNode (Node *DISOWNnode)
 
virtual bool edAddChild (Node *DISOWNnode)
 
bool isLoop () const override
 
NodeedRemoveNode ()
 
virtual void checkBasicConsistency () const
 
void getReadyTasks (std::vector< Task * > &tasks)
 Collect all the child nodes that are ready. More...
 
void edRemoveChild (Node *node)
 Remove a child node. More...
 
bool isRepeatedUnpredictablySeveralTimes () const
 
std::list< Node * > edGetDirectDescendants () const
 
std::list< InputPort * > getSetOfInputPort () const
 
int getNumberOfInputPorts () const
 
int getMaxLevelOfParallelism () const
 
void getWeightRegardingDPL (ComplexWeight *weight)
 
void partitionRegardingDPL (const PartDefinition *pd, std::map< ComposedNode *, YACS::BASES::AutoRefCnt< PartDefinition > > &zeMap)
 
NodegetChildByShortName (const std::string &name) const
 
virtual bool edAddDFLink (OutPort *start, InPort *end)
 Connect an OutPort to an InPort and add control link if necessary. More...
 
void writeDot (std::ostream &os) const
 Dump the node state to a stream. More...
 
- Public Member Functions inherited from YACS::ENGINE::StaticDefinedComposedNode
bool isPlacementPredictableB4Run () const
 
bool isMultiplicitySpecified (unsigned &value) const
 
void forceMultiplicity (unsigned value)
 
void selectRunnableTasks (std::vector< Task * > &tasks)
 
- Public Member Functions inherited from YACS::ENGINE::ComposedNode
virtual ~ComposedNode ()
 
bool isFinished ()
 
virtual void shutdown (int level)
 Stop all pending activities of the composed node. More...
 
virtual void resetState (int level)
 Reset the state of the node and its children depending on the parameter level. More...
 
std::string getName () const
 
std::string getTaskName (Task *task) const
 
DeploymentTree getDeploymentTree () const
 Essentially for test. Use checkDeploymentTree instead to be sure that returned DeploymentTree is consistent. More...
 
DeploymentTree checkDeploymentTree (bool deep) const
 Perform check of deployment consistency of the current graph. More...
 
std::vector< Task * > getNextTasks (bool &isMore)
 
void notifyFrom (const Task *sender, YACS::Event event, const Executor *execInst)
 Notify the node a task has emitted an event. More...
 
bool edAddLink (OutPort *start, InPort *end)
 Add a dataflow link between two data ports. More...
 
bool edAddLink (OutGate *start, InGate *end)
 Add a controlflow link between two control ports. More...
 
bool edAddCFLink (Node *nodeS, Node *nodeE)
 Add a controlflow link between two nodes. More...
 
void edRemoveCFLink (Node *nodeS, Node *nodeE)
 Remove a controlflow link. More...
 
void edRemoveLink (OutPort *start, InPort *end)
 Remove a dataflow link. More...
 
void edRemoveLink (OutGate *start, InGate *end)
 Remove a controlflow link. More...
 
virtual void removeRecursivelyRedundantCL ()
 
std::list< ElementaryNode * > getRecursiveConstituents () const
 
std::list< Node * > getAllRecursiveNodes ()
 Get all children nodes elementary and composed including this node. More...
 
virtual std::list< Node * > getAllRecursiveConstituents ()
 Idem getAllRecursiveNodes, but this node is NOT included. More...
 
std::list< ProgressWeightgetProgressWeight () const
 Get the progress weight for all elementary nodes. More...
 
std::string getInPortName (const InPort *) const
 Get the input port name. More...
 
std::string getOutPortName (const OutPort *) const
 
int getNumberOfOutputPorts () const
 
std::list< OutputPort * > getSetOfOutputPort () const
 
std::list< OutputPort * > getLocalOutputPorts () const
 redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself More...
 
std::set< OutPort * > getAllOutPortsLeavingCurrentScope () const
 List all output ports of children nodes that are linked to out of scope input ports. More...
 
std::set< InPort * > getAllInPortsComingFromOutsideOfCurrentScope () const
 List all input ports that are linked to out of scope ports. More...
 
std::list< InputDataStreamPort * > getSetOfInputDataStreamPort () const
 
std::list< OutputDataStreamPort * > getSetOfOutputDataStreamPort () const
 
OutPortgetOutPort (const std::string &name) const
 
OutputPortgetOutputPort (const std::string &name) const
 Get an output port given its name. More...
 
InputDataStreamPortgetInputDataStreamPort (const std::string &name) const
 
OutputDataStreamPortgetOutputDataStreamPort (const std::string &name) const
 
std::vector< std::pair< OutPort *, InPort * > > getSetOfInternalLinks () const
 
virtual std::vector< std::pair< OutPort *, InPort * > > getSetOfLinksLeavingCurrentScope () const
 
void checkConsistency (LinkInfo &info) const
 
virtual std::vector< std::pair< InPort *, OutPort * > > getSetOfLinksComingInCurrentScope () const
 
virtual void edUpdateState ()
 update the status of the node More...
 
virtual std::string getErrorReport ()
 returns a string that contains an error report if the node is in error More...
 
ComposedNodegetRootNode () const
 
bool isNodeAlreadyAggregated (const Node *node) const
 Check that Node 'node' is already a direct son of this. More...
 
virtual bool isNameAlreadyUsed (const std::string &name) const
 
NodeisInMyDescendance (Node *nodeToTest) const
 Returns the parent of a node that is the direct child of this node. More...
 
std::string getChildName (const Node *node) const
 
virtual std::string getMyQualifiedName (const Node *directSon) const
 
NodegetChildByName (const std::string &name) const
 
void loaded ()
 
void connected ()
 
virtual void cleanNodes ()
 Clean the composed node in case of not clean exit. More...
 
virtual std::string getProgress () const
 
void setProperty (const std::string &name, const std::string &value) override
 
std::string getProperty (const std::string &name) override
 
- Public Member Functions inherited from YACS::ENGINE::Node
virtual ~Node ()
 
Nodeclone (ComposedNode *father, bool editionOnly=true) const
 This method MUST NEVER BE VIRTUAL More...
 
NodecloneWithoutCompAndContDeepCpy (ComposedNode *father, bool editionOnly=true) const
 This method MUST NEVER BE VIRTUAL More...
 
void setState (YACS::StatesForNode theState)
 Sets the given state for node. More...
 
virtual YACS::StatesForNode getState () const
 
virtual YACS::StatesForNode getEffectiveState () const
 Return the node state in the context of its father. More...
 
virtual YACS::StatesForNode getEffectiveState (const Node *) const
 Return the effective state of a node in the context of this one (its father) More...
 
std::string getColorState (YACS::StatesForNode state) const
 Return the color associated to a state. More...
 
InGategetInGate ()
 
OutGategetOutGate ()
 
const std::string & getName () const
 
void setName (const std::string &name)
 Change the name of the node. More...
 
ComposedNodegetFather () const
 
const std::string getId () const
 
bool exIsControlReady () const
 
std::list< Node * > getOutNodes () const
 
void writeDotInFile (const std::string &fileName) const
 
virtual void exFailedState ()
 Notify this node that its execution has failed. More...
 
virtual void exDisabledState ()
 Notify this node that it has been disabled. More...
 
std::list< InPort * > getSetOfInPort () const
 
std::list< OutPort * > getSetOfOutPort () const
 
virtual std::set< InputPort * > edGetSetOfUnitializedInputPort () const
 Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency. More...
 
virtual bool edAreAllInputPortInitialized () const
 Becomes deprecated soon. Replaced by ComposedNode::CheckConsistency. More...
 
InPortgetInPort (const std::string &name) const
 
InPropertyPortgetInPropertyPort () const
 
std::list< ComposedNode * > getAllAscendanceOf (ComposedNode *levelToStop=0) const
 
bool operator> (const Node &other) const
 
bool operator< (const Node &other) const
 
std::string getImplementation () const
 
DynParaLoopgetClosestDPLAmongAncestors () const
 
std::map< std::string, std::string > getProperties ()
 
std::map< std::string, std::string > getPropertyMap ()
 
virtual void setProperties (std::map< std::string, std::string > properties)
 
virtual ProcgetProc ()
 
virtual const ProcgetProc () const
 
std::string getQualifiedName () const
 same as Node::getName() in most cases, but differs for children of switch More...
 
int getNumId ()
 return node instance identifiant, unique for each node instance More...
 
std::vector< std::pair< std::string, int > > getDPLScopeInfo (ComposedNode *gfn)
 
virtual void applyDPLScope (ComposedNode *gfn)
 
virtual void sendEvent (const std::string &event)
 emit notification to all observers registered with the dispatcher More...
 
virtual void sendEvent2 (const std::string &event, void *something)
 emit notification to all observers registered with the dispatcher More...
 
virtual std::string getErrorDetails () const
 
virtual void setErrorDetails (const std::string &error)
 
virtual void modified ()
 Sets Node in modified state and its father if it exists. More...
 
virtual int isModified ()
 
virtual int isValid ()
 indicates if the node is valid (returns 1) or not (returns 0) More...
 
virtual std::string getContainerLog ()
 returns a string that contains the name of the container log file if it exists More...
 
virtual void ensureLoading ()
 Put this node into TOLOAD state when possible. More...
 
virtual void getCoupledNodes (std::set< Task * > &coupledNodes)
 
- Public Member Functions inherited from YACS::ENGINE::Scheduler
virtual ~Scheduler ()
 

Protected Member Functions

NodesimpleClone (ComposedNode *father, bool editionOnly=true) const
 
void checkLinkPossibility (OutPort *start, const std::list< ComposedNode * > &pointsOfViewStart, InPort *end, const std::list< ComposedNode * > &pointsOfViewEnd)
 
YACS::Event updateStateOnFinishedEventFrom (Node *node)
 Method used to notify the node that a child node has ended. More...
 
- Protected Member Functions inherited from YACS::ENGINE::Loop
void buildDelegateOf (InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView)
 
void buildDelegateOf (std::pair< OutPort *, OutPort * > &port, InPort *finalTarget, const std::list< ComposedNode * > &pointsOfView)
 
void getDelegateOf (InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView)
 
void getDelegateOf (std::pair< OutPort *, OutPort * > &port, InPort *finalTarget, const std::list< ComposedNode * > &pointsOfView)
 
void releaseDelegateOf (InPort *&port, OutPort *initialStart, const std::list< ComposedNode * > &pointsOfView)
 
void releaseDelegateOf (OutPort *portDwn, OutPort *portUp, InPort *finalTarget, const std::list< ComposedNode * > &pointsOfView)
 
void checkNoCyclePassingThrough (Node *node)
 
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
 
void checkCFLinks (const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const
 check control flow links More...
 
- Protected Member Functions inherited from YACS::ENGINE::StaticDefinedComposedNode
 StaticDefinedComposedNode (const std::string &name)
 
 StaticDefinedComposedNode (const StaticDefinedComposedNode &other, ComposedNode *father)
 
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
 
- Protected Member Functions inherited from YACS::ENGINE::ComposedNode
 ComposedNode (const std::string &name)
 
 ComposedNode (const ComposedNode &other, ComposedNode *father)
 
void performDuplicationOfPlacement (const Node &other)
 performs a duplication of placement using clone method of containers and components. clone behaviour is driven by attachOnCloning attribute. More...
 
void performShallowDuplicationOfPlacement (const Node &other)
 performs a also duplication of placement but here containers and components are not copied at all whatever the value of attachedOnCloning. More...
 
void edDisconnectAllLinksWithMe ()
 
YACS::Event updateStateFrom (Node *node, YACS::Event event, const Executor *execInst)
 Update node state on receiving event from a node. More...
 
virtual YACS::Event updateStateOnStartEventFrom (Node *node)
 Method used to notify the node that a child node has started. More...
 
virtual YACS::Event updateStateOnFailedEventFrom (Node *node, const Executor *execInst)
 Method used to notify the node that a child node has failed. More...
 
void checkInMyDescendance (Node *nodeToTest) const
 Check if a node is in the descendance of this node. More...
 
template<class PORT >
std::string getPortName (const PORT *port) const
 
void checkNoCrossHierachyWith (Node *node) const
 
virtual void performCFComputations (LinkInfo &info) const
 perform recursively all CF computations. More...
 
virtual void destructCFComputations (LinkInfo &info) const
 destroy recursively all results of initial computations. More...
 
NodegetLowestNodeDealingAll (const std::list< OutPort * > &ports) const
 
void checkLinksCoherenceRegardingControl (const std::vector< OutPort * > &starts, InputPort *end, LinkInfo &info) const
 
void solveObviousOrDelegateCFLinks (const std::list< OutPort * > &starts, InputPort *end, unsigned char &alreadyFed, bool direction, LinkInfo &info) const
 
- Protected Member Functions inherited from YACS::ENGINE::Node
 Node (const std::string &name)
 
 Node (const Node &other, ComposedNode *father)
 
virtual void exForwardFailed ()
 
virtual void exForwardFinished ()
 

Protected Attributes

ConditionInputPort _conditionPort
 
- Protected Attributes inherited from YACS::ENGINE::Loop
Node_node
 
int _nbOfTurns
 
FakeNodeForLoop_nodeForNullTurnOfLoops
 
std::set< DSToDFForLoop * > _inputsTraducer
 
std::set< DFToDSForLoop * > _outputsTraducer
 
- Protected Attributes inherited from YACS::ENGINE::Node
InGate _inGate
 
OutGate _outGate
 
InPropertyPort_inPropertyPort
 
std::string _name
 
ComposedNode_father
 
YACS::StatesForNode _state
 
int _modified
 
std::string _errorDetails
 
int _numId
 
std::string _implementation
 
std::map< std::string, std::string > _propertyMap
 
Node_eventReceiver =nullptr
 

Static Protected Attributes

static const char NAME_OF_INPUT_CONDITION [] ="condition"
 
- Static Protected Attributes inherited from YACS::ENGINE::ComposedNode
static const unsigned char FED_ST = 2
 
static const unsigned char FREE_ST = 0
 
static const unsigned char FED_DS_ST = 1
 
- Static Protected Attributes inherited from YACS::ENGINE::Node
static const char SEP_CHAR_IN_PORT [] ="."
 
static int _total = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::ENGINE::Loop
static TypeCodeMappingDF2DS (TypeCode *type)
 
static TypeCodeMappingDS2DF (TypeCode *type)
 
- Static Public Member Functions inherited from YACS::ENGINE::ComposedNode
static ComposedNodegetLowestCommonAncestor (Node *node1, Node *node2)
 Retrieves the lowest common ancestor of 2 nodes. More...
 
static std::string getLowestCommonAncestorStr (const std::string &node1, const std::string &node2)
 
- Static Public Member Functions inherited from YACS::ENGINE::Node
static std::string getStateName (YACS::StatesForNode state)
 Return the name of a state. More...
 
static void checkValidityOfNodeName (const std::string &name)
 
- Public Attributes inherited from YACS::ENGINE::Node
YACS::Colour _colour
 
- Static Public Attributes inherited from YACS::ENGINE::ComposedNode
static const char SEP_CHAR_BTW_LEVEL [] ="."
 
- Static Public Attributes inherited from YACS::ENGINE::Node
static std::map< int, Node * > idMap
 
- Static Protected Member Functions inherited from YACS::ENGINE::Loop
static bool isNecessaryToBuildSpecificDelegateDF2DS (const std::list< ComposedNode * > &pointsOfView)
 
- Static Protected Member Functions inherited from YACS::ENGINE::ComposedNode
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. More...
 
- Static Protected Member Functions inherited from YACS::ENGINE::Node
static void checkValidityOfPortName (const std::string &name)
 
static ComposedNodecheckHavingCommonFather (Node *node1, Node *node2)
 

Detailed Description

Class for a while loop.

This node makes steps while the condition is true

Definition at line 38 of file WhileLoop.hxx.

Constructor & Destructor Documentation

◆ WhileLoop() [1/2]

WhileLoop::WhileLoop ( const WhileLoop other,
ComposedNode father,
bool  editionOnly 
)

Definition at line 38 of file WhileLoop.cxx.

38  :Loop(other,father,editionOnly),
39  _conditionPort(other._conditionPort,this)
40 {
41  //Copy Data linking
42  std::vector< std::pair<OutPort *, InPort *> > linksToReproduce=other.getSetOfInternalLinks();
43  std::vector< std::pair<OutPort *, InPort *> >::iterator iter=linksToReproduce.begin();
44  for(;iter!=linksToReproduce.end();++iter)
45  {
46  OutPort* pout = iter->first;
47  InPort* pin = iter->second;
48  edAddLink(getOutPort(other.getPortName(pout)),getInPort(other.getPortName(pin)));
49  }
50 }
OutPort * getOutPort(const std::string &name) const
std::vector< std::pair< OutPort *, InPort * > > getSetOfInternalLinks() const
std::string getPortName(const PORT *port) const
bool edAddLink(OutPort *start, InPort *end)
Add a dataflow link between two data ports.
InPort * getInPort(const std::string &name) const
Definition: Node.cxx:239
ConditionInputPort _conditionPort
Definition: WhileLoop.hxx:42

References YACS::ENGINE::ComposedNode::edAddLink(), YACS::ENGINE::Node::getInPort(), YACS::ENGINE::ComposedNode::getOutPort(), YACS::ENGINE::ComposedNode::getPortName(), and YACS::ENGINE::ComposedNode::getSetOfInternalLinks().

Referenced by simpleClone().

◆ WhileLoop() [2/2]

WhileLoop::WhileLoop ( const std::string &  name)

Definition at line 34 of file WhileLoop.cxx.

35 {
36 }
static const char NAME_OF_INPUT_CONDITION[]
Definition: WhileLoop.hxx:41

Member Function Documentation

◆ accept()

void WhileLoop::accept ( Visitor visitor)
virtual

Reimplemented from YACS::ENGINE::Loop.

Definition at line 130 of file WhileLoop.cxx.

131 {
132  visitor->visitWhileLoop(this);
133 }
virtual void visitWhileLoop(WhileLoop *node)=0

References YACS::ENGINE::Visitor::visitWhileLoop().

◆ checkLinkPossibility()

void WhileLoop::checkLinkPossibility ( OutPort start,
const std::list< ComposedNode * > &  pointsOfViewStart,
InPort end,
const std::list< ComposedNode * > &  pointsOfViewEnd 
)
protectedvirtual

Reimplemented from YACS::ENGINE::ComposedNode.

Definition at line 122 of file WhileLoop.cxx.

126 {
127  DEBTRACE("WhileLoop::checkLinkPossibility");
128 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31

References DEBTRACE.

◆ edGetConditionPort()

◆ exUpdateState()

void WhileLoop::exUpdateState ( )
virtual

Update the node state.

Note
: Update the '_state' attribute. Typically called by 'this->_inGate' when 'this->_inGate' is ready.

Called by InGate::exNotifyFromPrecursor

Reimplemented from YACS::ENGINE::Node.

Definition at line 58 of file WhileLoop.cxx.

59 {
60  if(_state == YACS::DISABLED)
61  return;
62  if(_inGate.exIsReady())
63  {
68  {
70  _nodeForNullTurnOfLoops=new FakeNodeForLoop(this,false,true);
71  }
72  else
74  {
75  bool normalFinish=getAllOutPortsLeavingCurrentScope().empty();
77  _nodeForNullTurnOfLoops=new FakeNodeForLoop(this,normalFinish);
78  }
79  else
80  {
83  }
84  }
85 }
std::set< OutPort * > getAllOutPortsLeavingCurrentScope() const
List all output ports of children nodes that are linked to out of scope input ports.
bool exIsReady() const
Definition: InGate.cxx:126
virtual bool isEmpty()
Definition: InputPort.cxx:70
friend class FakeNodeForLoop
Definition: Loop.hxx:149
FakeNodeForLoop * _nodeForNullTurnOfLoops
Definition: Loop.hxx:154
InGate _inGate
Definition: Node.hxx:86
virtual void exUpdateState()
Update the node state.
Definition: Node.cxx:206
void setState(YACS::StatesForNode theState)
Sets the given state for node.
Definition: Node.cxx:652
YACS::StatesForNode _state
Definition: Node.hxx:91
@ ACTIVATED
Definition: define.hxx:41
@ DISABLED
Definition: define.hxx:50

References _conditionPort, YACS::ENGINE::Node::_inGate, YACS::ENGINE::Loop::_node, YACS::ENGINE::Loop::_nodeForNullTurnOfLoops, YACS::ENGINE::Node::_state, YACS::ACTIVATED, YACS::DISABLED, YACS::ENGINE::InGate::exIsReady(), YACS::ENGINE::Node::exUpdateState(), YACS::ENGINE::Loop::FakeNodeForLoop, YACS::ENGINE::ComposedNode::getAllOutPortsLeavingCurrentScope(), YACS::ENGINE::ConditionInputPort::getValue(), YACS::ENGINE::InputPort::isEmpty(), YACS::ENGINE::ConditionInputPort::isLinkedOutOfScope(), and YACS::ENGINE::Node::setState().

◆ getDecisionPort()

InputPort* YACS::ENGINE::WhileLoop::getDecisionPort ( ) const
inlinevirtual

Returns the port which value is used to take decision about the continuation of the loop.

Implements YACS::ENGINE::Loop.

Definition at line 52 of file WhileLoop.hxx.

52 { return (InputPort *)&_conditionPort; }
friend class InputPort
Definition: Node.hxx:74

◆ getInputPort()

InputPort * WhileLoop::getInputPort ( const std::string &  name) const
virtual

Get an input port given its name.

Contrary to YACS::ENGINE::ComposedNode::getOutputPort, this method is NOT recursive and so the leaf of type ElementaryNode aggregating this InputPort is directly invoked.

Reimplemented from YACS::ENGINE::ComposedNode.

Definition at line 92 of file WhileLoop.cxx.

93 {
94  if(name==NAME_OF_INPUT_CONDITION)
95  return (InputPort*)&_conditionPort;
96  return Loop::getInputPort(name);
97 }
InputPort * getInputPort(const std::string &name) const
Get an input port given its name.
Base class for Input Ports.
Definition: InputPort.hxx:44

References _conditionPort, YACS::ENGINE::ComposedNode::getInputPort(), and NAME_OF_INPUT_CONDITION.

◆ getLocalInputPorts()

std::list< InputPort * > WhileLoop::getLocalInputPorts ( ) const
virtual

redefined on derived class of ComposedNode. by default a ComposedNode has no port by itself

Reimplemented from YACS::ENGINE::ComposedNode.

Definition at line 135 of file WhileLoop.cxx.

136 {
137  list<InputPort *> ret;
138  ret.push_back((InputPort *)&_conditionPort);
139  return ret;
140 }

References _conditionPort.

◆ init()

void WhileLoop::init ( bool  start = true)
virtual

initialisation of all input and output ports and gates, for execution

Reimplemented from YACS::ENGINE::Loop.

Definition at line 52 of file WhileLoop.cxx.

53 {
54  Loop::init(start);
55  _conditionPort.exInit(start);
56 }
virtual void exInit(bool start)
Definition: InputPort.cxx:63
void init(bool start=true)
Definition: Loop.cxx:319

References _conditionPort, YACS::ENGINE::InputPort::exInit(), and YACS::ENGINE::Loop::init().

◆ simpleClone()

Node * WhileLoop::simpleClone ( ComposedNode father,
bool  editionOnly = true 
) const
protectedvirtual

Implements YACS::ENGINE::Node.

Definition at line 87 of file WhileLoop.cxx.

88 {
89  return new WhileLoop(*this,father,editionOnly);
90 }
WhileLoop(const WhileLoop &other, ComposedNode *father, bool editionOnly)
Definition: WhileLoop.cxx:38

References WhileLoop().

◆ typeName()

virtual std::string YACS::ENGINE::WhileLoop::typeName ( )
inlinevirtual

Reimplemented from YACS::ENGINE::Loop.

Definition at line 53 of file WhileLoop.hxx.

53 {return "YACS__ENGINE__WhileLoop";}

◆ updateStateOnFinishedEventFrom()

YACS::Event WhileLoop::updateStateOnFinishedEventFrom ( Node node)
protectedvirtual

Method used to notify the node that a child node has ended.

Update the loop state and return the loop change state

Parameters
node: the child node that has ended
Returns
the loop state change

Implements YACS::ENGINE::ComposedNode.

Definition at line 106 of file WhileLoop.cxx.

107 {
108  _nbOfTurns++;
109  if(!_conditionPort.getValue())
110  {
112  return YACS::FINISH;
113  }
114  else
115  {
116  node->init(false);
117  node->exUpdateState();
118  }
119  return YACS::NOEVENT;
120 }
virtual void init(bool start=true)
Definition: Node.cxx:102
@ NOEVENT
Definition: define.hxx:57
@ FINISH
Definition: define.hxx:59
@ DONE
Definition: define.hxx:43

References _conditionPort, YACS::ENGINE::Loop::_nbOfTurns, YACS::DONE, YACS::ENGINE::Node::exUpdateState(), YACS::FINISH, YACS::ENGINE::ConditionInputPort::getValue(), YACS::ENGINE::Node::init(), YACS::NOEVENT, and YACS::ENGINE::Node::setState().

Member Data Documentation

◆ _conditionPort

ConditionInputPort YACS::ENGINE::WhileLoop::_conditionPort
protected

◆ NAME_OF_INPUT_CONDITION

const char WhileLoop::NAME_OF_INPUT_CONDITION ="condition"
staticprotected

Definition at line 41 of file WhileLoop.hxx.

Referenced by getInputPort().


The documentation for this class was generated from the following files: