1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 * Auteur : Ivan DUTKA-MALEN - EDF R&D
26 * Date : Septembre 2003
31 #include "Batch_JobId.hxx"
32 #include "Batch_BatchManager.hxx"
35 //#include "MEDMEM_STRING.hxx"
40 // Constructeur standard
41 JobId::JobId() : _p_batchmanager(), _reference("undefined")
46 // Constructeur avec le pointeur sur le BatchManager associe et avec une reference
47 JobId::JobId(BatchManager * _p_bm, string ref) : _p_batchmanager(_p_bm), _reference(ref)
58 // Operateur d'affectation entre objets
59 JobId & JobId::operator =(const JobId & jobid)
61 _p_batchmanager = jobid._p_batchmanager;
62 _reference = jobid._reference;
67 // Constructeur par recopie
68 JobId::JobId(const JobId & jobid) : _p_batchmanager(jobid._p_batchmanager), _reference(jobid._reference)
73 // Accesseur pour la reference interne
74 string JobId::getReference() const
79 // Methode pour le controle du job : retire le job du gestionnaire
80 void JobId::deleteJob() const
82 assert(_p_batchmanager != 0);
83 _p_batchmanager->deleteJob(*this);
86 // Methode pour le controle du job : suspend le job en file d'attente
87 void JobId::holdJob() const
89 assert(_p_batchmanager != 0);
90 _p_batchmanager->holdJob(*this);
93 // Methode pour le controle du job : relache le job suspendu
94 void JobId::releaseJob() const
96 assert(_p_batchmanager != 0);
97 _p_batchmanager->releaseJob(*this);
100 // Methode pour le controle du job : modifie le job en file d'attente
101 void JobId::alterJob(const Parametre & param, const Environnement & env) const
103 assert(_p_batchmanager != 0);
104 _p_batchmanager->alterJob(*this, param, env);
107 // Methode pour le controle du job : modifie le job en file d'attente
108 void JobId::alterJob(const Parametre & param) const
110 assert(_p_batchmanager != 0);
111 _p_batchmanager->alterJob(*this, param);
114 // Methode pour le controle du job : modifie le job en file d'attente
115 void JobId::alterJob(const Environnement & env) const
117 assert(_p_batchmanager != 0);
118 _p_batchmanager->alterJob(*this, env);
121 // Methode pour le controle du job : renvoie l'etat du job
122 JobInfo JobId::queryJob() const
124 assert(_p_batchmanager != 0);
125 return _p_batchmanager->queryJob(*this);
129 // Methode pour l'interfacage avec Python (SWIG) : affichage en Python
130 string JobId::__str__() const {
131 //MEDMEM::STRING str;
133 str << "<JobId (" << this << ") : referenced '" << _reference << "'>";