![]() |
mFrame
|
整數封裝類 更多...
#include <Integer.h>
公開方法(Public Methods) | |
| Integer (void) | |
| 建構 Integer 物件 | |
| Integer (int value) | |
| 建構 Integer 物件 | |
| operator int (void) | |
| 轉型為整數 | |
| bool | operator== (int v) |
| 比較Integer物件與整數是否相等 | |
| bool | operator== (Integer &v) |
| 比較兩個Integer物件是否相等 | |
| int | operator= (int v) |
| 指定運算子 | |
| Integer | operator+= (int v) |
| 加法指定運算子 | |
| Integer | operator-= (int v) |
| 減法指定運算子 | |
| Integer | operator*= (int v) |
| 乘法指定運算子 | |
| Integer | operator/= (int v) |
| 除法指定運算子 | |
| Integer | operator++ (int) |
| 後置遞增運算子 | |
| Integer | operator++ () |
| 前置遞增運算子 | |
| Integer | operator-- (int) |
| 後置遞減運算子 | |
| Integer & | operator-- (void) |
| 前置遞減運算子 | |
公開方法(Public Methods) 繼承自 ufm::numb::Number | |
| Number (void) | |
| 建構 Number 物件 | |
| operator bool & (void) | |
| 轉型為 bool 引用 | |
| operator const bool & (void) const | |
| 轉型為 const bool 引用 | |
| operator int & (void) | |
| 轉型為 int 引用 | |
| operator const int & (void) const | |
| 轉型為 const int 引用 | |
| operator uint32 & (void) | |
| 轉型為 uint32 引用 | |
| operator const uint32 & (void) const | |
| 轉型為 const uint32 引用 | |
| operator float & (void) | |
| 轉型為 float 引用 | |
| operator const float & (void) const | |
| 轉型為 const float 引用 | |
| operator double & (void) | |
| 轉型為 double 引用 | |
| operator const double & (void) const | |
| 轉型為 const double 引用 | |
| bool | operator== (Number &v) |
| 比較兩個 Number 物件是否相等 | |
| virtual int | hashcode (void) const override |
| 返回對象的哈希碼值 | |
公開方法(Public Methods) 繼承自 ufm::lang::Object | |
| 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 |
| 取得當前執行緒指標 | |
公開方法(Public Methods) 繼承自 ufm::lang::Interface | |
| virtual | ~Interface (void)=default |
| 虛擬析構函式 | |
靜態公開屬性 | |
| static constexpr const int | MAX_VALUE = 2147483647L |
| 整數最大值常量 | |
| static constexpr const int | MIN_VALUE = (-0x7fffffff - 1) |
| 整數最小值常量 | |
| static constexpr const int | SIZE = sizeof(int) |
| 整數大小(位元組) | |
額外的繼承成員 | |
保護屬性 繼承自 ufm::numb::Number | |
| Value | vValue |
| 數值儲存體 | |
整數封裝類
此類封裝int原始類型,提供物件導向方式操作整數。 繼承自Number基礎類,實現了各種運算子重載,使得整數可以像物件一樣使用。 主要功能包括:
|
inline |
轉型為整數
|
inline |
指定運算子
| v | 整數來源值 |
|
inline |
比較Integer物件與整數是否相等
| v | 要比較的整數值 |
|
inline |
比較兩個Integer物件是否相等
| v | 要比較的Integer物件 |