Salome HOME
Allow usage of BatchManager_eClient methods in Python
authorbarate <barate>
Thu, 26 Aug 2010 14:24:20 +0000 (14:24 +0000)
committerbarate <barate>
Thu, 26 Aug 2010 14:24:20 +0000 (14:24 +0000)
src/Core/Batch_BatchManager_eClient.cxx
src/Core/Batch_BatchManager_eClient.hxx
src/Python/libBatch_Swig.i
src/Python/libBatch_Swig_typemap.i

index 1a6a488a952ffb8d5bfc5089c8b2e384cef42c7b..a7546459df9dba7441ebe0c46df9f6289560389a 100644 (file)
@@ -141,7 +141,7 @@ namespace Batch {
 
   }
 
-  void BatchManager_eClient::importOutputFiles( const Job & job, const string directory ) throw(EmulationException)
+  void BatchManager_eClient::importOutputFiles( const Job & job, const string directory )
   {
     Parametre params = job.getParametre();
     Versatile V = params[OUTFILE];
@@ -187,7 +187,7 @@ namespace Batch {
 
   }
 
-  MpiImpl *BatchManager_eClient::FactoryMpiImpl(string mpiImpl) throw(EmulationException)
+  MpiImpl *BatchManager_eClient::FactoryMpiImpl(string mpiImpl)
   {
     if(mpiImpl == "lam")
       return new MpiImpl_LAM();
index 188a2df7158f664e478f8ae87989da0ba0bdb179..326c58b35d9648ea28127722867416e292aab0c4 100644 (file)
@@ -51,7 +51,7 @@ namespace Batch {
     BatchManager_eClient(const Batch::FactBatchManager * parent, const char* host="localhost",
                          CommunicationProtocolType protocolType = SSH, const char* mpiImpl="mpich1");
     virtual ~BatchManager_eClient();
-    void importOutputFiles( const Job & job, const std::string directory ) throw(EmulationException);
+    void importOutputFiles( const Job & job, const std::string directory );
 
     void setUsername(const std::string & username) {_username = username;}
 
@@ -62,7 +62,7 @@ namespace Batch {
 
     std::string generateTemporaryFileName(const std::string & prefix);
     std::string createAndOpenTemporaryFile(const std::string & prefix, std::ofstream & outputStream);
-    MpiImpl* FactoryMpiImpl(std::string mpiImpl) throw(EmulationException);
+    MpiImpl* FactoryMpiImpl(std::string mpiImpl);
     void exportInputFiles(const Job & job);
     const std::string & getTmpDir();
 
index fb131edfc5dec595506a9a7d8feec36af8af73d6..ac94be86f1979432576f28c45fc6ac79240f9782 100644 (file)
@@ -32,7 +32,7 @@
         ==========
         Certaines classes ont des methodes surchargees et SWIG ne gere pas bien
         ces surcharges, d'ou un probleme d'utilisation en Python de celles-ci.
-        En bref, a ne marche pas et il faudra corriger le probleme...
+        En bref, ca ne marche pas et il faudra corriger le probleme...
 
         TODO : corriger le probleme de surcharge des methodes en Python
 
 #include "Batch_JobId.hxx"
 #include "Batch_JobInfo.hxx"
 
+#include "Batch_CommunicationProtocol.hxx"
+
 #include "Batch_BatchManager.hxx"
+#include "Batch_BatchManager_eClient.hxx"
 #include "Batch_BatchManagerCatalog.hxx"
 #include "Batch_FactBatchManager.hxx"
+#include "Batch_FactBatchManager_eClient.hxx"
 %}
 
 /* Les classes exportees en Python */
 %include Batch_JobId.hxx
 %include Batch_JobInfo.hxx
 
+%include Batch_CommunicationProtocol.hxx
+
 %include Batch_BatchManager.hxx
+%include Batch_BatchManager_eClient.hxx
 %include Batch_BatchManagerCatalog.hxx
 %include Batch_FactBatchManager.hxx
+%include Batch_FactBatchManager_eClient.hxx
 
 %include Batch_Constants.hxx
 
index 543cb7abaa5502068b45f5fbad451796e7517fdb..e0958b2284195184ca713ce2be1110d4702edb8a 100644 (file)
@@ -210,3 +210,11 @@ typedef int Py_ssize_t;
   $1 = E;
 }
 
+// Dynamic cast to FactBatchManager_eClient if necessary
+%typemap(out) Batch::FactBatchManager *
+{
+  if(dynamic_cast<Batch::FactBatchManager_eClient *>($1))
+    $result=SWIG_NewPointerObj((void*)$1,$descriptor(Batch::FactBatchManager_eClient *),$owner);
+  else
+    $result=SWIG_NewPointerObj((void*)$1,$descriptor(Batch::FactBatchManager *),$owner);
+}