1 // SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : Graph_Impl.hxx
25 // Author : Jean Rahuel
29 #ifndef _GRAPH_IMPL_HXX_
30 #define _GRAPH_IMPL_HXX_
36 #include <SALOMEconfig.h>
37 #include "SALOME_Component_i.hxx"
38 #include "SALOME_LifeCycleCORBA.hxx"
40 #include "Link_Impl.hxx"
41 #include "FNode_Impl.hxx"
42 #include "GNode_Impl.hxx"
43 #include "LNode_Impl.hxx"
44 #include "ELNode_Impl.hxx"
45 #include "SNode_Impl.hxx"
46 #include "ESNode_Impl.hxx"
48 #include "DataFlowEditor_DataFlow.hxx"
49 #include "DataFlowExecutor_DataFlow.hxx"
51 class Graph_Impl :public INode_Impl ,
52 public POA_SUPERV::Graph {
56 PortableServer::POA_ptr _Poa ;
57 PortableServer::ObjectId * _ContId ;
59 SALOME_NamingService * _NamingService ;
60 char * _DebugFileName ;
62 GraphExecutor::DataFlow * _DataFlowExecutor ;
65 SUPERV::Graph_var myServant; // mpv 23.12.2002: store servant of graph to get constant IOR
69 Graph_Impl( CORBA::ORB_ptr orb ,
70 PortableServer::POA_ptr poa ,
71 PortableServer::ObjectId * contId ,
72 const char *instanceName ,
73 const char *interfaceName ,
74 const char *aDataFlowName ) ;
75 virtual SUPERV::Graph_ptr Copy() ;
77 virtual ~Graph_Impl() ;
78 virtual void destroy() ;
80 virtual char* getIOR();
82 virtual void ReadOnly() ;
84 virtual SUPERV::INode_ptr GetNode() ;
86 // virtual char * DataFlowInfo() ;
87 // virtual char * DataNodeInfo() ;
88 // virtual char * NodeInfo( const char * aNodeName ) ;
90 virtual GraphBase::SGraph * GetGraph() ;
92 virtual bool LoadGraph(const GraphBase::SGraph *aGraph ) ;
93 virtual bool Import(const char * aXmlFile ) ;
95 virtual bool Export(const char * aXmlFile ) ;
98 virtual GraphBase::ListOfNodes * GetNodes() ;
99 virtual GraphBase::ListOfLinks * GetLinks() ;
100 virtual GraphBase::ListOfLinks * GetDatas() ;
103 virtual SUPERV::CNode_ptr CNode(
104 const SALOME_ModuleCatalog::Service &NodeService ) ;
105 virtual SUPERV::FNode_ptr FNode(
106 const char * NodeComponentName ,
107 const char * InterfaceName ,
108 const SALOME_ModuleCatalog::Service &NodeService ) ;
109 virtual SUPERV::INode_ptr INode(
110 const char * FuncName ,
111 const SUPERV::ListOfStrings & PythonFunction ) ;
112 virtual SUPERV::GNode_ptr GNode(
113 const char * FuncName ,
114 const SUPERV::ListOfStrings & PythonFunction ,
115 const char * anInLineNode ) ;
116 virtual SUPERV::LNode_ptr LNode(
117 const char * InitName ,
118 const SUPERV::ListOfStrings & InitFunction ,
119 const char * MoreName ,
120 const SUPERV::ListOfStrings & MoreFunction ,
121 const char * NextName ,
122 const SUPERV::ListOfStrings & NextFunction ,
123 SUPERV::INode_out anEndOfLoop ) ;
124 virtual SUPERV::SNode_ptr SNode(
125 const char * FuncName ,
126 const SUPERV::ListOfStrings & PythonFunction ,
127 SUPERV::INode_out anEndOfSwitch ) ;
129 virtual SUPERV::CNode_ptr GetNode( const char * NodeName );
131 virtual SUPERV::Link_ptr Link( SUPERV::Port_ptr OutPort ,
132 SUPERV::Port_ptr InPort ) ;
134 virtual SUPERV::ListOfNodes_var Graph_Impl::SetNode( SUPERV::ListOfNodes_var RetVal ,
135 GraphBase::ComputingNode * aNode ) ;
136 virtual SUPERV::ListOfNodes * Nodes() ;
137 virtual SUPERV::ListOfLinks * GLinks() ;
138 virtual SUPERV::ListOfLinks * Links( GraphBase::ComputingNode * aNode ,
139 const char * anInputParam ) ;
140 virtual SUPERV::ListOfGraphs * Graphs() ;
142 virtual Engines::Component_ptr ComponentRef( const char * aComputerContainer ,
143 const char * aComponentName ) ;
145 virtual bool IsValid() ;
146 virtual bool IsExecutable() ;
147 virtual bool IsDataFlow() ;
149 virtual bool IsEditing() ;
150 virtual bool IsExecuting() ;
152 virtual bool IsReadOnly() ;
154 virtual long LevelMax() ;
155 virtual SUPERV::ListOfNodes * LevelNodes(long aLevel ) ;
156 virtual long ThreadsMax() ;
157 virtual long GraphsNumber() ;
158 virtual long Threads() ;
159 virtual long SuspendedThreads() ;
161 virtual bool Begin() ;
163 virtual bool Start() ;
164 virtual long LastLevelDone() ;
166 virtual bool EventNoW( SUPERV::CNode_out aNode ,
167 SUPERV::GraphEvent & anEvent ,
168 SUPERV::GraphState & aState ) ;
169 virtual bool Event( SUPERV::CNode_out aNode ,
170 SUPERV::GraphEvent & anEvent ,
171 SUPERV::GraphState & aState ) ;
172 virtual bool EventW( SUPERV::CNode_out aNode ,
173 SUPERV::GraphEvent & anEvent ,
174 SUPERV::GraphState & aState ) ;
176 virtual bool Merge(const SUPERV::Graph_ptr aGraph ) ;