Salome HOME
IDM : Batch sur CCRT
[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 #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(const Batch::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 Batch::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 ARGUMENTS;
50     static const std::string CHECKPOINT;
51     static const std::string CKPTINTERVAL;
52     static const std::string CREATIONTIME;
53     static const std::string EGROUP;
54     static const std::string ELIGIBLETIME;
55     static const std::string ENDTIME;
56     static const std::string EUSER;
57     static const std::string EXECUTABLE;
58     static const std::string EXECUTIONHOST;
59     static const std::string EXITCODE;
60     static const std::string HOLD;
61     static const std::string ID;
62     static const std::string INFILE;
63     static const std::string MAIL;
64     static const std::string MAXCPUTIME;
65     static const std::string MAXDISKSIZE;
66     static const std::string MAXRAMSIZE;
67     static const std::string MAXWALLTIME;
68     static const std::string MODIFICATIONTIME;
69     static const std::string NAME;
70     static const std::string NBPROC;
71     static const std::string OUTFILE;
72     static const std::string PID;
73     static const std::string QUEUE;
74     static const std::string QUEUEDTIME;
75     static const std::string SERVER;
76     static const std::string STARTTIME;
77     static const std::string STATE;
78     static const std::string TEXT;
79     static const std::string TMPDIR;
80     static const std::string USEDCPUTIME;
81     static const std::string USEDDISKSIZE;
82     static const std::string USEDRAMSIZE;
83     static const std::string USEDWALLTIME;
84     static const std::string USER;
85
86   protected:
87     std::map< std::string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef
88
89   private:
90
91   };
92
93 }
94
95 def_extern_MapKey(ACCOUNT);
96 def_extern_MapKey(ARGUMENTS);
97 def_extern_MapKey(CHECKPOINT);
98 def_extern_MapKey(CKPTINTERVAL);
99 def_extern_MapKey(CREATIONTIME);
100 def_extern_MapKey(EGROUP);
101 def_extern_MapKey(ELIGIBLETIME);
102 def_extern_MapKey(ENDTIME);
103 def_extern_MapKey(EUSER);
104 def_extern_MapKey(EXECUTABLE);
105 def_extern_MapKey(EXECUTIONHOST);
106 def_extern_MapKey(EXITCODE);
107 def_extern_MapKey(HOLD);
108 def_extern_MapKey(ID);
109 def_extern_MapKey(INFILE);
110 def_extern_MapKey(MAIL);
111 def_extern_MapKey(MAXCPUTIME);
112 def_extern_MapKey(MAXDISKSIZE);
113 def_extern_MapKey(MAXRAMSIZE);
114 def_extern_MapKey(MAXWALLTIME);
115 def_extern_MapKey(MODIFICATIONTIME);
116 def_extern_MapKey(NAME);
117 def_extern_MapKey(NBPROC);
118 def_extern_MapKey(OUTFILE);
119 def_extern_MapKey(PID);
120 def_extern_MapKey(QUEUE);
121 def_extern_MapKey(QUEUEDTIME);
122 def_extern_MapKey(SERVER);
123 def_extern_MapKey(STARTTIME);
124 def_extern_MapKey(STATE);
125 def_extern_MapKey(TEXT);
126 def_extern_MapKey(TMPDIR);
127 def_extern_MapKey(USEDCPUTIME);
128 def_extern_MapKey(USEDDISKSIZE);
129 def_extern_MapKey(USEDRAMSIZE);
130 def_extern_MapKey(USEDWALLTIME);
131 def_extern_MapKey(USER);
132
133 #endif