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