Salome HOME
NRI : Merge from 1.2c.
[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       DataFlow( CORBA::ORB_ptr ORB, SALOME_NamingService* ptrNamingService ,
47                 const SALOME_ModuleCatalog::Service& DataFlowService ,
48                 const char *DataFlowComponentName ,
49                 const char *DataFlowInterfaceName ,
50                 const char *DataFlowName ,
51                 const SUPERV::KindOfNode DataFlowkind = SUPERV::ComputingNode ,
52                 const SUPERV::SDate DataFlowFirstCreation = SUPERV::SDate() ,
53                 const SUPERV::SDate DataFlowLastModification = SUPERV::SDate() ,
54                 const char * DataFlowEditorRelease = NULLSTRING ,
55                 const char * DataFlowAuthor = NULLSTRING ,
56                 const char * DataFlowComputer = NULLSTRING ,
57                 const char * DataFlowComment = NULLSTRING ,
58                 const char * DebugFileName = NULLSTRING ) ;
59       virtual ~DataFlow();
60
61       bool LoadDataFlow( const GraphBase::SGraph &aDataFlow ) ;
62       bool LoadXml( const char* myFileName ) ;
63
64       const SALOME_ModuleCatalog::Service * NodeService( const char * NodeName ) ;
65
66       bool ChangeInputData( const char* ToNodeName ,
67                             const char* ToParameterName ,
68                             const CORBA::Any aValue = CORBA::Any() ) ;
69       bool AddInputSharedData( const char* ToNodeName1 ,
70                                const char* ToParameterName1 ,
71                                const char* ToNodeName2 ,
72                                const char* ToParameterName2 ) ;
73
74       bool IsValid() ;
75       bool IsExecutable() ;
76
77       bool Run( const bool AndSuspend ) ;
78       bool Run( const char * aNodeName ,
79                 const char * AtNodeName , const bool AndSuspend ) ;
80
81       long LastLevelDone() ;
82
83       SUPERV::GraphState State() ;
84       SUPERV::GraphState State(const char * aNodeName ) ;
85       SUPERV::GraphState State( const char * aNodeName ,
86                                  const char * anOutServiceParameterName ) ;
87
88       long Thread() ;
89       long Thread(const char * aNodeName ) ;
90
91       SUPERV::AutomatonState AutomatonState() ;
92       SUPERV::AutomatonState AutomatonState(const char * aNodeName ) ;
93
94       SUPERV::ControlState ControlState() ;
95       SUPERV::ControlState ControlState(const char * aNodeName ) ;
96       void ControlClear() ;
97       void ControlClear(const char * aNodeName ) ;
98
99       bool Event( char ** aNodeName ,
100                   SUPERV::GraphEvent & anEvent ,
101                   SUPERV::GraphState & aState ,
102                   bool WithWait = true ) ;
103       bool EventW( char ** aNodeName ,
104                    SUPERV::GraphEvent & anEvent ,
105                    SUPERV::GraphState & aState ) ;
106
107       bool IsWaiting() ;
108       bool IsReady() ;
109       bool IsRunning() ;
110       bool IsDone() ;
111       bool IsSuspended() ;
112       bool IsWaiting(const char * aNodeName ) ;
113       bool IsReady(const char * aNodeName ) ;
114       bool IsRunning(const char * aNodeName ) ;
115       bool IsDone(const char * aNodeName ) ;
116       bool IsSuspended(const char * aNodeName ) ;
117       bool IsDone(const char * aNodeName ,
118                   const char * anOutServiceParameterName ) ;
119
120       const CORBA::Any *GetInData( const char * ToNodeName ,
121                                    const char * ToParameterName ) ;
122       const CORBA::Any *GetOutData( const char * FromNodeName ,
123                                     const char * FromParameterName ) ;
124
125       long Threads() ;
126
127       bool ReadyWait() ;
128       bool RunningWait() ;
129       bool DoneWait() ;
130       bool SuspendedWait() ;
131       bool ReadyWait(const char * aNodeName ) ;
132       bool RunningWait(const char * aNodeName ) ;
133       bool DoneWait(const char * aNodeName ) ;
134       bool SuspendedWait(const char * aNodeName ) ;
135
136       bool Ping(const char * aNodeName ) ;
137       bool ContainerKill() ;
138       bool ContainerKill(const char * aNodeName ) ;
139
140       bool Kill() ;
141       bool Kill(const char * aNodeName ) ;
142       bool KillDone(const char * aNodeName ) ;
143       bool Suspend() ;
144       bool Suspend(const char * aNodeName ) ;
145       bool SuspendDone() ;
146       bool SuspendDone(const char * aNodeName ) ;
147       bool Resume() ;
148       bool Resume(const char * aNodeName ) ;
149       bool Stop() ;
150       bool Stop(const char * aNodeName ) ;
151
152   };
153
154 };
155
156 #include "DataFlowExecutor_DataFlow.lxx"
157
158 ostream & operator << (ostream &,const GraphExecutor::DataFlow & G);
159 ostream & operator << (ostream &,const SUPERV::SDate &);
160
161 #endif
162
163
164