![]() |
mFrame
|
系統核心入口 更多...
#include <System.h>
靜態公開方法(Static Public Methods) | |
static ufm::io::PrintStream & | out (void) |
獲取系統輸出緩衝區 | |
static ufm::lang::Readable & | in (void) |
獲取系統輸入緩衝區 | |
static void | reboot (void) |
重新啟動系統 | |
static void | setup (ufm::sys::SystemProvider &provider) |
系統初始化 | |
static void | start (void) |
啟動系統核心 | |
static void | error (const void *address, ufm::sys::ErrorCode code) |
拋出系統錯誤 | |
static void | throwError (const char *message, const char *path, ufm::sys::ErrorCode code) |
拋出錯誤並中斷執行 | |
static uint32 | getCoreSpeed (void) |
取得處理器核心運行頻率 | |
static void | lowerDelay (uint32 times) |
低階延遲 | |
static bool | delay (int milliseconds) |
延遲指定毫秒數 | |
static void | wait (void) |
無條件等待 | |
static bool | wait (int timeout) |
等待指定超時時間 | |
static bool | yield (void) |
主動讓渡 CPU 使他人執行 | |
static int | lock (void) |
鎖定系統資源 | |
static int | unlock (void) |
解鎖系統資源 | |
static ufm::sys::Thread * | currentThread (void) |
取得當前執行緒指標 | |
static void | execute (ufm::func::Runnable &runnable) |
執行 Runnable 任務 | |
static ufm::sys::Allocator * | getAllocator (void) |
取得記憶體分配器 | |
static uint32 | microseconds (void) |
取得系統時間微秒數 | |
static uint64 | microseconds64 (void) |
取得系統時間微秒數 | |
static uint32 | seconds (void) |
取得系統時間秒數 | |
static ufm::util::Application & | getAppMgr (void) |
取得應用程式管理器 | |
靜態公開屬性 | |
static ufm::sys::Allocator * | vAllocator |
static ufm::sys::Kernel * | vKernel |
static ufm::sys::HardwareInfo * | vHardwareInfo |
保護方法(Protected Methods) | |
virtual | ~System (void) override=default |
Destroy the System object. | |
![]() | |
NonInstantiable (void)=delete | |
禁止實例化 NonInstantiable 類別 | |
NonInstantiable (const NonInstantiable &)=delete | |
禁止複製建構函式 | |
virtual | ~NonInstantiable (void) override=default |
Destroy the Non Instantiable object. | |
NonInstantiable & | operator= (const NonInstantiable &)=delete |
NonInstantiable & | operator= (NonInstantiable &&)=delete |
額外的繼承成員 | |
![]() | |
void * | operator new (size_t n) |
使用運算子 new 分配記憶體 | |
void * | operator new (size_t n, void *p) |
在指定記憶體上調用運算子 new | |
virtual ufm::lang::Object & | getObject (void) override |
取得對應的 Object 物件 | |
void | delay (int milliseconds) const |
延遲指定的毫秒數進行執行緒等待 | |
bool | equals (Object *object) const |
判斷與另一物件是否為相同參照(指標型態比較) | |
bool | equals (Object &object) const |
判斷與另一物件是否為相同參照(參照型態比較) | |
void | wait (void) const |
使當前線程等待直到被通知 | |
bool | wait (int timeout) const |
等待通知或超時 | |
bool | yield (void) const |
讓執行緒讓渡控制權給同優先權的下一個執行緒 | |
int | lock (void) const |
核心鎖定,鎖定期間禁止線程切換 | |
int | unlock (void) const |
核心解鎖 | |
ufm::sys::Thread * | currentThread (void) const |
取得當前執行緒指標 | |
virtual int | hashcode (void) const |
返回對象的哈希碼值。支持這種方法是為了散列表,如HashMap提供的那樣。 | |
![]() | |
virtual | ~Interface (void)=default |
虛擬析構函式 | |
系統核心入口
System 類別作為系統與硬體之間的抽象層,提供以下靜態功能:
確保應用程式能以一致、安全且高效的方式操作系統資源。
|
static |
取得當前執行緒指標
|
static |
延遲指定毫秒數
將當前執行緒休眠至少指定的毫秒時間。
milliseconds | 毫秒數 |
|
static |
拋出系統錯誤
記錄錯誤來源與代碼,並使用 system_error 輸出錯誤資訊。
address | 錯誤發生位置指標 |
code | 錯誤代碼 |
|
static |
執行 Runnable 任務
將 Runnable 任務傳遞給系統排程器執行。
runnable | 任務物件參考 |
|
inlinestatic |
取得記憶體分配器
|
inlinestatic |
取得應用程式管理器
獲取系統的應用程式管理器實例,用於管理和調度應用程式。 此方法提供對應用程式管理器的存取,便於進行應用程式的增刪改查等操作。
|
static |
取得處理器核心運行頻率
|
inlinestatic |
|
static |
鎖定系統資源
進入臨界區,防止中斷或多執行緒同時訪問。
|
static |
低階延遲
根據指定的 CPU 時脈周期進行微秒級延遲。
times | 延遲次數 (CPU 週期) |
|
inlinestatic |
取得系統時間微秒數
獲取系統自啟動以來的總運行時間,單位為微秒。 此方法通常用於計時和性能測量。
|
inlinestatic |
取得系統時間微秒數
獲取系統自啟動以來的總運行時間,單位為微秒。 此方法通常用於計時和性能測量。
|
inlinestatic |
|
static |
重新啟動系統
執行系統重啟流程,將所有資源釋放並重置硬體。
|
inlinestatic |
取得系統時間秒數
獲取系統自啟動以來的總運行時間,單位為秒。 此方法通常用於計時和性能測量。
|
static |
系統初始化
使用提供者設定系統參數並啟動底層服務。
provider | 系統設定與提供者介面 |
|
static |
啟動系統核心
呼叫 Kernel 的啟動流程,正式進入多任務運行階段。
|
static |
拋出錯誤並中斷執行
顯示錯誤訊息與路徑,並根據錯誤代碼做相應處理。
message | 錯誤描述 |
path | 發生位置 (檔案或函式名稱) |
code | 錯誤代碼 |
|
static |
解鎖系統資源
離開臨界區,允許其他執行緒或中斷訪問。
|
static |
等待指定超時時間
如果在超時前被喚醒返回 true,否則返回 false。
timeout | 超時時間 (毫秒) |
|
static |
無條件等待
將當前執行緒進入等待狀態,直到外部事件喚醒。
|
static |
主動讓渡 CPU 使他人執行