Salome HOME
Fix compilation pb.
[modules/kernel.git] / src / Launcher / SALOME_Launcher.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #ifndef __SALOME_LAUNCHER_HXX__
21 #define __SALOME_LAUNCHER_HXX__
22
23 #include <SALOMEconfig.h>
24 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
25 #include "SALOME_ContainerManager.hxx"
26 #include "BatchLight_BatchManager.hxx"
27
28 #include <string>
29
30 class SALOME_NamingService;
31
32 #if defined LAUNCHER_EXPORTS
33 #if defined WIN32
34 #define LAUNCHER_EXPORT __declspec( dllexport )
35 #else
36 #define LAUNCHER_EXPORT
37 #endif
38 #else
39 #if defined WNT
40 #define LAUNCHER_EXPORT __declspec( dllimport )
41 #else
42 #define LAUNCHER_EXPORT
43 #endif
44 #endif
45
46 class LAUNCHER_EXPORT SALOME_Launcher:
47   public POA_Engines::SalomeLauncher,
48   public PortableServer::RefCountServantBase
49 {
50
51 public:
52   SALOME_Launcher(CORBA::ORB_ptr orb, PortableServer::POA_var poa);
53   ~SALOME_Launcher();
54
55   CORBA::Long submitSalomeJob(const char * fileToExecute ,
56                               const Engines::FilesList& filesToExport ,
57                               const Engines::FilesList& filesToImport ,
58                               const CORBA::Long NumberOfProcessors ,
59                               const Engines::MachineParameters& params);
60
61   char* querySalomeJob( const CORBA::Long jobId, const Engines::MachineParameters& params);
62   void deleteSalomeJob( const CORBA::Long jobId, const Engines::MachineParameters& params);
63   void getResultSalomeJob( const char * directory, const CORBA::Long jobId, const Engines::MachineParameters& params );
64
65   void Shutdown();
66
67   static const char *_LauncherNameInNS;
68
69 protected:
70   BatchLight::BatchManager *FactoryBatchManager( const Engines::MachineParameters* params ) throw(SALOME_Exception);
71
72   std::map <std::string,BatchLight::BatchManager*> _batchmap;
73   CORBA::ORB_var _orb;
74   PortableServer::POA_var _poa;
75   SALOME_ContainerManager *_ContManager;
76   SALOME_ResourcesManager *_ResManager;
77   SALOME_NamingService *_NS;
78 };
79
80 #endif