mFrame
載入中...
搜尋中...
無符合項目
OutputBuffer.h
1
7#ifndef MFRAME_38F303FF_0536_4ED7_855E_A0D6319049B2
8#define MFRAME_38F303FF_0536_4ED7_855E_A0D6319049B2
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15#include "./../io/OutputStream.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 OutputBuffer;
27} // namespace ufm::io
28
29/* ***************************************************************************************
30 * Class/Interface/Struct/Enum
31 */
32
42 /* *************************************************************************************
43 * Variable
44 */
45 private:
46 ufm::io::OutputStream& vOutputStream;
47 ufm::io::RingBuffer vRingBuffer;
48 bool vBusy;
49
50 /* *************************************************************************************
51 * Abstract Method
52 */
53
54 /* *************************************************************************************
55 * Construct Method
56 */
57 public:
63 OutputBuffer(ufm::io::OutputStream& outputStream, ufm::lang::Memory buffer) noexcept;
64
68 virtual ~OutputBuffer(void) override;
69
70 /* *************************************************************************************
71 * Operator Method
72 */
73 public:
78 inline operator ufm::lang::Appendable&(void) {
79 return this->vRingBuffer;
80 }
81
86 inline operator ufm::lang::Readable&(void) {
87 return this->vRingBuffer;
88 }
89
90 /* *************************************************************************************
91 * Override - ufm::io::CompletionHandler<int>
92 */
93 public:
100 virtual void completed(int& result, void* attachment) override;
101
107 virtual void failed(void* attachment) override;
108
109 /* *************************************************************************************
110 * Override - ufm::lang::Updatable
111 */
112 public:
117 virtual void update(void) override;
118
119 /* *************************************************************************************
120 * Public Method
121 */
122
123 /* *************************************************************************************
124 * Protected Method
125 */
126
127 /* *************************************************************************************
128 * Private Method
129 */
130
131 /* *************************************************************************************
132 * Static Variable
133 */
134
135 /* *************************************************************************************
136 * Static Method
137 */
138};
139
140/* ***************************************************************************************
141 * End of file
142 */
143
144#endif /* MFRAME_38F303FF_0536_4ED7_855E_A0D6319049B2 */
輸出緩衝區
Definition OutputBuffer.h:41
virtual void failed(void *attachment) override
非同步操作失敗時呼叫 處理操作失敗,可進行錯誤恢復。
OutputBuffer(ufm::io::OutputStream &outputStream, ufm::lang::Memory buffer) noexcept
建構 OutputBuffer 物件
virtual void completed(int &result, void *attachment) override
非同步操作成功完成時呼叫 處理操作成功,可取得結果與原始附加物件。
virtual void update(void) override
物件狀態更新 由系統定期呼叫,負責緩衝區資料同步與狀態維護。
virtual ~OutputBuffer(void) override
解構 OutputBuffer 物件,釋放資源。
環形緩衝器實現,支援循環式讀寫操作
Definition RingBuffer.h:46
動態記憶體管理類別
Definition Memory.h:38
物件基底類別
Definition Object.h:63
輸入/輸出操作命名空間
Definition Buffer.h:24
[Interface] 非同步操作完成事件處理器模板介面
Definition CompletionHandler.h:42
[Interface] 提供輸出串流的基本操作方法
Definition OutputStream.h:37
資料附加介面 (Appendable)
Definition Appendable.h:46
[Interface] 定義資料讀取介面
Definition Readable.h:46
[Interface] 定義可更新的物件介面
Definition Updatable.h:38