-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum.cpp
65 lines (53 loc) · 1.8 KB
/
enum.cpp
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
#include <enum.h>
namespace valueTypes {
namespace myBase {
const int none = 0;
const int boolean = 1;
const int character = 2;
const int integer = 3;
const int real = 4;
const int charStr = 5;
const int boolVect = 6;
const int charVect = 7;
const int intVect = 8;
const int realVect = 9;
const int stringVect = 10;
valueMap::ValueDescPair v_mapInit[] = {
valueMap::ValueDescPair(none, ""),
valueMap::ValueDescPair(boolean, "bool"),
valueMap::ValueDescPair(character, "char"),
valueMap::ValueDescPair(integer, "int"),
valueMap::ValueDescPair(real, "real"),
valueMap::ValueDescPair(charStr, "string"),
valueMap::ValueDescPair(boolVect, "bool[]"),
valueMap::ValueDescPair(charVect, "char[]"),
valueMap::ValueDescPair(intVect, "int[]"),
valueMap::ValueDescPair(realVect, "real[]"),
valueMap::ValueDescPair(stringVect, "string[]")
};
valueMap::ValueDescPair *v_mapInitEnd(v_mapInit+
sizeof(v_mapInit)/sizeof(v_mapInit[0]));
}
valueMap::valueMap(const Iter first, const Iter last)
{
std::cout << "valueMap constructor(first,last) with" << std::endl;
Iter i = first;
do {
std::cout << i->first << " " << i->second << std::endl;
++i;
} while (i != last);
std::cout << "insert in values with" << std::endl;
printValueMap();
values.insert(first, last);
std::cout << "inserted" << std::endl;
}
void valueMap::printValueMap()
{
ValuesDescList::const_iterator i=values.begin();
do {
std::cout << i->first << " " << i->second << std::endl;
++i;
} while (i != values.end());
}
}
valueTypes::valueMap::ValuesDescList valueTypes::valueMap::values(myBase::v_mapInit, myBase::v_mapInitEnd);