mFrame
載入中...
搜尋中...
無符合項目
Svchost.h
1
7#ifndef MFRAME_90F75476_6982_4BDD_B9ED_0A250FE9C324
8#define MFRAME_90F75476_6982_4BDD_B9ED_0A250FE9C324
9
10/* ***************************************************************************************
11 * Include
12 */
13
14//----------------------------------------------------------------------------------------
15
16//----------------------------------------------------------------------------------------
17#include "./../func/Runnable.h"
18#include "./../io/InputStream.h"
19#include "./../io/PrintBuffer.h"
20#include "./../io/RingBuffer.h"
21#include "./../lang/Data.h"
22#include "./../lang/Object.h"
23#include "./../sys/Allocator.h"
24#include "./../sys/Kernel.h"
25#include "./../sys/SystemConfig.h"
26#include "./../sys/SystemControl.h"
27#include "./../sys/Thread.h"
28#include "./../util/PArrayQueue.h"
29
30/* ***************************************************************************************
31 * Namespace
32 */
33namespace mframe::sys {
34 class Svchost;
35}
36
37/* ***************************************************************************************
38 * Class/struct/Struct/Enum
39 */
44 /* *************************************************************************************
45 * Variable
46 */
47 public:
48 mframe::io::OutputStream& mOutputStream;
49 mframe::io::InputStream& mInputStream;
50 mframe::io::PrintBuffer mPrintBuffer;
51 mframe::io::RingBuffer mRingBuffer;
52
53 private:
54 mframe::util::PArrayQueue mArrayQueue;
55 mframe::sys::Thread* mThread;
56 mframe::sys::Thread* mUserThread;
57 mframe::lang::Readable* mCustomReadBuffer;
58 mframe::lang::Appendable* mCustomWriteBuffer;
59 int mDelay;
60 bool mStart;
61 bool mAction;
62 bool mStream;
63
64 /* *************************************************************************************
65 * Abstract Method
66 */
67
68 /* *************************************************************************************
69 * Construct Method
70 */
71 public:
78
82 virtual ~Svchost(void) override;
83
84 /* *************************************************************************************
85 * Operator Method
86 */
87
88 /* *************************************************************************************
89 * Public Method <Override> - mframe::func::Runnable
90 */
91 public:
92 virtual void run(void) override;
93
94 /* *************************************************************************************
95 * Public Method <Override> - mframe::lang::CompletionHandler<int, void*>
96 */
97 public:
98 virtual void completed(int& result, void* attachment) override;
99
100 virtual void failed(void* attachment) override;
101
102 /* *************************************************************************************
103 * Public Method <Override> - mframe::sys::SystemControl
104 */
105 public:
106 virtual void setCustomReadBuffer(mframe::lang::Readable* readable) override;
107
108 virtual void setCustomWriteBuffer(mframe::lang::Appendable* appendable) override;
109
110 /* *************************************************************************************
111 * Public Method
112 */
113 public:
120 inline Svchost& setServiceDelay(int value) {
121 this->mDelay = value;
122 return *this;
123 }
124
130 inline int getServiceDelay(void) {
131 return this->mDelay;
132 }
133
142 bool start(mframe::func::Runnable& task, int stackSize);
143
148 void stop(void);
149
158
165 bool action(void);
166
167 /* *************************************************************************************
168 * Protected Method
169 */
170
171 /* *************************************************************************************
172 * Private Method
173 */
174 private:
175 bool checkOutputStream(void);
176 bool checkInputStream(void);
177
178 /* *************************************************************************************
179 * Static Variable
180 */
181
182 /* *************************************************************************************
183 * Static Method
184 */
185};
186
187/* ***************************************************************************************
188 * End of file
189 */
190
191#endif /* MFRAME_90F75476_6982_4BDD_B9ED_0A250FE9C324 */
Definition PrintBuffer.h:32
Definition RingBuffer.h:38
Definition Object.h:34
Definition Svchost.h:43
Svchost & setServiceDelay(int value)
Set the Service Delay object.
Definition Svchost.h:120
void stop(void)
停止執行svchost
int getServiceDelay(void)
Get the Service Delay object.
Definition Svchost.h:130
bool start(mframe::func::Runnable &task, int stackSize)
Svchost(mframe::sys::SystemConfig &systemConfig)
Construct a new Svchost object.
virtual void failed(void *attachment) override
Invoked when an operation fails.
bool execute(mframe::func::Runnable &task)
執行使用者事件
virtual void completed(int &result, void *attachment) override
Invoked when an operation has completed.
virtual void setCustomReadBuffer(mframe::lang::Readable *readable) override
設定自訂讀取緩衝區,接管系統接收緩衝區。
virtual void run(void) override
執行方法。
virtual void setCustomWriteBuffer(mframe::lang::Appendable *appendable) override
設定自訂寫入緩衝區,接管系統寫入緩衝區。
Definition Thread.h:33
Definition PArrayQueue.h:33
Definition Object.h:27
Definition Runnable.h:29
Definition CompletionHandler.h:32
Definition InputStream.h:31
Definition OutputStream.h:31
可附加的 <Interface>
Definition Appendable.h:36
Definition Readable.h:31
Definition SystemConfig.h:34
Definition SystemControl.h:31