1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 * Auteur : Ivan DUTKA-MALEN - EDF R&D
24 * Date : Septembre 2003
35 #include "Batch_InvalidKeyException.hxx"
36 #include "Batch_Versatile.hxx"
39 // Ces macros permettent de simplifier l'ajout de nouvelles
40 // clefs dans la map Parametre
41 // TODO : remplacer ce mecanisme statique par la lecture
42 // TODO : d'une descrption dans un fichier exterieur (genre XML)
44 #define def_extern_MapKey(mk) extern const string & mk;
45 #define def_static_MapKey(mk) const string Batch::Parametre::mk(#mk); \
46 const string & mk = Batch::Parametre::mk;
50 class Parametre : public map< string, Versatile >
53 // Constructeur standard
56 // Constructeur par recopie
57 Parametre(const Parametre & PM);
59 // Operateur de recherche dans la map
60 Versatile & operator [] (const string &);
61 const Versatile & operator [] (const string &) const;
63 // Operateur d'affectation
64 Parametre & operator =(const Parametre & PM);
66 // Declarations statique des clefs de la map
67 // TODO : supprimer les declarations statiques des clefs de la map
68 static const string ACCOUNT;
69 static const string ARGUMENTS;
70 static const string CHECKPOINT;
71 static const string CKPTINTERVAL;
72 static const string CREATIONTIME;
73 static const string EGROUP;
74 static const string ELIGIBLETIME;
75 static const string ENDTIME;
76 static const string EUSER;
77 static const string EXECUTABLE;
78 static const string EXECUTIONHOST;
79 static const string EXITCODE;
80 static const string HOLD;
81 static const string ID;
82 static const string INFILE;
83 static const string MAIL;
84 static const string MAXCPUTIME;
85 static const string MAXDISKSIZE;
86 static const string MAXRAMSIZE;
87 static const string MAXWALLTIME;
88 static const string MODIFICATIONTIME;
89 static const string NAME;
90 static const string NBPROC;
91 static const string OUTFILE;
92 static const string PID;
93 static const string QUEUE;
94 static const string QUEUEDTIME;
95 static const string SERVER;
96 static const string STARTTIME;
97 static const string STATE;
98 static const string TEXT;
99 static const string TMPDIR;
100 static const string USEDCPUTIME;
101 static const string USEDDISKSIZE;
102 static const string USEDRAMSIZE;
103 static const string USEDWALLTIME;
104 static const string USER;
105 static const string WORKDIR;
108 map< string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef
116 def_extern_MapKey(ACCOUNT);
117 def_extern_MapKey(ARGUMENTS);
118 def_extern_MapKey(CHECKPOINT);
119 def_extern_MapKey(CKPTINTERVAL);
120 def_extern_MapKey(CREATIONTIME);
121 def_extern_MapKey(EGROUP);
122 def_extern_MapKey(ELIGIBLETIME);
123 def_extern_MapKey(ENDTIME);
124 def_extern_MapKey(EUSER);
125 def_extern_MapKey(EXECUTABLE);
126 def_extern_MapKey(EXECUTIONHOST);
127 def_extern_MapKey(EXITCODE);
128 def_extern_MapKey(HOLD);
129 def_extern_MapKey(ID);
130 def_extern_MapKey(INFILE);
131 def_extern_MapKey(MAIL);
132 def_extern_MapKey(MAXCPUTIME);
133 def_extern_MapKey(MAXDISKSIZE);
134 def_extern_MapKey(MAXRAMSIZE);
135 def_extern_MapKey(MAXWALLTIME);
136 def_extern_MapKey(MODIFICATIONTIME);
137 def_extern_MapKey(NAME);
138 def_extern_MapKey(NBPROC);
139 def_extern_MapKey(OUTFILE);
140 def_extern_MapKey(PID);
141 def_extern_MapKey(QUEUE);
142 def_extern_MapKey(QUEUEDTIME);
143 def_extern_MapKey(SERVER);
144 def_extern_MapKey(STARTTIME);
145 def_extern_MapKey(STATE);
146 def_extern_MapKey(TEXT);
147 def_extern_MapKey(TMPDIR);
148 def_extern_MapKey(USEDCPUTIME);
149 def_extern_MapKey(USEDDISKSIZE);
150 def_extern_MapKey(USEDRAMSIZE);
151 def_extern_MapKey(USEDWALLTIME);
152 def_extern_MapKey(USER);
153 def_extern_MapKey(WORKDIR);