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