1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 * Auteur : Ivan DUTKA-MALEN - EDF R&D
26 * Date : Septembre 2003
34 #include "Batch_Defines.hxx"
38 #include "Batch_InvalidKeyException.hxx"
39 #include "Batch_Versatile.hxx"
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)
46 #define def_extern_MapKey(mk) extern BATCH_EXPORT const std::string & mk;
47 #define def_static_MapKey(mk) const std::string Batch::Parametre::mk(#mk); \
48 const std::string & mk = Batch::Parametre::mk;
52 class BATCH_EXPORT Parametre : public std::map< std::string, Versatile >
55 // Constructeur standard
58 // Constructeur par recopie
59 Parametre(const Parametre & PM);
61 // Operateur de recherche dans la map
62 Versatile & operator [] (const std::string &);
63 const Versatile & operator [] (const std::string &) const;
65 // Operateur d'affectation
66 Parametre & operator =(const Parametre & PM);
68 // Declarations statique des clefs de la map
69 // TODO : supprimer les declarations statiques des clefs de la map
70 static const std::string ACCOUNT;
71 static const std::string ARGUMENTS;
72 static const std::string CHECKPOINT;
73 static const std::string CKPTINTERVAL;
74 static const std::string CREATIONTIME;
75 static const std::string EGROUP;
76 static const std::string ELIGIBLETIME;
77 static const std::string ENDTIME;
78 static const std::string EUSER;
79 static const std::string EXECUTABLE;
80 static const std::string EXECUTIONHOST;
81 static const std::string EXITCODE;
82 static const std::string HOLD;
83 static const std::string ID;
84 static const std::string INFILE;
85 static const std::string MAIL;
86 static const std::string MAXCPUTIME;
87 static const std::string MAXDISKSIZE;
88 static const std::string MAXRAMSIZE;
89 static const std::string MAXWALLTIME;
90 static const std::string MODIFICATIONTIME;
91 static const std::string NAME;
92 static const std::string NBPROC;
93 static const std::string OUTFILE;
94 static const std::string PID;
95 static const std::string QUEUE;
96 static const std::string QUEUEDTIME;
97 static const std::string SERVER;
98 static const std::string STARTTIME;
99 static const std::string STATE;
100 static const std::string TEXT;
101 static const std::string TMPDIR;
102 static const std::string USEDCPUTIME;
103 static const std::string USEDDISKSIZE;
104 static const std::string USEDRAMSIZE;
105 static const std::string USEDWALLTIME;
106 static const std::string USER;
107 static const std::string WORKDIR;
108 static const std::string HOMEDIR;
111 std::map< std::string, TypeParam > TypeMap; // map interne servant a controler le type de la valeur associee a chaque clef
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);