![]() |
mFrame
|
位元組靜態工具類 更多...
#include <Bytes.h>
靜態公開方法(Static Public Methods) | |
static uint8 | castUnsigned (char value) |
轉換有符號 char 為無符號 uint8 | |
static char | castSigned (uint8 value) |
轉換無符號 uint8 為有符號 char | |
static char | valueOf (const char *str) |
解析字串為 char (byte) 值 | |
保護方法(Protected Methods) | |
virtual | ~Bytes (void) override=default |
Destroy the Bytes 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 |
虛擬析構函式 | |
位元組靜態工具類
此類提供了位元組(char/uint8)類型的靜態工具方法,用於型別轉換和字串解析。 作為工具類,Bytes類不能被實例化,所有方法均為靜態方法。 主要功能包括:
|
inlinestatic |
轉換無符號 uint8 為有符號 char
將 uint8 的位元表示直接轉型為 signed char。
value | 無符號 uint8 |
|
inlinestatic |
轉換有符號 char 為無符號 uint8
將 signed char 的位元表示直接轉型為 uint8。
value | 有符號 char |
|
static |
解析字串為 char (byte) 值
解析十進制、十六進制(0x 前綴)或八進制(0 前綴)字串為數值。
str | 字串來源 (非 nullptr) |
std::invalid_argument | 字串格式不合法 |
std::out_of_range | 值超出 char 範圍 |