Salome HOME
Patch from Christian CAREMOLI for bug PAL10339 : random GUI freeze.
[modules/superv.git] / src / Supervision / SuperV_Impl.hxx
1 //  SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
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   : SuperV_Impl.hxx
25 //  Author : Jean Rahuel
26 //  Module : SUPERV
27 //  $Header$
28
29 #ifndef _SUPERV_IMPL_HXX_
30 #define _SUPERV_IMPL_HXX_
31
32 #include <iostream>
33
34 #include "CORBA.h"
35
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SALOMEDS)
38 #include "SALOME_Component_i.hxx"
39 #include "SALOME_LifeCycleCORBA.hxx"
40
41 #include "StreamGraph_Impl.hxx"
42
43 #include "DataFlowEditor_DataFlow.hxx"
44
45 class SuperV_Impl : public POA_SUPERV::SuperG ,
46                     public Engines_Component_i  {
47   private:
48
49     CORBA::ORB_ptr             _Orb ;
50     PortableServer::POA_ptr    _Poa ;
51     PortableServer::ObjectId * _ContId ;
52     char *myStrURL;
53
54   public:
55     SuperV_Impl();
56     SuperV_Impl( CORBA::ORB_ptr orb ,
57                  PortableServer::POA_ptr poa ,
58                  PortableServer::ObjectId * contId , 
59                  const char *instanceName ,
60                  const char *interfaceName 
61 //                 , int argc ,
62 //                 char ** argv
63                ) ;
64
65     virtual ~SuperV_Impl() ;
66     virtual void Destroy() ;
67
68     Engines::TMPFile * DumpPython( CORBA::Object_ptr theStudy ,
69                                    CORBA::Boolean isPublished ,
70                                    CORBA::Boolean & isValidScript ) ;
71
72 //      void Save(const char* IORSComponent, const char* aUrlOfFile);
73 //      void Load(const char* IORSComponent, const char* aUrlOfFile);
74     SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
75                             const char* theURL,
76                             bool isMultiFile);
77     SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
78                                  const char* theURL,
79                                  bool isMultiFile);
80     CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
81                         const SALOMEDS::TMPFile& theStream,
82                         const char* theURL,
83                         bool isMultiFile);
84     CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
85                              const SALOMEDS::TMPFile& theStream,
86                              const char* theURL,
87                              bool isMultiFile);
88
89     void Close(SALOMEDS::SComponent_ptr theComponent);
90     char* ComponentDataType();
91
92     char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
93                                  const char* IORString,
94                                  CORBA::Boolean isMultiFile,
95                                  CORBA::Boolean isASCII);
96     char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
97                                  const char* aLocalPersistentID,
98                                  CORBA::Boolean isMultiFile,
99                                  CORBA::Boolean isASCII)
100       throw(SALOME::SALOME_Exception);
101
102     char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, CORBA::Boolean isMultiFile);
103     char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, CORBA::Boolean isMultiFile);
104
105     bool CanPublishInStudy(CORBA::Object_ptr theIOR);
106     SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
107                                          SALOMEDS::SObject_ptr theSObject,
108                                          CORBA::Object_ptr theObject,
109                                          const char* theName) throw (SALOME::SALOME_Exception) ;
110
111     CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
112     SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
113     CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
114     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
115                                     CORBA::Long theObjectID,
116                                     SALOMEDS::SObject_ptr theObject);
117
118     virtual SUPERV::Value_ptr StringValue( const char * aStrIOR ) ;
119     virtual SUPERV::Value_ptr AnyValue( const CORBA::Any & anAny ) ;
120     virtual SUPERV::Value_ptr Value( CORBA::Any * anAny ) ;
121     virtual CORBA::Object_ptr ToObject( CORBA::Object_ptr anObjectRef ) ;
122
123     virtual SUPERV::Graph_ptr Graph( const char * aDataFlowName ) ;
124
125     virtual SUPERV::Graph_ptr GraphE( const char * aDataFlowName ) ;
126
127     virtual SUPERV::StreamGraph_ptr StreamGraph( const char * aDataFlowName ) ;
128
129     virtual SUPERV::StreamGraph_ptr StreamGraphE( const char * aDataFlowName ) ;
130
131     virtual SUPERV::StreamGraph_ptr getStreamGraph(const char* ior);
132     virtual SUPERV::Graph_ptr getGraph(const char* ior);
133
134 };
135
136 extern "C"
137   PortableServer::ObjectId * SUPERVEngine_factory
138                                    ( CORBA::ORB_ptr orb ,
139                                      PortableServer::POA_ptr poa , 
140                                      PortableServer::ObjectId * contId ,
141                                      const char *instanceName ,
142                                      const char *interfaceName 
143 //                                     , int argc ,
144 //                                     char ** argv
145                                      ) ;
146
147 #endif