mFrame
載入中...
搜尋中...
無符合項目
Byte.h
1
8#ifndef MFRAME_F9B57639_6FC2_4ABB_B8EB_618F2228B096
9#define MFRAME_F9B57639_6FC2_4ABB_B8EB_618F2228B096
10
11/* ***************************************************************************************
12 * Include
13 */
14
15//----------------------------------------------------------------------------------------
16
17//----------------------------------------------------------------------------------------
18#include "./../numb/Number.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace ufm::numb {
24 class Byte;
25} // namespace ufm::numb
26
27/* ***************************************************************************************
28 * Class Byte
29 */
41class ufm::numb::Byte final : public ufm::numb::Number {
42 /* *************************************************************************************
43 * Variable
44 */
45
46 /* *************************************************************************************
47 * Abstract Method
48 */
49
50 /* *************************************************************************************
51 * Construct Method
52 */
53 public:
59 Byte(void);
60
67 Byte(char value);
68
69 /* *************************************************************************************
70 * Operator Method
71 */
72 public:
78 inline operator char(void) {
79 return this->vValue.s8[0];
80 }
81
89 bool operator==(char v) {
90 return (this->vValue.s8[0] == static_cast<char>(v));
91 }
92
100 bool operator==(Byte& v) {
101 return (this->vValue.s8[0] == v.vValue.s8[0]);
102 }
103
110 char operator=(char v) {
111 this->vValue.s8[0] = v;
112 return this->vValue.s8[0];
113 }
114
122 this->vValue.s8[0] += v;
123 return *this;
124 }
125
133 this->vValue.s8[0] -= v;
134 return *this;
135 }
136
144 this->vValue.s8[0] *= v;
145 return *this;
146 }
147
155 this->vValue.s8[0] /= v;
156 return *this;
157 }
158
165 Byte tmp = *this;
166 ++this->vValue.s8[0];
167 return tmp;
168 }
169
176 ++this->vValue.s8[0];
177 return *this;
178 }
179
186 Byte tmp = *this;
187 --this->vValue.s8[0];
188 return tmp;
189 }
190
197 --this->vValue.s8[0];
198 return *this;
199 }
200
201 /* *************************************************************************************
202 * Override Method
203 */
204
205 /* *************************************************************************************
206 * Public Method
207 */
208
209 /* *************************************************************************************
210 * Protected Method
211 */
212
213 /* *************************************************************************************
214 * Private Method
215 */
216
217 /* *************************************************************************************
218 * Static Variable
219 */
220
221 /* *************************************************************************************
222 * Static Method
223 */
224};
225
226/* ***************************************************************************************
227 * End of file
228 */
229
230#endif /* MFRAME_F9B57639_6FC2_4ABB_B8EB_618F2228B096 */
位元組封裝類
Definition Byte.h:41
Byte(char value)
建構 Byte 物件
bool operator==(char v)
比較Byte物件與位元組是否相等
Definition Byte.h:89
Byte operator+=(int v)
加法指定運算子
Definition Byte.h:121
char operator=(char v)
指定運算子
Definition Byte.h:110
Byte operator++(int)
後置遞增運算子
Definition Byte.h:164
Byte operator++()
前置遞增運算子
Definition Byte.h:175
Byte operator*=(int v)
乘法指定運算子
Definition Byte.h:143
bool operator==(Byte &v)
比較兩個Byte物件是否相等
Definition Byte.h:100
Byte operator/=(int v)
除法指定運算子
Definition Byte.h:154
Byte(void)
建構 Byte 物件
Byte operator-=(int v)
減法指定運算子
Definition Byte.h:132
Byte & operator--(void)
前置遞減運算子
Definition Byte.h:196
Byte operator--(int)
後置遞減運算子
Definition Byte.h:185
[Interface] 數值基礎抽象類
Definition Number.h:44
Value vValue
數值儲存體
Definition Number.h:72
Definition Boolean.h:23
char s8[4]
有符號8位元陣列
Definition Number.h:57