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