Salome HOME
46ee2abfc951aa54bae471c7e56e02044382e856
[modules/yacs.git] / src / engine / InGate.hxx
1 // Copyright (C) 2006-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __INGATE_HXX__
21 #define __INGATE_HXX__
22
23 #include "YACSlibEngineExport.hxx"
24 #include "Port.hxx"
25 #include "define.hxx"
26
27 #include <map>
28 #include <list>
29
30 namespace YACS
31 {
32   namespace ENGINE
33   {
34     class OutGate;
35
36     class YACSLIBENGINE_EXPORT InGate : public Port
37     {
38       friend class Bloc;
39       friend class Node;
40     protected:
41       static const char NAME[];
42     private:
43       std::map< OutGate *, bool > _backLinks;
44     public:
45       InGate(Node *node);
46       virtual ~InGate();
47       std::string getNameOfTypeOfCurrentInstance() const;
48       void exNotifyFromPrecursor(OutGate *fromgate);
49       std::map<OutGate *, bool>& edMapOutGate() { return _backLinks; }
50       void edAppendPrecursor(OutGate *fromgate);
51       void edRemovePrecursor(OutGate *fromgate);
52       int getNumberOfBackLinks() const;
53       void edDisconnectAllLinksToMe();
54       void exNotifyFailed();
55       void exNotifyDisabled();
56       void exReset();
57       bool exIsReady() const;
58       std::list<OutGate *> getBackLinks();
59       void setPrecursorDone(OutGate *fromgate);
60       virtual std::string typeName() {return "YACS__ENGINE__InGate";}
61     };
62   }
63 }
64
65 #endif