Salome HOME
PR: new python function getShortHostName() in Utils_Identity.py, based on socket...
[modules/yacs.git] / src / Batch / Batch_Parametre.hxx
1 /*
2  * Parametre.hxx : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Date   : Septembre 2003
6  * Projet : SALOME 2
7  *
8  */
9
10 #ifndef _PARAMETRE_H_
11 #define _PARAMETRE_H_
12
13 #include <map>
14 #include <string>
15 #include "Batch_InvalidKeyException.hxx"
16 #include "Batch_Versatile.hxx"
17
18
19 // Ces macros permettent de simplifier l'ajout de nouvelles
20 // clefs dans la map Parametre
21 // TODO : remplacer ce mecanisme statique par la lecture
22 // TODO : d'une descrption dans un fichier exterieur (genre XML)
23
24 #define def_extern_MapKey(mk) extern const std::string & mk;
25 #define def_static_MapKey(mk) const std::string Batch::Parametre::mk(#mk); \
26                               const std::string & mk = Batch::Parametre::mk;
27
28 namespace Batch {
29
30   class Parametre : public std::map< std::string, Versatile >
31   {
32   public:
33                 // Constructeur standard
34     Parametre();
35
36                 // Constructeur par recopie
37     Parametre::Parametre(const Parametre & PM);
38
39                 // Operateur de recherche dans la map
40     Versatile & operator [] (const std::string &);
41     const Versatile & operator [] (const std::string &) const;
42
43                 // Operateur d'affectation
44     Parametre & operator =(const Parametre & PM);
45
46                 // Declarations statique des clefs de la map
47                 // TODO : supprimer les declarations statiques des clefs de la map
48     static const std::string ACCOUNT;
49     static const std::string CHECKPOINT;
50     static const std::string CKPTINTERVAL;
51     static const std::string CREATIONTIME;
52     static const std::string EGROUP;
53     static const std::string ELIGIBLETIME;
54     static const std::string EUSER;
55     static const std::string EXECUTABLE;
56     static const std::string EXECUTIONHOST;
57     static const std::string HOLD;
58     static const std::string ID;
59     static const std::string INFILE;
60     static const std::string MAIL;
61     static const std::string MAXCPUTIME;
62     static const std::string MAXDISKSIZE;
63     static const std::string MAXRAMSIZE;
64     static const std::string MAXWALLTIME;
65     static const std::string MODIFICATIONTIME;
66     static const std::string NAME;
67     static const std::string OUTFILE;
68     static const std::string PID;
69     static const std::string QUEUE;
70     static const std::string QUEUEDTIME;
71     static const std::string SERVER;
72     static const std::string STARTDATE;
73     static const std::string STATE;
74     static const std::string TEXT;
75     static const std::string TMPDIR;
76     static const std::string USEDCPUTIME;
77     static const std::string USEDDISKSIZE;
78     static const std::string USEDRAMSIZE;
79     static const std::string USEDWALLTIME;
80     static const std::string USER;
81
82   protected:
83     std::map< std::string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef
84
85   private:
86
87   };
88
89 }
90
91 def_extern_MapKey(ACCOUNT);
92 def_extern_MapKey(CHECKPOINT);
93 def_extern_MapKey(CKPTINTERVAL);
94 def_extern_MapKey(CREATIONTIME);
95 def_extern_MapKey(EGROUP);
96 def_extern_MapKey(ELIGIBLETIME);
97 def_extern_MapKey(EUSER);
98 def_extern_MapKey(EXECUTABLE);
99 def_extern_MapKey(EXECUTIONHOST);
100 def_extern_MapKey(HOLD);
101 def_extern_MapKey(ID);
102 def_extern_MapKey(INFILE);
103 def_extern_MapKey(MAIL);
104 def_extern_MapKey(MAXCPUTIME);
105 def_extern_MapKey(MAXDISKSIZE);
106 def_extern_MapKey(MAXRAMSIZE);
107 def_extern_MapKey(MAXWALLTIME);
108 def_extern_MapKey(MODIFICATIONTIME);
109 def_extern_MapKey(NAME);
110 def_extern_MapKey(OUTFILE);
111 def_extern_MapKey(PID);
112 def_extern_MapKey(QUEUE);
113 def_extern_MapKey(QUEUEDTIME);
114 def_extern_MapKey(SERVER);
115 def_extern_MapKey(STARTDATE);
116 def_extern_MapKey(STATE);
117 def_extern_MapKey(TEXT);
118 def_extern_MapKey(TMPDIR);
119 def_extern_MapKey(USEDCPUTIME);
120 def_extern_MapKey(USEDDISKSIZE);
121 def_extern_MapKey(USEDRAMSIZE);
122 def_extern_MapKey(USEDWALLTIME);
123 def_extern_MapKey(USER);
124
125 #endif