Salome HOME
Porting KERNEL on new XML reader.
[modules/kernel.git] / src / Batch / Batch_Job_PBS.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 /*
21  * Job_PBS.hxx : 
22  *
23  * Auteur : Ivan DUTKA-MALEN - EDF R&D
24  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
25  * Date   : Fri Nov 14 11:00:39 2003
26  * Projet : Salome 2
27  *
28  */
29
30 #ifndef _JOB_PBS_H_
31 #define _JOB_PBS_H_
32
33 extern "C" {
34
35 #include <pbs_error.h>
36 #include <pbs_ifl.h>
37 }
38 #include "Batch_Job.hxx"
39
40 namespace Batch {
41
42   class Job_PBS
43   {
44   public:
45     // Constructeur et destructeur
46     Job_PBS(const Job & job);
47     virtual ~Job_PBS();
48
49     // Accesseurs
50     struct attropl * getAttributesOP();
51     struct attrl   * getAttributes();
52     char *           getScript();
53     char *           getDestination();
54
55   protected:
56     struct attropl * _p_attropl; // liste chainee d'attributs + operateur
57     struct attrl   * _p_attrl; // liste chainee d'attributs
58     char * _script; // chemin d'acces au script du job
59     char * _destination; // queue dans laquelle le job est soumis
60
61   private:
62     // Ajoute un element (name,resource,value) a la liste chainee d'attributs + operateur
63     void setResourceAttributeOP(struct attropl ** 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 + operateur
66     struct attropl * findResourceAttributeOP(struct attropl * attr_list, const char * attr_name, const char * attr_resource);
67
68     // Recherche le dernier element de la liste chainee d'attributs + operateur
69     struct attropl * lastAttributeOP(struct attropl * attr_list);
70
71     // Convertit un objet Parametre en liste chainee d'attributs + operateur
72     struct attropl * ParametreToAttributeOPList(struct attropl ** _p_attr_list, Parametre & param);
73
74     // Convertit un objet Environnement en liste chainee d'attributs + operateur
75     struct attropl * EnvironnementToAttributeOPList(struct attropl ** _p_attr_list, Environnement & env);
76
77     // Ajoute les variables d'environnement presentes dans tout job PBS
78     void addPBSEnvironnement(Environnement & E);
79
80
81     // Ajoute un element (name,resource,value) a la liste chainee d'attributs
82     void setResourceAttribute(struct attrl ** attr_list, const char * attr_name, const char * attr_resource, const char * attr_value);
83
84     // Recherche un element (name,resource,value) dans la liste chainee d'attributs
85     struct attrl   * findResourceAttribute(struct attrl * attr_list, const char * attr_name, const char * attr_resource);
86
87     // Recherche le dernier element de la liste chainee d'attributs
88     struct attrl   * lastAttribute(struct attrl * attr_list);
89
90   };
91
92 }
93
94 #endif