mFrame
載入中...
搜尋中...
無符合項目
ByteBufferInvert.h
1
8#ifndef MFRAME_5A999F7A_3DE3_494B_940A_A5BA5360324F
9#define MFRAME_5A999F7A_3DE3_494B_940A_A5BA5360324F
10
11/* ***************************************************************************************
12 * Include
13 */
14
15//----------------------------------------------------------------------------------------
16
17//----------------------------------------------------------------------------------------
18#include "./../io/ByteBuffer.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace ufm::io {
24 class ByteBufferInvert;
25} // namespace ufm::io
26
27/* ***************************************************************************************
28 * Class/Interface/Struct/Enum
29 */
30
41 /* *************************************************************************************
42 * Variable
43 */
44
45 /* *************************************************************************************
46 * Abstract Method
47 */
48
49 /* *************************************************************************************
50 * Construct Method
51 */
52 public:
59 : ByteBuffer(static_cast<ufm::lang::Memory&&>(memory)) {
60 return;
61 }
62
68 inline ByteBufferInvert(int length) : ByteBuffer(length) {
69 return;
70 }
71
78 inline ByteBufferInvert(void* pointer, int length) : ByteBuffer(pointer, length) {
79 return;
80 }
81
87 virtual ~ByteBufferInvert(void) override;
88
89 /* *************************************************************************************
90 * Operator Method
91 */
92
93 /* *************************************************************************************
94 * Override Method
95 */
96
97 /* *************************************************************************************
98 * Public Method
99 */
100 public:
108 inline bool pollShortMsb(uint16& result) {
109 return this->pollShortMsb(reinterpret_cast<short&>(result));
110 }
111
119 inline bool pollIntMsb(uint32& result) {
120 return this->pollIntMsb(reinterpret_cast<int&>(result));
121 }
122
130 bool putShortMsb(const short value);
131
139 bool putFloatMsb(const float value);
140
148 bool putIntMsb(const int value);
149
157 bool pollShortMsb(short& result);
158
166 bool pollIntMsb(int& result);
167
175 bool pollFloatMsb(float& result);
176
177 /* *************************************************************************************
178 * Protected Method
179 */
180
181 /* *************************************************************************************
182 * Private Method
183 */
184
185 /* *************************************************************************************
186 * Static Variable
187 */
188
189 /* *************************************************************************************
190 * Static Method
191 */
192};
193
194/* ***************************************************************************************
195 * End of file
196 */
197
198#endif /* MFRAME_5A999F7A_3DE3_494B_940A_A5BA5360324F */
靈活高效的位元組緩衝區實現
Definition ByteBuffer.h:45
ByteBuffer(ufm::lang::Memory memory) noexcept
使用現有記憶體建立位元組緩衝區
ufm::lang::Memory & memory(void)
獲取 ByteBuffer 的記憶體。
Definition ByteBuffer.h:472
提供大端序(MSB)操作的位元組緩衝區
Definition ByteBufferInvert.h:40
ByteBufferInvert(ufm::lang::Memory memory) noexcept
使用指定記憶體建立大端序位元組緩衝區
Definition ByteBufferInvert.h:58
ByteBufferInvert(int length)
建立指定大小的大端序位元組緩衝區
Definition ByteBufferInvert.h:68
bool putFloatMsb(const float value)
以大端序方式寫入浮點數
bool pollIntMsb(int &result)
以大端序方式讀取整數
bool pollIntMsb(uint32 &result)
以大端序方式讀取無符號整數
Definition ByteBufferInvert.h:119
bool pollFloatMsb(float &result)
以大端序方式讀取浮點數
bool putIntMsb(const int value)
以大端序方式寫入整數
ByteBufferInvert(void *pointer, int length)
使用指定指標和長度建立大端序位元組緩衝區
Definition ByteBufferInvert.h:78
virtual ~ByteBufferInvert(void) override
建立大端序位元組緩衝區,使用現有的記憶體物件
bool pollShortMsb(uint16 &result)
以大端序方式讀取無符號短整數
Definition ByteBufferInvert.h:108
bool pollShortMsb(short &result)
以大端序方式讀取短整數
bool putShortMsb(const short value)
以大端序方式寫入短整數
存儲資料的類別,提供動態記憶體管理功能。
Definition Memory.h:44
Definition Buffer.h:24