Salome HOME
*** empty log message ***
[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 "Graph_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 //      void Save(const char* IORSComponent, const char* aUrlOfFile);
69 //      void Load(const char* IORSComponent, const char* aUrlOfFile);
70     SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
71                             const char* theURL,
72                             bool isMultiFile);
73     SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
74                                  const char* theURL,
75                                  bool isMultiFile);
76     CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
77                         const SALOMEDS::TMPFile& theStream,
78                         const char* theURL,
79                         bool isMultiFile);
80     CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
81                              const SALOMEDS::TMPFile& theStream,
82                              const char* theURL,
83                              bool isMultiFile);
84
85     void Close(SALOMEDS::SComponent_ptr theComponent);
86     char* ComponentDataType();
87
88     char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
89                                  const char* IORString,
90                                  CORBA::Boolean isMultiFile,
91                                  CORBA::Boolean isASCII);
92     char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
93                                  const char* aLocalPersistentID,
94                                  CORBA::Boolean isMultiFile,
95                                  CORBA::Boolean isASCII)
96       throw(SALOME::SALOME_Exception);
97
98     char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, CORBA::Boolean isMultiFile);
99     char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, CORBA::Boolean isMultiFile);
100
101     bool CanPublishInStudy(CORBA::Object_ptr theIOR);
102     SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
103                                          SALOMEDS::SObject_ptr theSObject,
104                                          CORBA::Object_ptr theObject,
105                                          const char* theName) throw (SALOME::SALOME_Exception) ;
106
107     CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
108     SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
109     CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
110     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
111                                     CORBA::Long theObjectID,
112                                     SALOMEDS::SObject_ptr theObject);
113
114     virtual SUPERV::Value_ptr StringValue( const char * aStrIOR ) ;
115     virtual SUPERV::Value_ptr AnyValue( const CORBA::Any & anAny ) ;
116     virtual SUPERV::Value_ptr Value( CORBA::Any * anAny ) ;
117
118     virtual SUPERV::Graph_ptr Graph( const char * aDataFlowName ) ;
119
120     virtual SUPERV::Graph_ptr GraphE( const char * aDataFlowName ) ;
121
122     virtual SUPERV::Graph_ptr getGraph(const char* ior);
123
124 };
125
126 extern "C"
127   PortableServer::ObjectId * SUPERVEngine_factory
128                                    ( CORBA::ORB_ptr orb ,
129                                      PortableServer::POA_ptr poa , 
130                                      PortableServer::ObjectId * contId ,
131                                      const char *instanceName ,
132                                      const char *interfaceName 
133 //                                     , int argc ,
134 //                                     char ** argv
135                                      ) ;
136
137 #endif