Salome HOME
Copyrights update
[modules/kernel.git] / src / Batch / Batch_Parametre.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
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.
8 // 
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.
13 //
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
17 //
18 // See http://www.salome-platform.org/
19 //
20 /*
21  * Parametre.hxx : 
22  *
23  * Auteur : Ivan DUTKA-MALEN - EDF R&D
24  * Date   : Septembre 2003
25  * Projet : SALOME 2
26  *
27  */
28
29 #ifndef _PARAMETRE_H_
30 #define _PARAMETRE_H_
31
32 #include <map>
33 #include <string>
34 #include "Batch_InvalidKeyException.hxx"
35 #include "Batch_Versatile.hxx"
36
37
38 // Ces macros permettent de simplifier l'ajout de nouvelles
39 // clefs dans la map Parametre
40 // TODO : remplacer ce mecanisme statique par la lecture
41 // TODO : d'une descrption dans un fichier exterieur (genre XML)
42
43 #define def_extern_MapKey(mk) extern const std::string & mk;
44 #define def_static_MapKey(mk) const std::string Batch::Parametre::mk(#mk);      \
45   const std::string & mk = Batch::Parametre::mk;
46
47 namespace Batch {
48
49   class Parametre : public std::map< std::string, Versatile >
50   {
51   public:
52     // Constructeur standard
53     Parametre();
54
55     // Constructeur par recopie
56     Parametre(const Batch::Parametre & PM);
57
58     // Operateur de recherche dans la map
59     Versatile & operator [] (const std::string &);
60     const Versatile & operator [] (const std::string &) const;
61
62     // Operateur d'affectation
63     Parametre & operator =(const Batch::Parametre & PM);
64
65     // Declarations statique des clefs de la map
66     // TODO : supprimer les declarations statiques des clefs de la map
67     static const std::string ACCOUNT;
68     static const std::string ARGUMENTS;
69     static const std::string CHECKPOINT;
70     static const std::string CKPTINTERVAL;
71     static const std::string CREATIONTIME;
72     static const std::string EGROUP;
73     static const std::string ELIGIBLETIME;
74     static const std::string ENDTIME;
75     static const std::string EUSER;
76     static const std::string EXECUTABLE;
77     static const std::string EXECUTIONHOST;
78     static const std::string EXITCODE;
79     static const std::string HOLD;
80     static const std::string ID;
81     static const std::string INFILE;
82     static const std::string MAIL;
83     static const std::string MAXCPUTIME;
84     static const std::string MAXDISKSIZE;
85     static const std::string MAXRAMSIZE;
86     static const std::string MAXWALLTIME;
87     static const std::string MODIFICATIONTIME;
88     static const std::string NAME;
89     static const std::string NBPROC;
90     static const std::string OUTFILE;
91     static const std::string PID;
92     static const std::string QUEUE;
93     static const std::string QUEUEDTIME;
94     static const std::string SERVER;
95     static const std::string STARTTIME;
96     static const std::string STATE;
97     static const std::string TEXT;
98     static const std::string TMPDIR;
99     static const std::string USEDCPUTIME;
100     static const std::string USEDDISKSIZE;
101     static const std::string USEDRAMSIZE;
102     static const std::string USEDWALLTIME;
103     static const std::string USER;
104
105   protected:
106     std::map< std::string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef
107
108   private:
109
110   };
111
112 }
113
114 def_extern_MapKey(ACCOUNT);
115 def_extern_MapKey(ARGUMENTS);
116 def_extern_MapKey(CHECKPOINT);
117 def_extern_MapKey(CKPTINTERVAL);
118 def_extern_MapKey(CREATIONTIME);
119 def_extern_MapKey(EGROUP);
120 def_extern_MapKey(ELIGIBLETIME);
121 def_extern_MapKey(ENDTIME);
122 def_extern_MapKey(EUSER);
123 def_extern_MapKey(EXECUTABLE);
124 def_extern_MapKey(EXECUTIONHOST);
125 def_extern_MapKey(EXITCODE);
126 def_extern_MapKey(HOLD);
127 def_extern_MapKey(ID);
128 def_extern_MapKey(INFILE);
129 def_extern_MapKey(MAIL);
130 def_extern_MapKey(MAXCPUTIME);
131 def_extern_MapKey(MAXDISKSIZE);
132 def_extern_MapKey(MAXRAMSIZE);
133 def_extern_MapKey(MAXWALLTIME);
134 def_extern_MapKey(MODIFICATIONTIME);
135 def_extern_MapKey(NAME);
136 def_extern_MapKey(NBPROC);
137 def_extern_MapKey(OUTFILE);
138 def_extern_MapKey(PID);
139 def_extern_MapKey(QUEUE);
140 def_extern_MapKey(QUEUEDTIME);
141 def_extern_MapKey(SERVER);
142 def_extern_MapKey(STARTTIME);
143 def_extern_MapKey(STATE);
144 def_extern_MapKey(TEXT);
145 def_extern_MapKey(TMPDIR);
146 def_extern_MapKey(USEDCPUTIME);
147 def_extern_MapKey(USEDDISKSIZE);
148 def_extern_MapKey(USEDRAMSIZE);
149 def_extern_MapKey(USEDWALLTIME);
150 def_extern_MapKey(USER);
151
152 #endif