Salome HOME
Merge 'master' branch into 'V9_dev' branch
[modules/kernel.git] / src / Launcher / Launcher_Job.hxx
index 42ac55d0ebde87620bcd500b1e6dfbcc2097c592..2f2322bf828eef095b4ad37182e6668c7ffd311d 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2009-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -43,8 +43,6 @@
 #include <libbatch/GenericException.hxx>
 #endif
 
-#include <libxml/parser.h>
-
 namespace Launcher
 {
   class LAUNCHER_EXPORT Job
@@ -56,7 +54,7 @@ namespace Launcher
       // Launcher managing parameters
       // State of a Job: CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR
       void setState(const std::string & state);
-      std::string getState();
+      std::string getState() const;
          // Get names or ids of hosts assigned to the job
       std::string getAssignedHostnames();
 
@@ -64,7 +62,7 @@ namespace Launcher
       int getNumber();
 
       virtual void setResourceDefinition(const ParserResourcesType & resource_definition);
-      ParserResourcesType getResourceDefinition();
+      ParserResourcesType getResourceDefinition() const;
 
       // Common parameters
       void setJobName(const std::string & job_name);
@@ -81,35 +79,41 @@ namespace Launcher
       void setExclusive(bool exclusive);
       void setExclusiveStr(const std::string & exclusiveStr);
       void setMemPerCpu(unsigned long mem_per_cpu);
+      void setWCKey(const std::string & wckey);
+      void setExtraParams(const std::string & extra_params);
+      void setReference(const std::string & reference);
          // For COORM
          void setLauncherFile(const std::string & launcher_file);
          void setLauncherArgs(const std::string & launcher_args);
 
-      std::string getJobName();
-      std::string getJobFile();
-      std::string getWorkDirectory();
-      std::string getLocalDirectory();
-      std::string getResultDirectory();
-      const std::list<std::string> & get_in_files();
-      const std::list<std::string> & get_out_files();
-      std::string getMaximumDuration();
-      resourceParams getResourceRequiredParams();
-      std::string getQueue();
-      std::string getEnvFile();
-      std::string getJobType();
-      bool getExclusive();
+      std::string getJobName() const;
+      std::string getJobFile() const;
+      std::string getWorkDirectory() const;
+      std::string getLocalDirectory() const;
+      std::string getResultDirectory() const;
+      const std::list<std::string> & get_in_files() const;
+      const std::list<std::string> & get_out_files() const;
+      std::string getMaximumDuration() const;
+      resourceParams getResourceRequiredParams() const;
+      std::string getQueue() const;
+      std::string getEnvFile() const;
+      std::string getJobType() const;
+      bool getExclusive() const;
       std::string getExclusiveStr() const;
       unsigned long getMemPerCpu() const;
+      std::string getWCKey() const;
+      std::string getExtraParams() const;
+      std::string getReference() const;
 
          // For COORM
-         std::string getLauncherFile();
-         std::string getLauncherArgs();
+         std::string getLauncherFile() const;
+         std::string getLauncherArgs() const;
 
       std::string updateJobState();
 
       void addSpecificParameter(const std::string & name,
                                   const std::string & value);
-      const std::map<std::string, std::string> & getSpecificParameters();
+      const std::map<std::string, std::string> & getSpecificParameters() const;
       virtual void checkSpecificParameters();
 
       // Checks
@@ -118,10 +122,7 @@ namespace Launcher
 
       // Helps
       long convertMaximumDuration(const std::string & maximum_duration);
-      std::string getLaunchDate();
-
-      // Xml method
-      void addToXmlDocument(xmlNodePtr root_node);
+      std::string getLaunchDate() const;
 
       void stopJob();
       void removeJob();
@@ -158,6 +159,9 @@ namespace Launcher
       std::string _queue;
       bool _exclusive;
       unsigned long _mem_per_cpu;
+      std::string _wckey;
+      std::string _extra_params;
+      std::string _reference; //! Reference of the job for the batch manager
 
          // Parameters for COORM
          std::string _launcher_file;
@@ -169,7 +173,7 @@ namespace Launcher
       Batch::Job * getBatchJob();
       Batch::Parametre common_job_params();
       void setBatchManagerJobId(Batch::JobId batch_manager_job_id);
-      Batch::JobId getBatchManagerJobId();
+      Batch::JobId getBatchManagerJobId() const;
 
     protected:
       Batch::Job * _batch_job;
@@ -179,4 +183,3 @@ namespace Launcher
 }
 
 #endif
-