mFrame
載入中...
搜尋中...
無符合項目
mframe::lang::Pointers 類別 參考文件
類別mframe::lang::Pointers的繼承圖:
mframe::lang::Object mframe::lang::Interface

公開方法(Public Methods)

virtual ~Pointers (void) override
 Destroy the Pointers object.
 
- 公開方法(Public Methods) 繼承自 mframe::lang::Object
 Object (void)
 Construct a new Object object.
 
virtual ~Object (void) override
 Destroy the Object object.
 
void * operator new (size_t n)
 
void * operator new (size_t n, void *p)
 
mframe::lang::ObjectgetObject (void) override
 取得類Object
 
void delay (int milliseconds) const
 函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1),線程會立即重新安排。
 
bool equals (Object *object) const
 函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1),線程會立即重新安排。
 
bool equals (Object &object) const
 函數 delay 等待內核滴答中指定的時間段。 對於1的值,系統等待直到下一個計時器滴答發生。 實際時間延遲最多可能比指定時間少一個計時器滴答聲,即在下一個系統滴答聲發生之前立即調用 osDelay(1),線程會立即重新安排。
 
void wait (void) const
 導致當前線程等待,直到另一個線程調用此對象的notify()方法或notifyAll()方法,或指定的時間 已過。
 
bool wait (int timeout) const
 導致當前線程等待,直到另一個線程調用此對象的 notify()方法或 notifyAll()方法,或其他一些線 程中斷當前線程,或一定量的實時時間。
 
bool yield (void) const
 函數yield()將控制權傳遞給處於READY狀態且具有相同優先級的下一個線程。 如果在READY狀態下沒有其他優先級相同的線程,則當前線程繼續執行,不會發生線程切換。
 
int lock (void) const
 核心鎖定,在調用unlock以前將不會進行執行緒切換
 
int unlock (void) const
 核心解鎖。
 
mframe::sys::ThreadcurrentThread (void) const
 取得當前的執行緒
 
virtual int hashcode (void) const
 返回對象的哈希碼值。支持這種方法是為了散列表,如HashMap提供的那樣。
 
- 公開方法(Public Methods) 繼承自 mframe::lang::Interface
virtual ~Interface (void)=default
 Destroy the struct object.
 

靜態公開方法(Static Public Methods)

static void *const & getReferenceNullPointer (void)
 Get the Reference Null Pointer object.
 
static uint32 toUnsignedInt (const void *pointer)
 轉換為無符號整數
 
static uint32 toSignedInt (const void *pointer)
 轉換為整數
 
template<class T >
static T * shift (T *pointer, int shift)
 地址偏移
 
template<class T >
static const T * shift (const T *pointer, int shift)
 常數地址偏移
 
template<class T >
static T * cast (void *src)
 
template<class T >
static T * cast (uint32 address)
 
static void copy (void *destination, const void *source, int length)
 Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
 
static void move (void *destination, const void *source, int length)
 將來源位置的資料複製指定的字節數(num bytes)到目標記憶體區塊中。 複製過程如同使用中間緩衝區進行,因此允許目標與來源記憶體區塊重疊。
 
static int compare (const void *src1, const void *src2, int length)
 前n個字節的內存區域src1和存儲區src2中比較。
 
static void wipe (void *src, int value, int length)
 複製字符 c(一個無符號字符)到參數 str 所指向的字符串的前 n 個字符。
 
static void wipe (void *src, int length)
 複製字符0x00到參數str所指向的字符串的前length個字符。
 
static int getStringLength (const char *src)
 

函式成員說明文件

◆ cast() [1/2]

template<class T >
static T * mframe::lang::Pointers::cast ( uint32 address)
inlinestatic
樣版參數
T
參數
address
t
傳回值
T*

◆ cast() [2/2]

template<class T >
static T * mframe::lang::Pointers::cast ( void * src)
inlinestatic
樣版參數
T
參數
src
t
傳回值
T*

◆ compare()

static int mframe::lang::Pointers::compare ( const void * src1,
const void * src2,
int length )
static

前n個字節的內存區域src1和存儲區src2中比較。

參數
src1來源1
src2來源2
length比較字節數
傳回值
int
  • 如果返回值<0,則表明src1小於src2
  • 如果返回值,如果> 0,則表明src2小於src1
  • 如果返回值= 0,則表明src1等於src2

◆ copy()

static void mframe::lang::Pointers::copy ( void * destination,
const void * source,
int length )
static

Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.

he underlying type of the objects pointed to by both the source and destination pointers are irrelevant for this function; The result is a binary copy of the data.

The function does not check for any terminating null character in source-it always copies exactly num bytes.

To avoid overflows, the size of the arrays pointed to by both the destination and source parameters, shall be at least num bytes, and should not overlap(for overlapping memory blocks, move is a safer approach).

參數
destinationPointer to the destination array where the content is to be copied, type-casted to a pointer of type void*.
sourcePointer to the source of data to be copied, type-casted to a pointer of type const void*.
lengthNumber of bytes to copy.

◆ getReferenceNullPointer()

static void *const & mframe::lang::Pointers::getReferenceNullPointer ( void )
static

Get the Reference Null Pointer object.

傳回值
void* const&

◆ getStringLength()

static int mframe::lang::Pointers::getStringLength ( const char * src)
static
參數
src
傳回值
int

◆ move()

static void mframe::lang::Pointers::move ( void * destination,
const void * source,
int length )
static

將來源位置的資料複製指定的字節數(num bytes)到目標記憶體區塊中。 複製過程如同使用中間緩衝區進行,因此允許目標與來源記憶體區塊重疊。

此函式不關心來源與目標指針所指物件的基礎型別;其結果為資料的二進位複製。

函式不會檢查來源中的任何終止字元(如 null 字元),而是總是精確地複製 num 字節。

為避免緩衝區溢出,目標與來源參數所指的陣列大小應至少為 num 字節。

參數
destination指向目標陣列的指針,複製內容將被存放於此,類型為 void*。
source指向資料來源的指針,類型為 const void*。
length欲複製的字節數。

◆ shift() [1/2]

template<class T >
static const T * mframe::lang::Pointers::shift ( const T * pointer,
int shift )
inlinestatic

常數地址偏移

樣版參數
T類別
參數
pointer常數地址來源
shift偏移
傳回值
const T* 常數地址

◆ shift() [2/2]

template<class T >
static T * mframe::lang::Pointers::shift ( T * pointer,
int shift )
inlinestatic

地址偏移

參數
point地址來源
shift偏移
傳回值
void* 地址

◆ toSignedInt()

static uint32 mframe::lang::Pointers::toSignedInt ( const void * pointer)
inlinestatic

轉換為整數

參數
pointer地址
傳回值
uint32 整數

◆ toUnsignedInt()

static uint32 mframe::lang::Pointers::toUnsignedInt ( const void * pointer)
inlinestatic

轉換為無符號整數

參數
pointer地址
傳回值
uint32 無符號整數

◆ wipe() [1/2]

static void mframe::lang::Pointers::wipe ( void * src,
int length )
static

複製字符0x00到參數str所指向的字符串的前length個字符。

參數
src指向要填充的內存塊。
length要被設置為該值的字符數。

◆ wipe() [2/2]

static void mframe::lang::Pointers::wipe ( void * src,
int value,
int length )
static

複製字符 c(一個無符號字符)到參數 str 所指向的字符串的前 n 個字符。

參數
src指向要填充的內存塊。
value要被設置的值。該值以 int 形式傳遞,但是函數在填充內存塊時是使用該值的無符號字符形式。
length要被設置為該值的字符數。

此類別(class) 文件是由下列檔案中產生: