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
69 inline ByteBufferInvert(void* pointer, int length) : ByteBuffer(pointer, length) {
70 return;
71 }
72
78 virtual ~ByteBufferInvert(void) override;
79
80 /* *************************************************************************************
81 * Operator Method
82 */
83
84 /* *************************************************************************************
85 * Override Method
86 */
87
88 /* *************************************************************************************
89 * Public Method
90 */
91 public:
99 inline bool pollShortMsb(uint16& result) {
100 return this->pollShortMsb(reinterpret_cast<short&>(result));
101 }
102
110 inline bool pollIntMsb(uint32& result) {
111 return this->pollIntMsb(reinterpret_cast<int&>(result));
112 }
113
121 bool putShortMsb(const short value);
122
130 bool putFloatMsb(const float value);
131
139 bool putIntMsb(const int value);
140
148 bool pollShortMsb(short& result);
149
157 bool pollIntMsb(int& result);
158
166 bool pollFloatMsb(float& result);
167
168 /* *************************************************************************************
169 * Protected Method
170 */
171
172 /* *************************************************************************************
173 * Private Method
174 */
175
176 /* *************************************************************************************
177 * Static Variable
178 */
179
180 /* *************************************************************************************
181 * Static Method
182 */
183};
184
185/* ***************************************************************************************
186 * End of file
187 */
188
189#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:463
提供大端序(MSB)操作的位元組緩衝區
Definition ByteBufferInvert.h:40
ByteBufferInvert(ufm::lang::Memory memory) noexcept
使用指定記憶體建立大端序位元組緩衝區
Definition ByteBufferInvert.h:58
bool putFloatMsb(const float value)
以大端序方式寫入浮點數
bool pollIntMsb(int &result)
以大端序方式讀取整數
bool pollIntMsb(uint32 &result)
以大端序方式讀取無符號整數
Definition ByteBufferInvert.h:110
bool pollFloatMsb(float &result)
以大端序方式讀取浮點數
bool putIntMsb(const int value)
以大端序方式寫入整數
ByteBufferInvert(void *pointer, int length)
使用指定指標和長度建立大端序位元組緩衝區
Definition ByteBufferInvert.h:69
virtual ~ByteBufferInvert(void) override
建立大端序位元組緩衝區,使用現有的記憶體物件
bool pollShortMsb(uint16 &result)
以大端序方式讀取無符號短整數
Definition ByteBufferInvert.h:99
bool pollShortMsb(short &result)
以大端序方式讀取短整數
bool putShortMsb(const short value)
以大端序方式寫入短整數
動態記憶體管理類別
Definition Memory.h:38
Definition Buffer.h:24