System.TMethod
Delphi
TMethod = record
Code, Data: Pointer;
public
class operator Equal(const Left, Right: TMethod): Boolean; inline;
class operator NotEqual(const Left, Right: TMethod): Boolean; inline;
class operator GreaterThan(const Left, Right: TMethod): Boolean; inline;
class operator GreaterThanOrEqual(const Left, Right: TMethod): Boolean; inline;
class operator LessThan(const Left, Right: TMethod): Boolean; inline;
class operator LessThanOrEqual(const Left, Right: TMethod): Boolean; inline;
end;
C++
struct DECLSPEC_DRECORD TMethod
{
public:
void *Code;
void *Data;
static bool __fastcall _op_Equality(const TMethod &Left, const TMethod &Right);
bool __fastcall operator==(const TMethod& __rhs) { return TMethod::_op_Equality(*this, __rhs); };
static bool __fastcall _op_Inequality(const TMethod &Left, const TMethod &Right);
bool __fastcall operator!=(const TMethod& __rhs) { return TMethod::_op_Inequality(*this, __rhs); };
static bool __fastcall _op_GreaterThan(const TMethod &Left, const TMethod &Right);
bool __fastcall operator>(const TMethod& __rhs) { return TMethod::_op_GreaterThan(*this, __rhs); };
static bool __fastcall _op_GreaterThanOrEqual(const TMethod &Left, const TMethod &Right);
bool __fastcall operator>=(const TMethod& __rhs) { return TMethod::_op_GreaterThanOrEqual(*this, __rhs); };
static bool __fastcall _op_LessThan(const TMethod &Left, const TMethod &Right);
bool __fastcall operator<(const TMethod& __rhs) { return TMethod::_op_LessThan(*this, __rhs); };
static bool __fastcall _op_LessThanOrEqual(const TMethod &Left, const TMethod &Right);
bool __fastcall operator<=(const TMethod& __rhs) { return TMethod::_op_LessThanOrEqual(*this, __rhs); };
};
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
record struct |
public | System.pas System.hpp |
System | System |
説明
メソッドを表す Code フィールドと Data フィールドを保有しています。
TMethod 型は、メソッドの Code ポインタと Data ポインタを保有しています。 この型を利用してメソッド ポインタを型キャストすると、メソッド ポインタのコード部分とデータ部分にアクセスできます。
TMethod 変数は、 Data にオブジェクトへのポインタを割り当て、Code には、MethodAddress を使用して、そのメソッドへの文字列パラメータとしてメソッド名を指定して割り当ることにより、設定していくことができます。