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/PrintStream.h"
20#include "./../lang/Object.h"
21#include "./../sys/Svcexec.h"
22#include "./../sys/SystemProvider.h"
23#include "./../util/Application.h"
24#include "./../util/TimerScheduler.h"
25
26/* ***************************************************************************************
27 * Namespace
28 */
29namespace ufm::sys {
30 class Svchost;
31} // namespace ufm::sys
32
33/* ***************************************************************************************
34 * Class/struct/Struct/Enum
35 */
51 /* *************************************************************************************
52 * Variable
53 */
54 public:
55 ufm::sys::SystemProvider& vProvider;
56 ufm::sys::Svcexec vSvcexec;
57 ufm::util::Application vApplicationManager;
58 ufm::util::TimerScheduler vTimerScheduler;
59
60 private:
61 int vDelay;
62 bool vStart;
63 bool vAction;
64
65 /* *************************************************************************************
66 * Abstract Method
67 */
68
69 /* *************************************************************************************
70 * Construct Method
71 */
72 private:
81
82 public:
88 virtual ~Svchost(void) override;
89
90 /* *************************************************************************************
91 * Operator Method
92 */
93
94 /* *************************************************************************************
95 * Override Method - ufm::func::Runnable
96 */
97 public:
98 virtual void run(void) override;
99
100 /* *************************************************************************************
101 * Public Method
102 */
103 public:
112 inline Svchost& setServiceDelay(int value) {
113 this->vDelay = value;
114 return *this;
115 }
116
122 inline int getServiceDelay(void) {
123 return this->vDelay;
124 }
125
131 void stop(void);
132
142 inline bool execute(ufm::func::Runnable& task) {
143 return this->vSvcexec.execute(task);
144 }
145
152 bool flush(void);
153
159 inline uint64 microseconds(void) const {
160 return this->vProvider.clock().microseconds();
161 }
162
168 inline uint32 seconds(void) const {
169 return this->vProvider.clock().seconds();
170 }
171
172 /* *************************************************************************************
173 * Protected Method
174 */
175
176 /* *************************************************************************************
177 * Private Method
178 */
179
180 /* *************************************************************************************
181 * Static Variable
182 */
183 private:
184 static Svchost* vInstance;
185
186 /* *************************************************************************************
187 * Static Method
188 */
189 public:
195 static inline Svchost& getInstance(void) {
196 return *Svchost::vInstance;
197 }
198
203 static void instantiation(SystemProvider& provider);
204};
205
206/* ***************************************************************************************
207 * End of file
208 */
209
210#endif /* MFRAME_90F75476_6982_4BDD_B9ED_0A250FE9C324 */
物件基底類別
Definition Object.h:63
Definition Svcexec.h:31
bool execute(ufm::func::Runnable &task)
在服務主機中執行使用者事件
Definition Svcexec.h:84
系統服務主機
Definition Svchost.h:50
bool flush(void)
Flushes this stream by writing any buffered output to the underlying stream.
Svchost & setServiceDelay(int value)
設定服務執行時間週期,預設10ms執行一次
Definition Svchost.h:112
virtual void run(void) override
執行方法
bool execute(ufm::func::Runnable &task)
在服務主機中執行使用者事件
Definition Svchost.h:142
void stop(void)
停止服務主機執行
virtual ~Svchost(void) override
釋放Svchost對象資源的解構子
int getServiceDelay(void)
獲取當前設定的服務延遲時間
Definition Svchost.h:122
static void instantiation(SystemProvider &provider)
類單例實例化。
static Svchost & getInstance(void)
取得CoreChip的實例
Definition Svchost.h:195
uint32 seconds(void) const
取得當前時間(微秒,64位)
Definition Svchost.h:168
uint64 microseconds(void) const
取得當前時間(微秒,64位)
Definition Svchost.h:159
應用程式管理器,管理應用程式實例的完整生命週期。
Definition Application.h:107
計時器任務排程器
Definition TimerScheduler.h:53
系統功能相關的命名空間
Definition Object.h:31
[Interface] 可執行函數式介面
Definition Runnable.h:40
virtual uint64 microseconds(void) const override
取得啟動至今的微秒數
virtual uint32 seconds(void) const override
取得啟動至今的秒數
系統資源提供者抽象介面
Definition SystemProvider.h:56
virtual ufm::lang::Clock & clock(void) override
取得系統時鐘