mFrame
載入中...
搜尋中...
無符合項目
mframe/src/ufm/io/InputBuffer.h
1
7#ifndef MFRAME_58654FF5_B5E0_425E_B939_1652199624DC
8#define MFRAME_58654FF5_B5E0_425E_B939_1652199624DC
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "./../io/InputStream.h"
16#include "./../io/RingBuffer.h"
17#include "./../lang/Object.h"
18#include "./../lang/Updatable.h"
19
20//----------------------------------------------------------------------------------------
21
22/* ***************************************************************************************
23 * Namespace
24 */
25namespace ufm::io {
26 class InputBuffer;
27} // namespace ufm::io
28
29/* ***************************************************************************************
30 * Class/Interface/Struct/Enum
31 */
32
43 /* *************************************************************************************
44 * Variable
45 */
46 private:
47 ufm::io::InputStream& vInputStream;
48 ufm::io::RingBuffer vRingBuffer;
49 bool vBusy;
50
51 /* *************************************************************************************
52 * Abstract Method
53 */
54
55 /* *************************************************************************************
56 * Construct Method
57 */
58 public:
64 InputBuffer(ufm::io::InputStream& inputStream, ufm::lang::Memory buffer) noexcept;
65
69 virtual ~InputBuffer(void) override;
70
71 /* *************************************************************************************
72 * Operator Method
73 */
74 public:
79 inline operator ufm::lang::Readable&(void) {
80 return this->vRingBuffer;
81 }
82
83 /* *************************************************************************************
84 * Override - ufm::io::CompletionHandler<int>
85 */
86 public:
93 virtual void completed(int& result, void* attachment) override;
94
100 virtual void failed(void* attachment) override;
101
102 /* *************************************************************************************
103 * Override - ufm::lang::Updatable
104 */
105 public:
110 virtual void update(void) override;
111
112 /* *************************************************************************************
113 * Public Method
114 */
115
116 /* *************************************************************************************
117 * Protected Method
118 */
119
120 /* *************************************************************************************
121 * Private Method
122 */
123
124 /* *************************************************************************************
125 * Static Variable
126 */
127
128 /* *************************************************************************************
129 * Static Method
130 */
131};
132
133/* ***************************************************************************************
134 * End of file
135 */
136
137#endif /* MFRAME_58654FF5_B5E0_425E_B939_1652199624DC */
輸入緩衝區
Definition mframe/src/ufm/io/InputBuffer.h:42
virtual void update(void) override
物件狀態定期更新 由系統定期呼叫,用於同步緩衝區資料與維護狀態。
InputBuffer(ufm::io::InputStream &inputStream, ufm::lang::Memory buffer) noexcept
建構 InputBuffer 物件
virtual ~InputBuffer(void) override
解構 InputBuffer 物件,釋放資源。
virtual void completed(int &result, void *attachment) override
非同步操作成功完成時呼叫 處理操作成功,可取得結果與原始附加物件。
virtual void failed(void *attachment) override
非同步操作失敗時呼叫 處理操作失敗,可進行錯誤恢復。
環形緩衝器實現,支援循環式讀寫操作
Definition RingBuffer.h:46
存儲資料的類別,提供動態記憶體管理功能。
Definition Memory.h:44
物件基底類別
Definition Object.h:63
InputBuffer
GPIO Pin Digital Input Buffer Configuration.
Definition mcxa153/src/mcxa153/chip/port/InputBuffer.h:70
Definition Buffer.h:24
[Interface] 非同步操作完成事件處理器模板介面
Definition CompletionHandler.h:42
[Interface] 定義了輸入流的基本操作
Definition InputStream.h:37
[Interface] 定義資料讀取介面
Definition Readable.h:46
[Interface] 定義可更新的物件介面
Definition Updatable.h:38