FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_Param.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_Param_hpp_
10 #define _fei_Param_hpp_
11 
12 #include <fei_macros.hpp>
13 #include <string>
14 
15 namespace fei {
23 class Param {
24  public:
26  enum ParamType {
27  STRING = 0,
28  DOUBLE = 1,
29  INT = 2,
30  BOOL = 3,
31  VOID = 4,
32  BAD_TYPE = 5
33  };
34 
36  Param(const char* name, const char* value);
38  Param(const char* name, double value);
40  Param(const char* name, int value);
42  Param(const char* name, const void* value);
44  Param(const char* name, bool value);
46  Param(const Param& src);
47 
49  virtual ~Param();
50 
52  Param& operator=(const Param& src);
53 
55  const std::string& getName() const;
56 
58  ParamType getType() const;
59 
62  const std::string& getStringValue() const;
63 
66  double getDoubleValue() const;
67 
70  int getIntValue() const;
71 
74  bool getBoolValue() const;
75 
78  const void* getVoidValue() const;
79 
80  private:
81  ParamType type_;
82  std::string name_;
83  std::string string_value_;
84  double double_value_;
85  int int_value_;
86  bool bool_value_;
87  const void* void_value_;
88 };
89 }//namespace fei
90 
91 inline
92 const std::string& fei::Param::getName() const
93 {
94  return name_;
95 }
96 
97 inline
99 {
100  return type_;
101 }
102 
103 inline
104 const std::string& fei::Param::getStringValue() const
105 {
106  return string_value_;
107 }
108 
109 inline
111 {
112  return double_value_;
113 }
114 
115 inline
117 {
118  return int_value_;
119 }
120 
121 inline
123 {
124  return bool_value_;
125 }
126 
127 inline
128 const void* fei::Param::getVoidValue() const
129 {
130  return void_value_;
131 }
132 #endif
ParamType getType() const
Definition: fei_Param.hpp:98
virtual ~Param()
Definition: fei_Param.cpp:91
bool getBoolValue() const
Definition: fei_Param.hpp:122
int getIntValue() const
Definition: fei_Param.hpp:116
double getDoubleValue() const
Definition: fei_Param.hpp:110
const void * getVoidValue() const
Definition: fei_Param.hpp:128
Param(const char *name, const char *value)
Definition: fei_Param.cpp:14
const std::string & getStringValue() const
Definition: fei_Param.hpp:104
const std::string & getName() const
Definition: fei_Param.hpp:92
Param & operator=(const Param &src)
Definition: fei_Param.cpp:95