Version: 9.12.0
SalomeApp_Engine_i.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, 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, or (at your option) any later version.
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 
23 // SalomeApp_Engine_i : implementation of SalomeApp_Engine.idl
24 // File : SalomeApp_Engine_i.hxx
25 // Author : Alexander SLADKOV
26 
27 #ifndef _SALOMEAPP_ENGINE_I_HXX_
28 #define _SALOMEAPP_ENGINE_I_HXX_
29 
30 #include "SalomeApp.h"
31 
32 #include "SALOME_Component_i.hxx"
33 
34 #include <QString>
35 #include <vector>
36 #include <map>
37 
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(SalomeApp_Engine)
40 
41 class SALOME_NamingService_Abstract;
42 
43 class SALOMEAPPIMPL_EXPORT SalomeApp_Engine_i: public POA_SalomeApp::Engine,
44  public Engines_Component_i
45 {
46 public:
47  SalomeApp_Engine_i( const char* theComponentName );
49 
50  SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
51  const char* theURL,
52  bool isMultiFile );
53 
54  CORBA::Boolean Load( SALOMEDS::SComponent_ptr theComponent,
55  const SALOMEDS::TMPFile& theFile,
56  const char* theURL,
57  bool isMultiFile );
58 
59  virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
60  CORBA::Boolean isMultiFile,
61  CORBA::Boolean& isValidScript);
62 
63 public:
64  typedef std::vector<std::string> ListOfFiles;
65  typedef std::map<int, ListOfFiles> MapOfFiles;
66 
67  ListOfFiles GetListOfFiles (int);
68  void SetListOfFiles (int, const ListOfFiles& theListOfFiles);
69 
70  static std::string EngineIORForComponent( const char* theComponentName,
71  bool toCreate );
72  static SalomeApp_Engine_i* GetInstance ( const char* theComponentName,
73  bool toCreate );
74 
75  static CORBA::Object_ptr EngineForComponent( const char* theComponentName,
76  bool toCreate );
77 
78 public:
79  // methods from SALOMEDS::Driver without implementation. Must be redefined because
80  // there is no default implementation of SALOMEDS::Driver interface
81  SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr, const char*, bool ) {return 0;}
82  CORBA::Boolean LoadASCII( SALOMEDS::SComponent_ptr, const SALOMEDS::TMPFile&, const char*, bool ) {return 0;}
83  void Close( SALOMEDS::SComponent_ptr ) {}
84  char* ComponentDataType();
85  char* IORToLocalPersistentID( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;}
86  char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;}
87  bool CanPublishInStudy( CORBA::Object_ptr ) {return 0;}
88  SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr, CORBA::Object_ptr, const char* ) {return 0;}
89  CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr ) {return 0;}
90  SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr, CORBA::Long& ) {return 0;}
91  CORBA::Boolean CanPaste( const char*, CORBA::Long ) {return 0;}
92  SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile&, CORBA::Long, SALOMEDS::SObject_ptr ) {return 0;}
93 
94  bool keepFiles() const { return myKeepFiles; }
95  void keepFiles( bool keep ) { myKeepFiles = keep; }
96 
97  char* getVersion();
98 
99 private:
100  static CORBA::ORB_var orb();
101  static PortableServer::POA_var poa();
102  static SALOME_NamingService_Abstract* namingService();
103 private:
106 
108 };
109 
110 #endif
111 
#define SALOMEAPPIMPL_EXPORT
Definition: SalomeApp.h:55
Definition: SalomeApp_Engine_i.h:45
char * LocalPersistentIDToIOR(SALOMEDS::SObject_ptr, const char *, CORBA::Boolean, CORBA::Boolean)
Definition: SalomeApp_Engine_i.h:86
CORBA::Boolean CanPaste(const char *, CORBA::Long)
Definition: SalomeApp_Engine_i.h:91
std::map< int, ListOfFiles > MapOfFiles
Definition: SalomeApp_Engine_i.h:65
SALOMEDS::TMPFile * SaveASCII(SALOMEDS::SComponent_ptr, const char *, bool)
Definition: SalomeApp_Engine_i.h:81
QString myComponentName
Definition: SalomeApp_Engine_i.h:107
CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr)
Definition: SalomeApp_Engine_i.h:89
SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr, CORBA::Object_ptr, const char *)
Definition: SalomeApp_Engine_i.h:88
SALOMEDS::TMPFile * CopyFrom(SALOMEDS::SObject_ptr, CORBA::Long &)
Definition: SalomeApp_Engine_i.h:90
SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile &, CORBA::Long, SALOMEDS::SObject_ptr)
Definition: SalomeApp_Engine_i.h:92
bool myKeepFiles
Definition: SalomeApp_Engine_i.h:105
bool CanPublishInStudy(CORBA::Object_ptr)
Definition: SalomeApp_Engine_i.h:87
char * IORToLocalPersistentID(SALOMEDS::SObject_ptr, const char *, CORBA::Boolean, CORBA::Boolean)
Definition: SalomeApp_Engine_i.h:85
bool keepFiles() const
Definition: SalomeApp_Engine_i.h:94
void keepFiles(bool keep)
Definition: SalomeApp_Engine_i.h:95
MapOfFiles myListOfFiles
Definition: SalomeApp_Engine_i.h:104
std::vector< std::string > ListOfFiles
Definition: SalomeApp_Engine_i.h:64
void Close(SALOMEDS::SComponent_ptr)
Definition: SalomeApp_Engine_i.h:83
CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr, const SALOMEDS::TMPFile &, const char *, bool)
Definition: SalomeApp_Engine_i.h:82