mFrame
載入中...
搜尋中...
無符合項目
Short.h
1
8#ifndef MFRAME_A35B63D2_8288_4C2E_ACB8_69DAC9906340
9#define MFRAME_A35B63D2_8288_4C2E_ACB8_69DAC9906340
10
11/* ***************************************************************************************
12 * Include
13 */
14
15//----------------------------------------------------------------------------------------
16
17//----------------------------------------------------------------------------------------
18#include "./../numb/Number.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mframe::numb {
24 class Short;
25} // namespace mframe::numb
26
27/* ***************************************************************************************
28 * Class Short
29 */
31 /* *************************************************************************************
32 * Variable
33 */
34
35 /* *************************************************************************************
36 * Abstract Method
37 */
38
39 /* *************************************************************************************
40 * Construct Method
41 */
42 public:
47 Short(void);
48
54 Short(short value);
55
60 virtual ~Short(void) override;
61
62 /* *************************************************************************************
63 * Operator Method
64 */
65 public:
70 inline operator short(void) {
71 return Short::vValue.s16[0];
72 }
73
81 inline bool operator==(int v) {
82 return (Short::vValue.s16[0] == (v & 0x0000FFFF));
83 }
84
92 inline bool operator==(Short& v) {
93 return (Short::vValue.s16[0] == v.vValue.s16[0]);
94 }
95
103 Short::vValue.s16[0] = v.vValue.s16[0];
104 return Short::vValue.s16[0];
105 }
106
114 Short::vValue.s16[0] += v;
115 return *this;
116 }
117
125 Short::vValue.s16[0] -= v;
126 return *this;
127 }
128
136 Short::vValue.s16[0] *= v;
137 return *this;
138 }
139
147 Short::vValue.s16[0] /= v;
148 return *this;
149 }
150
157 Short tmp = *this;
158 ++Short::vValue.s16[0];
159 return tmp;
160 }
161
168 ++Short::vValue.s16[0];
169 return *this;
170 }
171
178 Short tmp = *this;
179 --Short::vValue.s16[0];
180 return tmp;
181 }
182
189 --Short::vValue.s16[0];
190 return *this;
191 }
192
193 /* *************************************************************************************
194 * Public Method <Override>
195 */
196
197 /* *************************************************************************************
198 * Public Method
199 */
200
201 /* *************************************************************************************
202 * Protected Method
203 */
204
205 /* *************************************************************************************
206 * Private Method
207 */
208
209 /* *************************************************************************************
210 * Static Variable
211 */
212
213 /* *************************************************************************************
214 * Static Method
215 */
216};
217
218/* ***************************************************************************************
219 * End of file
220 */
221
222#endif /* MFRAME_A35B63D2_8288_4C2E_ACB8_69DAC9906340 */
Definition Number.h:30
Definition Short.h:30
Short operator++(int)
Definition Short.h:156
virtual ~Short(void) override
Destroy the Short object.
Short & operator--(void)
Definition Short.h:188
Short operator-=(int v)
Definition Short.h:124
Short operator*=(int v)
Definition Short.h:135
Short operator+=(int v)
Definition Short.h:113
bool operator==(Short &v)
Definition Short.h:92
Short(short value)
Construct a new Short object.
bool operator==(int v)
Definition Short.h:81
Short operator/=(int v)
Definition Short.h:146
Short(void)
Construct a new Short object.
Short operator--(int)
Definition Short.h:177
Short operator=(Short v)
Definition Short.h:102
Short operator++(void)
Definition Short.h:167
Definition Boolean.h:23