Salome HOME
Some refactoring in batch manager eLSF to use method getCommandOutput instead of...
[tools/libbatch.git] / src / LSF / Batch_JobInfo_eLSF.cxx
index 349c5750e867de83966389bc05163b19cd96c556..40408374fcb0e91c3100e81785eeede46a3ac0a5 100644 (file)
  */
 
 #include <cstdio>
-#include <iostream>
-#include <fstream>
 #include <sstream>
 
-#include "Batch_Constants.hxx"
-#include "Batch_Parametre.hxx"
-#include "Batch_Environnement.hxx"
-#include "Batch_RunTimeException.hxx"
-#include "Batch_APIInternalFailureException.hxx"
+#include <Batch_Constants.hxx>
 #include "Batch_JobInfo_eLSF.hxx"
 
 using namespace std;
 
 namespace Batch {
 
-
-
   // Constructeurs
-  JobInfo_eLSF::JobInfo_eLSF(int id, string logFile) : JobInfo()
+  JobInfo_eLSF::JobInfo_eLSF(int id, const std::string & queryOutput) : JobInfo()
   {
-    // On remplit les membres _param et _env
+    // Fill ID parameter
     ostringstream oss;
     oss << id;
     _param[ID] = oss.str();
 
-    // read status of job in log file
+    // read query output
     string line;
-    ifstream fp(logFile.c_str());
+    istringstream fp(queryOutput);
     getline(fp, line);
 
     // On some batch managers, the job is deleted soon after it is finished,