1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/
23 * Auteur : Ivan DUTKA-MALEN - EDF R&D
24 * Date : Septembre 2003
29 #include "Batch_JobId.hxx"
30 #include "Batch_BatchManager.hxx"
33 //#include "MEDMEM_STRING.hxx"
38 // Constructeur standard
39 JobId::JobId() : _p_batchmanager(), _reference("undefined")
44 // Constructeur avec le pointeur sur le BatchManager associe et avec une reference
45 JobId::JobId(BatchManager * _p_bm, string ref) : _p_batchmanager(_p_bm), _reference(ref)
56 // Operateur d'affectation entre objets
57 JobId & JobId::operator =(const JobId & jobid)
59 _p_batchmanager = jobid._p_batchmanager;
60 _reference = jobid._reference;
65 // Constructeur par recopie
66 JobId::JobId(const JobId & jobid) : _p_batchmanager(jobid._p_batchmanager), _reference(jobid._reference)
71 // Accesseur pour la reference interne
72 string JobId::getReference() const
77 // Methode pour le controle du job : retire le job du gestionnaire
78 void JobId::deleteJob() const
80 assert(_p_batchmanager != 0);
81 _p_batchmanager->deleteJob(*this);
84 // Methode pour le controle du job : suspend le job en file d'attente
85 void JobId::holdJob() const
87 assert(_p_batchmanager != 0);
88 _p_batchmanager->holdJob(*this);
91 // Methode pour le controle du job : relache le job suspendu
92 void JobId::releaseJob() const
94 assert(_p_batchmanager != 0);
95 _p_batchmanager->releaseJob(*this);
98 // Methode pour le controle du job : modifie le job en file d'attente
99 void JobId::alterJob(const Parametre & param, const Environnement & env) const
101 assert(_p_batchmanager != 0);
102 _p_batchmanager->alterJob(*this, param, env);
105 // Methode pour le controle du job : modifie le job en file d'attente
106 void JobId::alterJob(const Parametre & param) const
108 assert(_p_batchmanager != 0);
109 _p_batchmanager->alterJob(*this, param);
112 // Methode pour le controle du job : modifie le job en file d'attente
113 void JobId::alterJob(const Environnement & env) const
115 assert(_p_batchmanager != 0);
116 _p_batchmanager->alterJob(*this, env);
119 // Methode pour le controle du job : renvoie l'etat du job
120 JobInfo JobId::queryJob() const
122 assert(_p_batchmanager != 0);
123 return _p_batchmanager->queryJob(*this);
127 // Methode pour l'interfacage avec Python (SWIG) : affichage en Python
128 string JobId::__str__() const {
129 //MEDMEM::STRING str;
131 str << "<JobId (" << this << ") : referenced '" << _reference << "'>";