]> SALOME platform Git repositories - modules/yacs.git/blob - src/engine/InGate.cxx
Salome HOME
PR: first version from Antony GEAY, with directory restructuration
[modules/yacs.git] / src / engine / InGate.cxx
1 #include "InGate.hxx"
2 #include "Node.hxx"
3
4 using namespace YACS::ENGINE;
5
6 const char InGate::NAME[]="InGate";
7
8 InGate::InGate(Node *node):Port(node),_nbPrecursor(0),_nbPrecursorDone(0),_colour(YACS::White)
9 {
10 }
11
12 std::string InGate::getNameOfTypeOfCurrentInstance() const
13 {
14   return NAME;
15 }
16
17 void InGate::exNotifyFromPrecursor()
18 {
19   _nbPrecursorDone++;
20   if(exIsReady() && _node)
21     _node->exUpdateState();
22 }
23
24 void InGate::edAppendPrecursor()
25 {
26   _nbPrecursor++;
27 }
28
29 void InGate::edRemovePrecursor()
30 {
31   _nbPrecursor--;
32 }
33
34 void InGate::edSet(int nbOfPrecursors)
35 {
36   _nbPrecursor=nbOfPrecursors;
37 }
38
39 void InGate::exReset()
40 {
41   _nbPrecursorDone=0;
42 }
43
44 bool InGate::exIsReady() const
45 {
46   return _nbPrecursor==_nbPrecursorDone;
47 }