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
82 /* *************************************************************************************
83 * Override - ufm::io::CompletionHandler<int>
84 */
85 public:
92 virtual void completed(int& result, void* attachment) override;
93
99 virtual void failed(void* attachment) override;
100
101 /* *************************************************************************************
102 * Override - ufm::lang::Updatable
103 */
104 public:
109 virtual void update(void) override;
110
111 /* *************************************************************************************
112 * Public Method
113 */
114
115 /* *************************************************************************************
116 * Protected Method
117 */
118
119 /* *************************************************************************************
120 * Private Method
121 */
122
123 /* *************************************************************************************
124 * Static Variable
125 */
126
127 /* *************************************************************************************
128 * Static Method
129 */
130};
131
132/* ***************************************************************************************
133 * End of file
134 */
135
136#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:44
物件基底類別
Definition Object.h:63
Definition Buffer.h:24
[Interface] 非同步操作完成事件處理器模板介面
Definition CompletionHandler.h:42
[Interface] 提供輸出串流的基本操作方法
Definition OutputStream.h:37
資料附加介面 (Appendable)
Definition Appendable.h:43
[Interface] 定義可更新的物件介面
Definition Updatable.h:38