1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
24 // File : SalomeApp_Engine_i.hxx
25 // Author : Alexander SLADKOV
27 #ifndef _SALOMEAPP_ENGINE_I_HXX_
28 #define _SALOMEAPP_ENGINE_I_HXX_
30 #include "SALOME_Session.hxx"
32 #include "SALOME_Component_i.hxx"
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SalomeApp_Engine)
40 class SALOME_NamingService;
42 class SESSION_EXPORT SalomeApp_Engine_i: public POA_SalomeApp::Engine,
43 public Engines_Component_i
46 SalomeApp_Engine_i( const char* theComponentName );
47 ~SalomeApp_Engine_i();
49 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
53 CORBA::Boolean Load( SALOMEDS::SComponent_ptr theComponent,
54 const SALOMEDS::TMPFile& theFile,
58 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
59 CORBA::Boolean isPublished,
60 CORBA::Boolean isMultiFile,
61 CORBA::Boolean& isValidScript);
64 typedef std::vector<std::string> ListOfFiles;
66 ListOfFiles GetListOfFiles (const int theStudyId);
67 void SetListOfFiles (const ListOfFiles& theListOfFiles,
68 const int theStudyId);
70 static std::string EngineIORForComponent( const char* theComponentName,
72 static SalomeApp_Engine_i* GetInstance ( const char* theComponentName,
76 // methods from SALOMEDS::Driver without implementation. Must be redefined because
77 // there is no default implementation of SALOMEDS::Driver interface
78 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr, const char*, bool ) {return 0;}
79 CORBA::Boolean LoadASCII( SALOMEDS::SComponent_ptr, const SALOMEDS::TMPFile&, const char*, bool ) {return 0;}
80 void Close( SALOMEDS::SComponent_ptr ) {}
81 char* ComponentDataType();
82 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;}
83 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;}
84 bool CanPublishInStudy( CORBA::Object_ptr ) {return 0;}
85 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr, CORBA::Object_ptr, const char* ) throw (SALOME::SALOME_Exception) {return 0;}
86 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr ) {return 0;}
87 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr, CORBA::Long& ) {return 0;}
88 CORBA::Boolean CanPaste( const char*, CORBA::Long ) {return 0;}
89 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile&, CORBA::Long, SALOMEDS::SObject_ptr ) {return 0;}
92 static CORBA::ORB_var orb();
93 static PortableServer::POA_var poa();
94 static SALOME_NamingService* namingService();
95 static CORBA::Object_ptr engineForComponent( const char* theComponentName,
99 typedef std::map<int, ListOfFiles> MapOfListOfFiles;
100 MapOfListOfFiles myMap;
102 std::string myComponentName;