Salome HOME
Rename files:
[tools/libbatch.git] / src / Core / Constants.hxx
diff --git a/src/Core/Constants.hxx b/src/Core/Constants.hxx
new file mode 100644 (file)
index 0000000..5d16505
--- /dev/null
@@ -0,0 +1,77 @@
+//  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/*
+ * Constants.hxx :
+ *
+ * Auteur : Renaud BARATE - EDF R&D
+ * Date   : January 2010
+ *
+ */
+
+#ifndef _CONSTANTS_H_
+#define _CONSTANTS_H_
+
+#include <string>
+
+#include "Defines.hxx"
+
+// These macros simplify the creation of new string constants for keys and
+// values in parameters map.
+// TODO: replace those static declarations by an external description file (XML for instance)
+#define decl_extern_Constant(constant) extern BATCH_EXPORT const std::string constant
+#define def_Constant(constant) const std::string constant = #constant
+
+namespace Batch {
+
+  // Declaration of the keys for the parameter map
+  decl_extern_Constant(ARGUMENTS);
+  decl_extern_Constant(EXECUTABLE);
+  decl_extern_Constant(ID);
+  decl_extern_Constant(INFILE);
+  decl_extern_Constant(MAXCPUTIME);
+  decl_extern_Constant(MAXDISKSIZE);
+  decl_extern_Constant(MAXRAMSIZE);
+  decl_extern_Constant(MAXWALLTIME);
+  decl_extern_Constant(NAME);
+  decl_extern_Constant(NBPROC);
+  decl_extern_Constant(NBPROCPERNODE);
+  decl_extern_Constant(OUTFILE);
+  decl_extern_Constant(PID);
+  decl_extern_Constant(QUEUE);
+  decl_extern_Constant(STATE);
+  decl_extern_Constant(USER);
+  decl_extern_Constant(WORKDIR);
+  decl_extern_Constant(HOMEDIR);
+  decl_extern_Constant(EXCLUSIVE);
+
+  // These constants define the status of a job (parameter STATE)
+  decl_extern_Constant(CREATED);
+  decl_extern_Constant(IN_PROCESS);
+  decl_extern_Constant(QUEUED);
+  decl_extern_Constant(RUNNING);
+  decl_extern_Constant(PAUSED);
+  decl_extern_Constant(FINISHED);
+  decl_extern_Constant(FAILED);
+
+}
+
+#endif