-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCreateSetterMethod.h
More file actions
168 lines (132 loc) · 3.12 KB
/
CreateSetterMethod.h
File metadata and controls
168 lines (132 loc) · 3.12 KB
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
#pragma once
#include <string>
#include <vector>
namespace CreateSetterMethodNamespace
{
template <typename T>
class CreateSetterMethodTemplate
{
public:
CreateSetterMethodTemplate() : _t(0)
{
}
// #TEST#: CSM1 Create setter method
T _t;
// #TEST#: CSM2 Create setter method
static T _st;
void Operation()
{
_t = T(0);
}
static void StaticOperation()
{
_st = T(0);
}
};
class CreateSetterMethod
{
public:
CreateSetterMethod(const std::string &s1)
: _a(0),
_b(0),
_t(0),
_s1(s1),
_s2()
{
}
// #TEST#: CSM3 Create setter method
int _a;
// #TEST#: CSM4 Create setter method
int _b;
// #TEST#: CSM5 Create setter method
const char *_t;
// #TEST#: CSM6 Create setter method (should not be available)
const std::string &_s1;
// #TEST#: CSM7 Create setter method
std::string _s2;
// #TEST#: CSM8 Create setter method
static int _sa;
// #TEST#: CSM9 Create setter method
static const char *_sb;
// #TEST#: CSM10 Create setter method (should not be available)
static const std::string &_ss1;
// #TEST#: CSM11 Create setter method
static std::string &_ss2;
// #TEST#: CSM12 Create setter method
static std::string _ss3;
void OperationInline()
{
_a = 1;
_b = -1;
_t = "This is a yotz";
static std::string foo = "foo";
_s2 = foo;
_sa = -2;
_sb = _t;
_ss2 = foo;
_ss3 = foo;
}
void Operation();
static void StaticOperationInline()
{
_sa = -2;
_sb = "This is a test";
static std::string foo = _sb;
_ss2 = foo;
_ss3 = foo;
}
static void StaticOperation();
};
struct CreateSetterMethodStruct
{
// #TEST#: CSM13 Create setter method
int _i;
// #TEST#: CSM14 Create setter method
const char *_s;
// #TEST#: CSM15 Create setter method
std::string _str;
// #TEST#: CSM16 Create setter method
static int _si;
// #TEST#: CSM17 Create setter method
static const char *_ss;
// #TEST#: CSM18 Create setter method
static std::string _sstr;
};
template <typename T>
struct CreateSetterMethodTemplateStruct
{
// #TEST#: CSM19 Create setter method
T _t;
// #TEST#: CSM20 Create setter method
T *_tp;
// #TEST#: CSM21 Create setter method
std::vector<T> _tv;
// #TEST#: CSM22 Create setter method
static T _st;
// #TEST#: CSM23 Create setter method
static T *_stp;
};
union CreateSetterMethodUnion
{
// #TEST#: CSM24 Create setter method
int _i;
// #TEST#: CSM25 Create setter method
const char *_s;
};
struct CreateSetterMethodStructAnonymous
{
// #TEST#: CSM26 Create setter method
int _type;
union
{
// #TEST#: CSM27 Create setter method
int _i;
// #TEST#: CSM28 Create setter method
float _f;
// #TEST#: CSM29 Create setter method
double _d;
// #TEST#: CSM30 Create setter method
const char *_s;
};
};
} // namespace CreateSetterMethodNamespace