Salome HOME
To avoid compilation pb on RedHat 8.0.
[modules/kernel.git] / src / Batch / Batch_BatchManager.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  * BatchManager.hxx : 
22  *
23  * Auteur : Ivan DUTKA-MALEN - EDF R&D
24  * Date   : Septembre 2003
25  * Projet : SALOME 2
26  *
27  */
28
29 #ifndef _BATCHMANAGER_H_
30 #define _BATCHMANAGER_H_
31
32 #include <string>
33 #include <map>
34 #include "Batch_Job.hxx"
35 #include "Batch_JobId.hxx"
36 #include "Batch_JobInfo.hxx"
37 #include "Batch_InvalidArgumentException.hxx"
38
39 namespace Batch {
40
41   class Job;
42   class JobId;
43   class JobInfo;
44   class FactBatchManager;
45
46   class BatchManager
47   {
48   public:
49     // Constructeur et destructeur
50     //BatchManager(std::string host="localhost") throw(InvalidArgumentException); // connexion a la machine host
51     BatchManager(const Batch::FactBatchManager * parent, const char * host="localhost") throw(InvalidArgumentException); // connexion a la machine host
52     virtual ~BatchManager();
53     virtual std::string __repr__() const;
54
55     // Recupere le l'identifiant d'un job deja soumis au BatchManager
56     //virtual const JobId getJobIdByReference(const std::string & ref);
57     virtual const Batch::JobId getJobIdByReference(const char * ref);
58
59     // Methodes pour le controle des jobs : virtuelles pures
60     virtual const Batch::JobId submitJob(const Batch::Job & job) = 0; // soumet un job au gestionnaire
61     virtual void deleteJob(const Batch::JobId & jobid) = 0; // retire un job du gestionnaire
62     virtual void holdJob(const Batch::JobId & jobid) = 0; // suspend un job en file d'attente
63     virtual void releaseJob(const Batch::JobId & jobid) = 0; // relache un job suspendu
64     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
65     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param) = 0; // modifie un job en file d'attente
66     virtual void alterJob(const Batch::JobId & jobid, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
67     virtual Batch::JobInfo queryJob(const Batch::JobId & jobid) = 0; // renvoie l'etat du job
68
69   protected:
70     std::string _hostname; // serveur ou tourne le BatchManager
71     // std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
72     std::map< std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
73     const Batch::FactBatchManager * _parent;
74
75   private:
76
77   };
78
79 }
80
81 #endif