Salome HOME
merge from branch BR_For40_DSC tag mergeto_V4_1_0_maintainance_29may08
[modules/kernel.git] / src / Batch / Batch_JobId.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  * JobId.hxx : 
22  *
23  * Auteur : Ivan DUTKA-MALEN - EDF R&D
24  * Date   : Septembre 2003
25  * Projet : SALOME 2
26  *
27  */
28
29 #ifndef _JOBID_H_
30 #define _JOBID_H_
31
32
33 #include "Batch_JobInfo.hxx"
34 #include "Batch_BatchManager.hxx"
35
36 namespace Batch {
37
38   class BatchManager;
39
40   class JobId
41   {
42     friend class BatchManager;
43
44   public:
45     // Constructeur standard et destructeur
46     JobId();
47     virtual ~JobId();
48
49     // Constructeur avec le pointeur sur le BatchManager associe et avec une reference
50     JobId(Batch::BatchManager *, std::string ref);
51
52     // Operateur d'affectation entre objets
53     virtual JobId & operator =(const Batch::JobId &);
54
55     // Constructeur par recopie
56     JobId(const Batch::JobId &);
57
58     // Accesseur pour la reference interne
59     virtual std::string getReference() const;
60
61     // Methodes pour le controle du job
62     virtual void deleteJob() const; // retire un job du gestionnaire
63     virtual void holdJob() const; // suspend un job en file d'attente
64     virtual void releaseJob() const; // relache un job suspendu
65     virtual void alterJob(const Batch::Parametre & param, const Batch::Environnement & env) const; // modifie un job en file d'attente
66     virtual void alterJob(const Batch::Parametre & param) const; // modifie un job en file d'attente
67     virtual void alterJob(const Batch::Environnement & env) const; // modifie un job en file d'attente
68     virtual void setParametre(const Batch::Parametre & param) { return alterJob(param); } // modifie un job en file d'attente
69     virtual void setEnvironnement(const Batch::Environnement & env) { return alterJob(env); } // modifie un job en file d'attente
70     virtual Batch::JobInfo queryJob() const; // renvoie l'etat du job
71
72     // Methodes pour l'interfacage avec Python (SWIG)
73     // TODO : supprimer ces methodes et transferer leur definitions dans SWIG
74     std::string  __str__() const; // SWIG : affichage en Python
75     std::string  __repr__() const { return __str__(); }; // SWIG : affichage en Python
76
77   protected:
78     Batch::BatchManager * _p_batchmanager; // pointeur sur le BatchManager qui controle le job
79     std::string _reference; // reference du job au sein du BatchManager
80
81   private:
82
83   };
84
85 }
86
87 #endif