System.TPtrWrapper

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

  TPtrWrapper = record
  private
    Value: PByte;
    class function GetNilValue: TPtrWrapper; inline; static;
  public
    constructor Create(AValue: NativeInt); overload;
    constructor Create(AValue: Pointer); overload;
    function ToPointer: Pointer;
    function ToInteger: NativeInt;
    class property NilValue: TPtrWrapper read GetNilValue;
    class operator Equal(Left, Right: TPtrWrapper): Boolean;
    class operator NotEqual(Left, Right: TPtrWrapper): Boolean;
  end;

C++

struct DECLSPEC_DRECORD TPtrWrapper
{
private:
    Byte *Value;
    static TPtrWrapper __fastcall GetNilValue();
public:
    __fastcall TPtrWrapper(NativeInt AValue)/* overload */;
    __fastcall TPtrWrapper(void * AValue)/* overload */;
    void * __fastcall ToPointer();
    NativeInt __fastcall ToInteger();
    /* static */ __property TPtrWrapper NilValue = {read=GetNilValue};
#ifndef _WIN64
    static bool __fastcall _op_Equality(TPtrWrapper Left, TPtrWrapper Right);
#else /* _WIN64 */
    static bool __fastcall _op_Equality(const TPtrWrapper &Left, const TPtrWrapper &Right);
#endif /* _WIN64 */
    bool __fastcall operator==(const TPtrWrapper& __rhs) { return TPtrWrapper::_op_Equality(*this, __rhs); };
#ifndef _WIN64
    static bool __fastcall _op_Inequality(TPtrWrapper Left, TPtrWrapper Right);
#else /* _WIN64 */
    static bool __fastcall _op_Inequality(const TPtrWrapper &Left, const TPtrWrapper &Right);
#endif /* _WIN64 */
    bool __fastcall operator!=(const TPtrWrapper& __rhs) { return TPtrWrapper::_op_Inequality(*this, __rhs); };
    TPtrWrapper() {}
};

Properties

Type Visibility Source Unit Parent
record
struct
public
System.pas
System.hpp
System System

Description

TPtrWrapper is a pointer-sized value representing a pointer.

TPtrWrapper has the same size as a pointer. It is designed so that it can be used where a pointer would appear in an API declaration, avoiding casting back and forth.

This wrapped pointer is used in the process of marshalling, applied by the low-level TMarshal, and the high-level TMarshaller APIs.

See Also