1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#include "SettingHolder.hpp"<--- Skipping configuration 'DBL_MAX' since the value of 'DBL_MAX' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'DBL_MIN' since the value of 'DBL_MIN' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'M_PI' since the value of 'M_PI' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
#include "CubitDefines.h"
#include "CubitString.hpp"
#include "CubitUtil.hpp"
#include "CubitMessage.hpp"


/////////////////////SettingHolder CONSTRUCTORS/////////////////////////


SettingHolder::SettingHolder()<--- Member variable 'SettingHolder::int_value' is not initialized in the constructor.<--- Member variable 'SettingHolder::double_value' is not initialized in the constructor.
{
 setting_type = SETTING_UNKNOWN_VALUE_TYPE;
  description = "";<--- Variable 'description' is assigned in constructor body. Consider performing initialization in initialization list.
  name = "";<--- Variable 'name' is assigned in constructor body. Consider performing initialization in initialization list.

  get_int_function    = NULL;
  set_int_function    = NULL; 
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = NULL;
  set_string_function = NULL;

}

// constructor for int settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (int), 
			     int (*getFn)(), int value)
{
  setting_type = SETTING_INT_VALUE_TYPE;
  int_value    = value;
  double_value = 0.0;
  string_value = "";
  description = "";
  name = n; 

  get_int_function    = getFn;
  set_int_function    = setFn; 
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = NULL;
  set_string_function = NULL;

}

// constructor for double settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (double), 
			     double (*getFn)(), double value)
{ 
  setting_type = SETTING_DOUBLE_VALUE_TYPE;
  int_value    = 0;
  double_value = value;
  string_value = "";
  description = "";
  name = n;

  get_int_function    = NULL;
  set_int_function    = NULL;
  get_double_function = getFn;
  set_double_function = setFn;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = NULL;
  set_string_function = NULL;

}


// constructor for boolean settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (CubitBoolean), 
			     CubitBoolean (*getFn)(), CubitBoolean)
{ 
  setting_type = SETTING_CUBITBOOLEAN_VALUE_TYPE;
  int_value    = 0;
  double_value = 0.0;
  description = "";<--- Variable 'description' is assigned in constructor body. Consider performing initialization in initialization list.
  name = n;<--- Variable 'name' is assigned in constructor body. Consider performing initialization in initialization list.

  get_int_function    = NULL;
  set_int_function    = NULL;
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = getFn;
  set_bool_function   = setFn;
  get_string_function = NULL;
  set_string_function = NULL;
  
}

// constructor for string settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (CubitString), 
			     CubitString (*getFn)(), char* value)
{ 
  setting_type = SETTING_CUBITSTRING_VALUE_TYPE;
  int_value    = 0;
  double_value = 0.0;
  string_value = value;<--- Variable 'string_value' is assigned in constructor body. Consider performing initialization in initialization list.
  description = "";<--- Variable 'description' is assigned in constructor body. Consider performing initialization in initialization list.
  name = n;<--- Variable 'name' is assigned in constructor body. Consider performing initialization in initialization list.
  
  get_int_function   = NULL;
  set_int_function   = NULL;
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = getFn;
  set_string_function = setFn;  

}

// This is added for settings function.
// constructor for int settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (int),
			     int (*getFn)())
{
  setting_type = SETTING_INT_VALUE_TYPE;
  description = "";
  name = n;

  get_int_function    = getFn;
  set_int_function    = setFn;
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = NULL;
  set_string_function = NULL;

}

// constructor for double settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (double),
			     double (*getFn)())
{
  setting_type = SETTING_DOUBLE_VALUE_TYPE;
  description = "";
  name = n;

  get_int_function    = NULL;
  set_int_function    = NULL;
  get_double_function = getFn;
  set_double_function = setFn;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = NULL;
  set_string_function = NULL;

}


// constructor for boolean settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (CubitBoolean),
			     CubitBoolean (*getFn)())
{
  setting_type = SETTING_CUBITBOOLEAN_VALUE_TYPE;
  description = "";
  name = n;

  get_int_function    = NULL;
  set_int_function    = NULL;
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = getFn;
  set_bool_function   = setFn;
  get_string_function = NULL;
  set_string_function = NULL;

}

// constructor for string settings
SettingHolder::SettingHolder(CubitString n, void (*setFn) (CubitString),<--- Member variable 'SettingHolder::int_value' is not initialized in the constructor.<--- Member variable 'SettingHolder::double_value' is not initialized in the constructor.
			     CubitString (*getFn)())
{
  setting_type = SETTING_CUBITSTRING_VALUE_TYPE;
  description = "";<--- Variable 'description' is assigned in constructor body. Consider performing initialization in initialization list.
  name = n;<--- Variable 'name' is assigned in constructor body. Consider performing initialization in initialization list.

  get_int_function   = NULL;
  set_int_function   = NULL;
  get_double_function = NULL;
  set_double_function = NULL;
  get_bool_function   = NULL;
  set_bool_function   = NULL;
  get_string_function = getFn;
  set_string_function = setFn;

}


SettingHolder::~SettingHolder() {}