mFrame
載入中...
搜尋中...
無符合項目
Object.h
1
8#ifndef MFRAME_E0630DAA_6AA0_44AB_8E3D_C89ABCA310DE
9#define MFRAME_E0630DAA_6AA0_44AB_8E3D_C89ABCA310DE
10
11/* ***************************************************************************************
12 * Include
13 */
14
15//----------------------------------------------------------------------------------------
16
17//----------------------------------------------------------------------------------------
18#include "./../lang/Interface.h"
19
20/* ***************************************************************************************
21 * Namespace
22 */
23namespace mframe::lang {
24 class Object;
25} // namespace mframe::lang
26
27namespace mframe::sys {
28 class Thread;
29} // namespace mframe::sys
30
31/* ***************************************************************************************
32 * Class/struct/Struct
33 */
35 /* *************************************************************************************
36 * Variable
37 */
38
39 /* *************************************************************************************
40 * Abstract Method
41 */
42
43 /* *************************************************************************************
44 * Construct Method
45 */
46 public:
51 Object(void);
52
57 virtual ~Object(void) override;
58
59 /* *************************************************************************************
60 * Operator Method
61 */
62 public:
69 void* operator new(size_t n);
70
78 void* operator new(size_t n, void* p);
79
80 /* *************************************************************************************
81 * Public Method <Override> - mframe::lang::Interface
82 */
83 public:
85
86 /* *************************************************************************************
87 * Public Method
88 */
89 public:
99 void delay(int milliseconds) const;
100
130 bool equals(Object* object) const;
131
161 bool equals(Object& object) const;
162
208 inline void wait(void) const {
209 this->wait(0);
210 }
211
255 bool wait(int timeout) const;
256
273 bool yield(void) const;
274
280 int lock(void) const;
281
287 int unlock(void) const;
288
296
302 virtual int hashcode(void) const;
303
304 /* *************************************************************************************
305 * Public Method
306 */
307
308 /* *************************************************************************************
309 * Protected Method
310 */
311
312 /* *************************************************************************************
313 * Private Method
314 */
315
316 /* *************************************************************************************
317 * Private Method
318 */
319
320 /* *************************************************************************************
321 * Static Variable
322 */
323};
324
326/* ***************************************************************************************
327 * End of file
328 */
329
330#endif /* MFRAME_E0630DAA_6AA0_44AB_8E3D_C89ABCA310DE */
Definition Object.h:34
bool wait(int timeout) const
導致當前線程等待,直到另一個線程調用此對象的 notify()方法或 notifyAll()方法,或其他一些線 程中斷當前線程,或一定量的實時時間。
int unlock(void) const
核心解鎖。
int lock(void) const
核心鎖定,在調用unlock以前將不會進行執行緒切換
mframe::lang::Object & getObject(void) override
取得類Object
virtual ~Object(void) override
Destroy the Object object.
mframe::sys::Thread * currentThread(void) const
取得當前的執行緒
void delay(int milliseconds) const
函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1...
bool equals(Object *object) const
函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1...
bool yield(void) const
函數yield()將控制權傳遞給處於READY狀態且具有相同優先級的下一個線程。 如果在READY狀態下沒有其他優先級相同的線程,則當前線程繼續執行,不會發生線程切換。
bool equals(Object &object) const
函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1...
Object(void)
Construct a new Object object.
void wait(void) const
導致當前線程等待,直到另一個線程調用此對象的notify()方法或notifyAll()方法,或指定的時間 已過。
Definition Object.h:208
virtual int hashcode(void) const
返回對象的哈希碼值。支持這種方法是為了散列表,如HashMap提供的那樣。
Definition Thread.h:33
Definition Appendable.h:23
Definition Object.h:27
Definition Interface.h:134