]> SALOME platform Git repositories - modules/yacs.git/blob - src/engine/WhileLoop.hxx
Salome HOME
copy tag mergefrom_BR_V0_1_CC_Salome_04oct07
[modules/yacs.git] / src / engine / WhileLoop.hxx
1 #ifndef __WHILELOOP_HXX__
2 #define __WHILELOOP_HXX__
3
4 #include "Loop.hxx"
5 #include "ConditionInputPort.hxx"
6
7 namespace YACS
8 {
9   namespace ENGINE
10   {
11 /*! \brief Class for a while loop
12  *
13  * \ingroup Nodes
14  *
15  *  This node makes steps while the condition is true
16  *
17  */
18     class WhileLoop : public Loop
19     {
20     protected:
21       static const char NAME_OF_INPUT_CONDITION[];
22       ConditionInputPort _conditionPort;
23     public:
24       WhileLoop(const WhileLoop& other, ComposedNode *father, bool editionOnly);
25       WhileLoop(const std::string& name);
26       void exUpdateState();
27       void init(bool start=true);
28       InputPort *edGetConditionPort() { return &_conditionPort; }
29       int getNumberOfInputPorts() const;
30       std::list<InputPort *> getSetOfInputPort() const;
31       InputPort* getInputPort(const std::string& name) const throw(Exception);
32       std::list<InputPort *> getLocalInputPorts() const;
33       virtual void accept(Visitor *visitor);
34     protected:
35       Node *simpleClone(ComposedNode *father, bool editionOnly=true) const;
36       void checkLinkPossibility(OutPort *start, const std::set<ComposedNode *>& pointsOfViewStart,
37                                 InPort *end, const std::set<ComposedNode *>& pointsOfViewEnd) throw(Exception);
38       YACS::Event updateStateOnFinishedEventFrom(Node *node);
39     };
40   }
41 }
42
43 #endif