Salome HOME
bug on ccrt + eris
[tools/libbatch.git] / src / PBS / Batch_Job_PBS.hxx
1 //  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 /*
23  * Job_PBS.hxx : 
24  *
25  * Auteur : Ivan DUTKA-MALEN - EDF R&D
26  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
27  * Date   : Fri Nov 14 11:00:39 2003
28  * Projet : Salome 2
29  *
30  */
31
32 #ifndef _JOB_PBS_H_
33 #define _JOB_PBS_H_
34
35 extern "C" {
36
37 #include <pbs_error.h>
38 #include <pbs_ifl.h>
39 }
40 #include "Batch_Job.hxx"
41
42 namespace Batch {
43
44   class Job_PBS
45   {
46   public:
47     // Constructeur et destructeur
48     Job_PBS(const Job & job);
49     virtual ~Job_PBS();
50
51     // Accesseurs
52     struct attropl * getAttributesOP();
53     struct attrl   * getAttributes();
54     char *           getScript();
55     char *           getDestination();
56
57   protected:
58     struct attropl * _p_attropl; // liste chainee d'attributs + operateur
59     struct attrl   * _p_attrl; // liste chainee d'attributs
60     char * _script; // chemin d'acces au script du job
61     char * _destination; // queue dans laquelle le job est soumis
62
63   private:
64     // Ajoute un element (name,resource,value) a la liste chainee d'attributs + operateur
65     void setResourceAttributeOP(struct attropl ** attr_list, const char * attr_name, const char * attr_resource, const char * attr_value);
66
67     // Recherche un element (name,resource,value) dans la liste chainee d'attributs + operateur
68     struct attropl * findResourceAttributeOP(struct attropl * attr_list, const char * attr_name, const char * attr_resource);
69
70     // Recherche le dernier element de la liste chainee d'attributs + operateur
71     struct attropl * lastAttributeOP(struct attropl * attr_list);
72
73     // Convertit un objet Parametre en liste chainee d'attributs + operateur
74     struct attropl * ParametreToAttributeOPList(struct attropl ** _p_attr_list, Parametre & param);
75
76     // Convertit un objet Environnement en liste chainee d'attributs + operateur
77     struct attropl * EnvironnementToAttributeOPList(struct attropl ** _p_attr_list, Environnement & env);
78
79     // Ajoute les variables d'environnement presentes dans tout job PBS
80     void addPBSEnvironnement(Environnement & E);
81
82
83     // Ajoute un element (name,resource,value) a la liste chainee d'attributs
84     void setResourceAttribute(struct attrl ** attr_list, const char * attr_name, const char * attr_resource, const char * attr_value);
85
86     // Recherche un element (name,resource,value) dans la liste chainee d'attributs
87     struct attrl   * findResourceAttribute(struct attrl * attr_list, const char * attr_name, const char * attr_resource);
88
89     // Recherche le dernier element de la liste chainee d'attributs
90     struct attrl   * lastAttribute(struct attrl * attr_list);
91
92   };
93
94 }
95
96 #endif