Salome HOME
Porting to Mandrake 10.1 and new products:
[modules/kernel.git] / src / Batch / Batch_JobInfo.cxx
1 /*
2  * JobInfo.cxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Mail   : mailto:ivan.dutka-malen@der.edf.fr
6  * Date   : Thu Nov  6 10:05:30 2003
7  * Projet : Salome 2
8  *
9  */
10
11 #include <iostream>
12 #include <string>
13 #include <sstream>
14 //#include "MEDMEM_STRING.hxx"
15 #include "Batch_JobInfo.hxx"
16 using namespace std;
17
18 namespace Batch {
19
20   // Destructeur
21   JobInfo::~JobInfo()
22   {
23     // Nothing to do
24   }
25   
26
27   // Operateur pour l'affichage sur un stream
28   ostream & operator <<(ostream & os, const JobInfo & ji)
29   {
30     return os << ji.__str__();
31   }
32
33
34   // Methodes pour l'interfacage avec Python (SWIG) : affichage en Python
35   string JobInfo::__str__() const
36   {
37     //MEDMEM::STRING sst; 
38     ostringstream sst;
39     sst << "<JobInfo (" << this << ") :" << endl;
40     sst << " ID = " <<_param[ID] << endl;
41
42     sst << "  + Parametre :" << endl;
43     Parametre::const_iterator itp;
44     for(itp=_param.begin(); itp!=_param.end(); itp++) {
45       if ( (*itp).first != ID ) {
46         sst << "    * " << (*itp).first << " = " << (*itp).second << endl;
47       }
48     }
49
50     sst << "  + Environnement :" << endl;
51     Environnement::const_iterator ite;
52     for(ite=_env.begin(); ite!=_env.end(); ite++) {
53       sst << "    * " << (*ite).first << " = " << (*ite).second << endl;
54     }
55
56     sst << " >";
57
58     return sst.str();
59   }
60
61   // Accesseur
62   Parametre JobInfo::getParametre() const
63   {
64     return _param;
65   }
66
67   // Accesseur
68   Environnement JobInfo::getEnvironnement() const
69   {
70     return _env;
71   }
72
73
74 }