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