Salome HOME
Increment version number (2.2.3)
[modules/kernel.git] / src / Batch / Batch_Job_PBS.hxx
1 /*
2  * Job_PBS.hxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
6  * Date   : Fri Nov 14 11:00:39 2003
7  * Projet : Salome 2
8  *
9  */
10
11 #ifndef _JOB_PBS_H_
12 #define _JOB_PBS_H_
13
14 extern "C" {
15
16 #include <pbs_error.h>
17 #include <pbs_ifl.h>
18 }
19 #include "Batch_Job.hxx"
20
21 namespace Batch {
22
23   class Job_PBS
24   {
25   public:
26     // Constructeur et destructeur
27     Job_PBS(const Job & job);
28     virtual ~Job_PBS();
29
30     // Accesseurs
31     struct attropl * getAttributesOP();
32     struct attrl   * getAttributes();
33     char *           getScript();
34     char *           getDestination();
35
36   protected:
37     struct attropl * _p_attropl; // liste chainee d'attributs + operateur
38     struct attrl   * _p_attrl; // liste chainee d'attributs
39     char * _script; // chemin d'acces au script du job
40     char * _destination; // queue dans laquelle le job est soumis
41
42   private:
43     // Ajoute un element (name,resource,value) a la liste chainee d'attributs + operateur
44     void setResourceAttributeOP(struct attropl ** attr_list, const char * attr_name, const char * attr_resource, const char * attr_value);
45
46     // Recherche un element (name,resource,value) dans la liste chainee d'attributs + operateur
47     struct attropl * findResourceAttributeOP(struct attropl * attr_list, const char * attr_name, const char * attr_resource);
48
49     // Recherche le dernier element de la liste chainee d'attributs + operateur
50     struct attropl * lastAttributeOP(struct attropl * attr_list);
51
52     // Convertit un objet Parametre en liste chainee d'attributs + operateur
53     struct attropl * ParametreToAttributeOPList(struct attropl ** _p_attr_list, Parametre & param);
54
55     // Convertit un objet Environnement en liste chainee d'attributs + operateur
56     struct attropl * EnvironnementToAttributeOPList(struct attropl ** _p_attr_list, Environnement & env);
57
58     // Ajoute les variables d'environnement presentes dans tout job PBS
59     void addPBSEnvironnement(Environnement & E);
60
61
62     // Ajoute un element (name,resource,value) a la liste chainee d'attributs
63     void setResourceAttribute(struct attrl ** attr_list, const char * attr_name, const char * attr_resource, const char * attr_value);
64
65     // Recherche un element (name,resource,value) dans la liste chainee d'attributs
66     struct attrl   * findResourceAttribute(struct attrl * attr_list, const char * attr_name, const char * attr_resource);
67
68     // Recherche le dernier element de la liste chainee d'attributs
69     struct attrl   * lastAttribute(struct attrl * attr_list);
70
71   };
72
73 }
74
75 #endif