-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobalVariablesArea.cc
134 lines (106 loc) · 4.02 KB
/
GlobalVariablesArea.cc
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
/*!
\file GlobalVariablesArea.cc
\brief Implementazione di GlobalVariablesArea
\author Andrea Zanelli
\date 19-11-2008
*/
#ifndef GLOBALVARIABLESAREA_CC_INCLUSION_GUARD
#define GLOBALVARIABLESAREA_CC_INCLUSION_GUARD
#include "GlobalVariablesArea.h"
/* void add_variable_S(const string& name, const int16_t& value) **************/
void
GlobalVariablesArea::add_variable_S(const string& name, const int16_t& value) {
variables_s.insert(make_pair(name,value));
return;
}
/* void add_variable_C(const string& name, const uint16_t& value) *************/
void
GlobalVariablesArea::add_variable_C(const string& name, const uint16_t& value) {
variables_c.insert(make_pair(name,value));
return;
}
/* void add_variable_I(const string& name, const int32_t& value) **************/
void
GlobalVariablesArea::add_variable_I(const string& name, const int32_t& value) {
variables_i.insert(make_pair(name,value));
return;
}
/* void add_variable_J(const string& name, const int64_t& value) **************/
void
GlobalVariablesArea::add_variable_J(const string& name, const int64_t& value) {
variables_j.insert(make_pair(name,value));
return;
}
/* void set_variable_S(const string& name, const int16_t& value) **************/
void
GlobalVariablesArea::set_variable_S(const string& name, const int16_t& value) {
map<string,int16_t>::iterator iter = variables_s.find(name);
if(iter == variables_s.end())
throw string("variabile globale inesistente: " + name + " S");
else
iter->second = value;
return;
}
/* void set_variable_C(const string& name, const uint16_t& value) **************/
void
GlobalVariablesArea::set_variable_C(const string& name, const uint16_t& value) {
map<string,uint16_t>::iterator iter = variables_c.find(name);
if(iter == variables_c.end())
throw string("variabile globale inesistente: " + name + " C");
else
iter->second = value;
return;
}
/* void set_variable_I(const string& name, const int32_t& value) **************/
void
GlobalVariablesArea::set_variable_I(const string& name, const int32_t& value) {
map<string,int32_t>::iterator iter = variables_i.find(name);
if(iter == variables_i.end())
throw string("variabile globale inesistente: " + name + " I");
else
iter->second = value;
return;
}
/* void set_variable_J(const string& name, const int64_t& value) **************/
void
GlobalVariablesArea::set_variable_J(const string& name, const int64_t& value) {
map<string,int64_t>::iterator iter = variables_j.find(name);
if(iter == variables_j.end())
throw string("variabile globale inesistente: " + name + " J");
else
iter->second = value;
return;
}
/* int16_t get_variable_S(const string& name) const ***************************/
int16_t
GlobalVariablesArea::get_variable_S(const string& name) const {
map<string,int16_t>::const_iterator iter = variables_s.find(name);
if(iter == variables_s.end())
throw string("variabile globale inesistente: " + name + " S");
return iter->second;
}
/* uint16_t get_variable_C(const string& name) const **************************/
uint16_t
GlobalVariablesArea::get_variable_C(const string& name) const {
map<string,uint16_t>::const_iterator iter = variables_c.find(name);
if(iter == variables_c.end())
throw string("variabile globale inesistente: " + name + " C");
return iter->second;
}
/* int32_t get_variable_I(const string& name) const ***************************/
int32_t
GlobalVariablesArea::get_variable_I(const string& name) const {
map<string,int32_t>::const_iterator iter = variables_i.find(name);
if(iter == variables_i.end())
throw string("variabile globale inesistente: " + name + " I");
return iter->second;
}
/* int64_t get_variable_J(const string& name) const ***************************/
int64_t
GlobalVariablesArea::get_variable_J(const string& name) const {
map<string,int64_t>::const_iterator iter = variables_j.find(name);
if(iter == variables_j.end())
throw string("variabile globale inesistente: " + name + " J");
return iter->second;
}
#endif // GLOBALVARIABLESAREA_CC_INCLUSION_GUARD