Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_DataFlow.hxx
1 //  SUPERV GraphExecutor : contains classes that permit execution of graphs and particularly the execution automaton
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : DataFlowExecutor_DataFlow.hxx
25 //  Module : SUPERV
26
27 #ifndef _DATAFLOWEXECUTOR_DATAFLOW_HXX
28 #define _DATAFLOWEXECUTOR_DATAFLOW_HXX
29
30 #include "DataFlowExecutor_OutNode.hxx"
31
32 namespace GraphExecutor {
33
34   class DataFlow : public GraphExecutor::OutNode {
35     
36     private :
37
38       SALOME_NamingService* _theNamingService ;
39
40     public:
41
42       DataFlow();
43       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
44                 const char * DataFlowName ,
45                 const char * DebugFileName ,
46                 const SUPERV::KindOfNode aKindOfNode );
47       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
48                 const SALOME_ModuleCatalog::Service& DataFlowService ,
49                 const char *DataFlowComponentName ,
50                 const char *DataFlowInterfaceName ,
51                 const char *DataFlowName ,
52                 const SUPERV::KindOfNode DataFlowkind = SUPERV::ComputingNode ,
53                 const SUPERV::SDate DataFlowFirstCreation = SUPERV::SDate() ,
54                 const SUPERV::SDate DataFlowLastModification = SUPERV::SDate() ,
55                 const char * DataFlowEditorRelease = NULLSTRING ,
56                 const char * DataFlowAuthor = NULLSTRING ,
57                 const char * DataFlowComputer = NULLSTRING ,
58                 const char * DataFlowComment = NULLSTRING ,
59                 const char * DebugFileName = NULLSTRING ) ;
60       virtual ~DataFlow();
61
62       bool LoadDataFlow( const GraphBase::SGraph * aDataFlow ) ;
63 //      bool LoadXml( const char* myFileName ) ;
64
65       const SALOME_ModuleCatalog::Service * NodeService( const char * NodeName ) ;
66
67       bool AddInputData( const char * ToNodeName ,
68                          const char * ToParameterName ,
69                          const CORBA::Any aValue = CORBA::Any() ) ;
70       bool ChangeInputData( const char * ToNodeName ,
71                             const char * ToParameterName ,
72                             const CORBA::Any aValue = CORBA::Any() ) ;
73       bool InputOfAny( const char * ToServiceParameterName ,
74                        const CORBA::Any & aValue ,
75                        const bool SomeDataReady = true ) ;
76
77       bool OutputOfAny( const char * aNodeName ,
78                         const char * ToServiceParameterName ,
79                         const CORBA::Any & aValue ) ;
80
81       bool IsValid() ;
82       bool IsExecutable() ;
83
84       bool Run( const bool AndSuspend ) ;
85       bool Run( const char * aNodeName ,
86                 const char * AtNodeName , const bool AndSuspend ) ;
87
88       long LastLevelDone() ;
89
90       void State(GraphExecutor::AutomatonState aState ) ;
91       SUPERV::GraphState State() ;
92       SUPERV::GraphState State(const char * aNodeName ) ;
93       SUPERV::GraphState State( const char * aNodeName ,
94                                  const char * anOutServiceParameterName ) ;
95
96       long Thread() ;
97       long Thread(const char * aNodeName ) ;
98
99       GraphExecutor::AutomatonState AutomatonState() ;
100       GraphExecutor::AutomatonState AutomatonState(const char * aNodeName ) ;
101
102       SUPERV::ControlState ControlState() ;
103       SUPERV::ControlState ControlState(const char * aNodeName ) ;
104       void ControlClear() ;
105       void ControlClear(const char * aNodeName ) ;
106
107       bool Event( char ** aNodeName ,
108                   SUPERV::GraphEvent & anEvent ,
109                   SUPERV::GraphState & aState ,
110                   bool WithWait = true ) ;
111       bool EventW( char ** aNodeName ,
112                    SUPERV::GraphEvent & anEvent ,
113                    SUPERV::GraphState & aState ) ;
114       long EventQSize() ;
115
116       bool IsWaiting() ;
117       bool IsReady() ;
118       bool IsRunning() ;
119       bool IsDone() ;
120       bool IsSuspended() ;
121       bool IsWaiting(const char * aNodeName ) ;
122       bool IsReady(const char * aNodeName ) ;
123       bool IsRunning(const char * aNodeName ) ;
124       bool IsDone(const char * aNodeName ) ;
125       bool IsSuspended(const char * aNodeName ) ;
126       bool IsDone(const char * aNodeName ,
127                   const char * anOutServiceParameterName ) ;
128
129       const CORBA::Any *GetInData( const char * ToNodeName ,
130                                    const char * ToParameterName ) ;
131       const CORBA::Any *GetOutData( const char * FromNodeName ,
132                                     const char * FromParameterName ) ;
133
134       long Threads() ;
135
136       bool ReadyWait() ;
137       bool RunningWait() ;
138       bool DoneWait() ;
139       bool SuspendedWait() ;
140       bool ReadyWait(const char * aNodeName ) ;
141       bool RunningWait(const char * aNodeName ) ;
142       bool DoneWait(const char * aNodeName ) ;
143       bool SuspendedWait(const char * aNodeName ) ;
144
145       bool Ping(const char * aNodeName ) ;
146       bool ContainerKill() ;
147       bool ContainerKill(const char * aNodeName ) ;
148
149       bool Kill() ;
150       bool Kill(const char * aNodeName ) ;
151       bool KillDone(const char * aNodeName ) ;
152       bool Suspend() ;
153       bool Suspend(const char * aNodeName ) ;
154       bool SuspendDone() ;
155       bool SuspendDone(const char * aNodeName ) ;
156       bool Resume() ;
157       bool Resume(const char * aNodeName ) ;
158       bool Stop() ;
159       bool Stop(const char * aNodeName ) ;
160
161   };
162
163 };
164
165 #include "DataFlowExecutor_DataFlow.lxx"
166
167 ostream & operator << (ostream &,const GraphExecutor::DataFlow & G);
168 ostream & operator << (ostream &,const SUPERV::SDate &);
169
170 #endif
171
172
173