]> SALOME platform Git repositories - modules/kernel.git/blob - src/Batch/Batch_Parametre.hxx
Salome HOME
Porting functionality on Win32 Platform
[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/ or email : webmaster.salome@opencascade.com
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 "Batch_Defines.hxx"
33
34 #include <map>
35 #include <string>
36 #include "Batch_InvalidKeyException.hxx"
37 #include "Batch_Versatile.hxx"
38
39 using namespace std;
40
41 // Ces macros permettent de simplifier l'ajout de nouvelles
42 // clefs dans la map Parametre
43 // TODO : remplacer ce mecanisme statique par la lecture
44 // TODO : d'une descrption dans un fichier exterieur (genre XML)
45
46 #define def_extern_MapKey(mk) extern BATCH_EXPORT const string & mk;
47 #define def_static_MapKey(mk) const string Batch::Parametre::mk(#mk);   \
48   const string & mk = Batch::Parametre::mk;
49
50 namespace Batch {
51
52   class BATCH_EXPORT Parametre : public map< string, Versatile >
53   {
54   public:
55     // Constructeur standard
56     Parametre();
57
58     // Constructeur par recopie
59     Parametre(const Parametre & PM);
60
61     // Operateur de recherche dans la map
62     Versatile & operator [] (const string &);
63     const Versatile & operator [] (const string &) const;
64
65     // Operateur d'affectation
66     Parametre & operator =(const Parametre & PM);
67
68     // Declarations statique des clefs de la map
69     // TODO : supprimer les declarations statiques des clefs de la map
70     static const string ACCOUNT;
71     static const string ARGUMENTS;
72     static const string CHECKPOINT;
73     static const string CKPTINTERVAL;
74     static const string CREATIONTIME;
75     static const string EGROUP;
76     static const string ELIGIBLETIME;
77     static const string ENDTIME;
78     static const string EUSER;
79     static const string EXECUTABLE;
80     static const string EXECUTIONHOST;
81     static const string EXITCODE;
82     static const string HOLD;
83     static const string ID;
84     static const string INFILE;
85     static const string MAIL;
86     static const string MAXCPUTIME;
87     static const string MAXDISKSIZE;
88     static const string MAXRAMSIZE;
89     static const string MAXWALLTIME;
90     static const string MODIFICATIONTIME;
91     static const string NAME;
92     static const string NBPROC;
93     static const string OUTFILE;
94     static const string PID;
95     static const string QUEUE;
96     static const string QUEUEDTIME;
97     static const string SERVER;
98     static const string STARTTIME;
99     static const string STATE;
100     static const string TEXT;
101     static const string TMPDIR;
102     static const string USEDCPUTIME;
103     static const string USEDDISKSIZE;
104     static const string USEDRAMSIZE;
105     static const string USEDWALLTIME;
106     static const string USER;
107     static const string WORKDIR;
108     static const string HOMEDIR;
109
110   protected:
111     map< string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef
112
113   private:
114
115   };
116
117 }
118
119 def_extern_MapKey(ACCOUNT);
120 def_extern_MapKey(ARGUMENTS);
121 def_extern_MapKey(CHECKPOINT);
122 def_extern_MapKey(CKPTINTERVAL);
123 def_extern_MapKey(CREATIONTIME);
124 def_extern_MapKey(EGROUP);
125 def_extern_MapKey(ELIGIBLETIME);
126 def_extern_MapKey(ENDTIME);
127 def_extern_MapKey(EUSER);
128 def_extern_MapKey(EXECUTABLE);
129 def_extern_MapKey(EXECUTIONHOST);
130 def_extern_MapKey(EXITCODE);
131 def_extern_MapKey(HOLD);
132 def_extern_MapKey(ID);
133 def_extern_MapKey(INFILE);
134 def_extern_MapKey(MAIL);
135 def_extern_MapKey(MAXCPUTIME);
136 def_extern_MapKey(MAXDISKSIZE);
137 def_extern_MapKey(MAXRAMSIZE);
138 def_extern_MapKey(MAXWALLTIME);
139 def_extern_MapKey(MODIFICATIONTIME);
140 def_extern_MapKey(NAME);
141 def_extern_MapKey(NBPROC);
142 def_extern_MapKey(OUTFILE);
143 def_extern_MapKey(PID);
144 def_extern_MapKey(QUEUE);
145 def_extern_MapKey(QUEUEDTIME);
146 def_extern_MapKey(SERVER);
147 def_extern_MapKey(STARTTIME);
148 def_extern_MapKey(STATE);
149 def_extern_MapKey(TEXT);
150 def_extern_MapKey(TMPDIR);
151 def_extern_MapKey(USEDCPUTIME);
152 def_extern_MapKey(USEDDISKSIZE);
153 def_extern_MapKey(USEDRAMSIZE);
154 def_extern_MapKey(USEDWALLTIME);
155 def_extern_MapKey(USER);
156 def_extern_MapKey(WORKDIR);
157 def_extern_MapKey(HOMEDIR);
158
159 #endif