]> SALOME platform Git repositories - modules/superv.git/blob - src/GraphExecutor/DataFlowExecutor_DataFlow.cxx
Salome HOME
36d198c872b3e9f777314155e0618d8e55869f76
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_DataFlow.cxx
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.cxx
25 //  Module : SUPERV
26
27 using namespace std;
28 #include "DataFlowExecutor_DataFlow.hxx"
29
30 // Implementation de la classe GraphExecutor::Graph
31
32 GraphExecutor::DataFlow::DataFlow() :
33   OutNode() {
34   cdebug_in << "GraphExecutor::DataFlow::DataFlowExecutor()" << endl;
35
36   _theNamingService = NULL ;
37   
38   cdebug_out << "GraphExecutor::DataFlow::DataFlowExecutor()" << endl;
39 }
40
41 GraphExecutor::DataFlow::DataFlow( CORBA::ORB_ptr ORB,
42                                    SALOME_NamingService* ptrNamingService ,
43                                    const char *DataFlowName ,
44                                    const char * DebugFileName ,
45                                    const SUPERV::KindOfNode aKindOfNode ) :
46   OutNode( ORB, ptrNamingService , DataFlowName , DebugFileName , aKindOfNode ) {
47   cdebug_in << "GraphExecutor::DataFlow::DataFlow(" ;
48   if ( DataFlowName ) {
49     cdebug << DataFlowName ;
50   }
51   cdebug << ")" << endl;
52
53   _theNamingService = ptrNamingService ;
54
55   cdebug_out << "GraphExecutor::DataFlow::DataFlow" << endl;
56 }
57
58 GraphExecutor::DataFlow::DataFlow(
59                      CORBA::ORB_ptr ORB,
60                      SALOME_NamingService* ptrNamingService ,
61                      const SALOME_ModuleCatalog::Service& DataFlowService ,
62                      const char *DataFlowComponentName ,
63                      const char *DataFlowInterfaceName ,
64                      const char *DataFlowName ,
65                      const SUPERV::KindOfNode DataFlowkind ,
66                      const SUPERV::SDate DataFlowFirstCreation ,
67                      const SUPERV::SDate DataFlowLastModification ,
68                      const char * DataFlowExecutorRelease ,
69                      const char * DataFlowAuthor ,
70                      const char * DataFlowComputer ,
71                      const char * DataFlowComment ,
72                      const char * DebugFileName ) :
73      OutNode( ORB, ptrNamingService , DataFlowService , DataFlowComponentName ,
74               DataFlowInterfaceName , DataFlowName , DataFlowkind ,
75               DataFlowFirstCreation , DataFlowLastModification  ,
76               DataFlowExecutorRelease , DataFlowAuthor ,
77               DataFlowComputer , DataFlowComment , DebugFileName ) {
78   cdebug_in << "GraphExecutor::DataFlow::DataFlow(" << DataFlowName << ")" << endl;
79
80   _theNamingService = ptrNamingService ;
81
82   cdebug_out << "GraphExecutor::DataFlow::DataFlow" << endl;
83 } ;
84
85 GraphExecutor::DataFlow::~DataFlow() {
86 //  delete _DataFlowNode ;
87 //  delete _DataFlowDatas ;
88 //  delete _GT ;
89 }
90
91 bool GraphExecutor::DataFlow::Ping( const char *aNodeName ) {
92   cdebug_in << "GraphExecutor::DataFlow::Ping" << aNodeName << " )" << endl;
93   bool RetVal = false ;
94   if ( Graph()->GetGraphNode( aNodeName ) )
95     RetVal = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode())->Ping() ;
96   cdebug_out << "GraphExecutor::DataFlow::Ping" << endl;
97   return RetVal ;
98 }
99
100 bool GraphExecutor::DataFlow::ContainerKill() {
101   cdebug_in << "GraphExecutor::DataFlow::ContainerKill()" << endl;
102   bool RetVal = GraphExecutor::OutNode::ContainerKill() ;
103   cdebug_out << "GraphExecutor::DataFlow::ContainerKill()" << endl;
104   return RetVal ;
105 }
106
107 bool GraphExecutor::DataFlow::ContainerKill( const char *aNodeName ) {
108 //  cdebug_in << "GraphExecutor::DataFlow::ContainerKill( " << aNodeName << " )"<< endl;
109   bool RetVal = false ;
110   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
111   if ( aNode ) {
112     RetVal = aNode->ContainerKill() ;
113   }
114 //  cdebug_out << "GraphExecutor::DataFlow::ContainerKill" << endl;
115   return RetVal ;
116 }
117
118 bool GraphExecutor::DataFlow::Kill() {
119   cdebug_in << "GraphExecutor::DataFlow::Kill()" << endl;
120   bool RetVal = GraphExecutor::OutNode::Kill() ;
121   cdebug_out << "GraphExecutor::DataFlow::Kill()" << endl;
122   return RetVal ;
123 }
124
125 bool GraphExecutor::DataFlow::Kill( const char *aNodeName ) {
126 //  cdebug_in << "GraphExecutor::DataFlow::Kill( " << aNodeName << " )"<< endl;
127   bool RetVal = false ;
128   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
129   if ( aNode ) {
130     RetVal = aNode->Kill() ;
131   }
132 //  cdebug_out << "GraphExecutor::DataFlow::Kill" << endl;
133   return RetVal ;
134 }
135
136 bool GraphExecutor::DataFlow::KillDone( const char *aNodeName ) {
137 //  cdebug_in << "GraphExecutor::DataFlow::KillDone( " << aNodeName << " )"<< endl;
138   bool RetVal = false ;
139   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
140   if ( aNode ) {
141     RetVal = aNode->KillDone() ;
142   }
143 //  cdebug_out << "GraphExecutor::DataFlow::KillDone" << endl;
144   return RetVal ;
145 }
146
147 bool GraphExecutor::DataFlow::Suspend() {
148   cdebug_in << "GraphExecutor::DataFlow::Suspend()" << endl;
149   bool RetVal = GraphExecutor::OutNode::Suspend() ;
150   cdebug_out << "GraphExecutor::DataFlow::Suspend()" << RetVal << endl;
151   return RetVal ;
152 }
153
154 bool GraphExecutor::DataFlow::Suspend( const char *aNodeName ) {
155 //  cdebug_in << "GraphExecutor::DataFlow::Suspend( " << aNodeName << " )"<< endl;
156   bool RetVal = false ;
157   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
158   if ( aNode ) {
159     RetVal = aNode->Suspend() ;
160   }
161 //  cdebug_out << "GraphExecutor::DataFlow::Suspend" << endl;
162   return RetVal ;
163 }
164
165 bool GraphExecutor::DataFlow::SuspendDone() {
166   cdebug_in << "GraphExecutor::DataFlow::SuspendDone()" << endl;
167   bool RetVal = false ;
168   cdebug << "Kill not yet implemented." << endl;
169   cdebug_out << "GraphExecutor::DataFlow::SuspendDone()" << endl;
170   return RetVal ;
171 }
172
173 bool GraphExecutor::DataFlow::SuspendDone( const char *aNodeName ) {
174 //  cdebug_in << "GraphExecutor::DataFlow::SuspendDone( " << aNodeName << " )"<< endl;
175   bool RetVal = false ;
176   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
177   if ( aNode ) {
178     RetVal = aNode->SuspendDone() ;
179   }
180 //  cdebug_out << "GraphExecutor::DataFlow::SuspendDone" << endl;
181   return RetVal ;
182 }
183
184 bool GraphExecutor::DataFlow::Resume() {
185   cdebug_in << "GraphExecutor::DataFlow::Resume()" << endl;
186   bool RetVal = GraphExecutor::OutNode::Resume() ;
187   cdebug_out << "GraphExecutor::DataFlow::Resume()" << RetVal << endl;
188   return RetVal ;
189 }
190
191 bool GraphExecutor::DataFlow::Resume( const char *aNodeName ) {
192 //  cdebug_in << "GraphExecutor::DataFlow::Resume( " << aNodeName << " )"<< endl;
193   bool RetVal = false ;
194   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
195   if ( aNode ) {
196     RetVal = aNode->Resume() ;
197   }
198 //  cdebug_out << "GraphExecutor::DataFlow::Resume" << endl;
199   return RetVal ;
200 }
201
202 bool GraphExecutor::DataFlow::Stop() {
203   cdebug_in << "GraphExecutor::DataFlow::Stop()" << endl;
204   bool RetVal = GraphExecutor::OutNode::Stop() ;
205   cdebug_out << "GraphExecutor::DataFlow::Stop()" << endl;
206   return RetVal ;
207 }
208
209 bool GraphExecutor::DataFlow::Stop( const char *aNodeName ) {
210 //  cdebug_in << "GraphExecutor::DataFlow::Stop( " << aNodeName << " )"<< endl;
211   bool RetVal = false ;
212   GraphExecutor::InNode * aNode = ((GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode()) ;
213   if ( aNode ) {
214     RetVal = aNode->Stop() ;
215   }
216 //  cdebug_out << "GraphExecutor::DataFlow::Stop" << endl;
217   return RetVal ;
218 }
219