]> SALOME platform Git repositories - modules/kernel.git/blob - src/Batch/Batch_BatchManager.hxx
Salome HOME
Merging from V4_1_0_maintainance for porting on Win32 Platform
[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 "Batch_Defines.hxx"
33
34 #include <string>
35 #include <map>
36 #include "Batch_Job.hxx"
37 #include "Batch_JobId.hxx"
38 #include "Batch_JobInfo.hxx"
39 #include "Batch_InvalidArgumentException.hxx"
40
41 namespace Batch {
42
43   class Job;
44   class JobId;
45   class JobInfo;
46   class FactBatchManager;
47
48   class BATCH_EXPORT BatchManager
49   {
50   public:
51     // Constructeur et destructeur
52     //BatchManager(std::string host="localhost") throw(InvalidArgumentException); // connexion a la machine host
53     BatchManager(const Batch::FactBatchManager * parent, const char * host="localhost") throw(InvalidArgumentException); // connexion a la machine host
54     virtual ~BatchManager();
55     virtual std::string __repr__() const;
56
57     // Recupere le l'identifiant d'un job deja soumis au BatchManager
58     //virtual const JobId getJobIdByReference(const std::string & ref);
59     virtual const Batch::JobId getJobIdByReference(const char * ref);
60
61     // Methodes pour le controle des jobs : virtuelles pures
62     virtual const Batch::JobId submitJob(const Batch::Job & job) = 0; // soumet un job au gestionnaire
63     virtual void deleteJob(const Batch::JobId & jobid) = 0; // retire un job du gestionnaire
64     virtual void holdJob(const Batch::JobId & jobid) = 0; // suspend un job en file d'attente
65     virtual void releaseJob(const Batch::JobId & jobid) = 0; // relache un job suspendu
66     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
67     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param) = 0; // modifie un job en file d'attente
68     virtual void alterJob(const Batch::JobId & jobid, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
69     virtual Batch::JobInfo queryJob(const Batch::JobId & jobid) = 0; // renvoie l'etat du job
70
71   protected:
72     std::string _hostname; // serveur ou tourne le BatchManager
73     // std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
74     std::map< std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
75     const Batch::FactBatchManager * _parent;
76
77   private:
78
79   };
80
81 }
82
83 #endif