Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/ParameterSet.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2004 Sandia Corporation and Argonne National
5  Laboratory. Under the terms of Contract DE-AC04-94AL85000
6  with Sandia Corporation, the U.S. Government retains certain
7  rights in this software.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  (lgpl.txt) along with this library; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 
23  diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
24  pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov
25 
26  ***************************************************************** */
27 #ifndef MESQUITE_PARAMETER_SET_HPP
28 #define MESQUITE_PARAMETER_SET_HPP
29 
30 
31 #ifdef MSQ_USE_OLD_C_HEADERS
32 # include <stddef.h>
33 #else
34 # include <cstddef>
35 #endif
36 
37 #include "Mesquite.hpp"
38 #include "MsqError.hpp"
39 
40 namespace Mesquite
41 {
42 
44  {
45  public:
46  ParameterSet();
47  ~ParameterSet();
48 
49  void add_int_parameter(const char* name,
50  int initial_value, MsqError &err);
51  void set_int_parameter(const char* name,
52  int value, MsqError &err);
53  void get_int_parameter(const char* name,
54  int* value, MsqError &err);
55 
56  void remove_parameter(const char* name, MsqError &err);
57 
58  private:
59 
61  {
63  {
69  };
70 
72  {
73  int intVal;
74  double dblVal;
75  void* ptrVal;
76  char* strVal;
77  bool boolVal;
78  };
79 
80  char* name;
83  };
84 
86  msq_stdc::size_t mNumParameters;
87 
88  // returns the 0-based index of where the parameter
89  // with the given name can be found in mParameterArray,
90  // or mNumParameters if it can't be found.
91  msq_stdc::size_t get_parameter_index(const char* name, MsqError &err);
92 
93  void generic_add_parameter(const char* name, MsqError &err);
94  };
95 
96 }
97 
98 #endif
void generic_add_parameter(const char *name, MsqError &err)
Used to hold the error state and return it to the application.
msq_stdc::size_t get_parameter_index(const char *name, MsqError &err)
void remove_parameter(const char *name, MsqError &err)
void set_int_parameter(const char *name, int value, MsqError &err)
void add_int_parameter(const char *name, int initial_value, MsqError &err)
void get_int_parameter(const char *name, int *value, MsqError &err)