System.SyncObjs.TInterlocked.CompareExchange

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

class function CompareExchange(var Target: Pointer; Value: Pointer; Comparand: Pointer): Pointer; overload; static; inline;
class function CompareExchange(var Target: Pointer; Value: Pointer; Comparand: Pointer; out Succeeded: Boolean): Pointer; overload; static; inline;
class function CompareExchange(var Target: Integer; Value: Integer; Comparand: Integer): Integer; overload; static; inline;
class function CompareExchange(var Target: Integer; Value: Integer; Comparand: Integer; out Succeeded: Boolean): Integer; overload; static;
class function CompareExchange(var Target: Cardinal; Value: Cardinal; Comparand: Cardinal): Cardinal; overload; static; inline;
class function CompareExchange(var Target: Cardinal; Value: Cardinal; Comparand: Cardinal; out Succeeded: Boolean): Cardinal; overload; static; inline;
class function CompareExchange(var Target: Int64; Value: Int64; Comparand: Int64): Int64; overload; static; inline;
class function CompareExchange(var Target: Int64; Value: Int64; Comparand: Int64; out Succeeded: Boolean): Int64; overload; static; inline;
class function CompareExchange(var Target: UInt64; Value: UInt64; Comparand: UInt64): UInt64; overload; static; inline;
class function CompareExchange(var Target: UInt64; Value: UInt64; Comparand: UInt64; out Succeeded: Boolean): UInt64; overload; static; inline;
class function CompareExchange(var Target: TObject; Value: TObject; Comparand: TObject): TObject; overload; static; inline;
class function CompareExchange(var Target: TObject; Value: TObject; Comparand: TObject; out Succeeded: Boolean): TObject; overload; static; inline;
class function CompareExchange(var Target: Double; Value: Double; Comparand: Double): Double; overload; static; inline;
class function CompareExchange(var Target: Double; Value: Double; Comparand: Double; out Succeeded: Boolean): Double; overload; static; inline;
class function CompareExchange(var Target: Single; Value: Single; Comparand: Single): Single; overload; static; inline;
class function CompareExchange(var Target: Single; Value: Single; Comparand: Single; out Succeeded: Boolean): Single; overload; static; inline;
class function CompareExchange(var Target: Boolean; Value: Boolean; Comparand: Boolean): Boolean; overload; static; inline;
class function CompareExchange(var Target: Boolean; Value: Boolean; Comparand: Boolean; out Succeeded: Boolean): Boolean; overload; static; inline;
class function CompareExchange<T: class>(var Target: T; Value: T; Comparand: T): T; overload; static; inline;
class function CompareExchange<T: class>(var Target: T; Value: T; Comparand: T; out Succeeded: Boolean): T; overload; static; inline;

C++

static void * __fastcall CompareExchange(void * &Target, void * Value, void * Comparand)/* overload */;
static void * __fastcall CompareExchange(void * &Target, void * Value, void * Comparand, /* out */ bool &Succeeded)/* overload */;
static int __fastcall CompareExchange(int &Target, int Value, int Comparand)/* overload */;
static int __fastcall CompareExchange(int &Target, int Value, int Comparand, /* out */ bool &Succeeded)/* overload */;
static unsigned __fastcall CompareExchange(unsigned &Target, unsigned Value, unsigned Comparand)/* overload */;
static unsigned __fastcall CompareExchange(unsigned &Target, unsigned Value, unsigned Comparand, /* out */ bool &Succeeded)/* overload */;
static __int64 __fastcall CompareExchange(__int64 &Target, __int64 Value, __int64 Comparand)/* overload */;
static __int64 __fastcall CompareExchange(__int64 &Target, __int64 Value, __int64 Comparand, /* out */ bool &Succeeded)/* overload */;
static unsigned __int64 __fastcall CompareExchange(unsigned __int64 &Target, unsigned __int64 Value, unsigned __int64 Comparand)/* overload */;
static unsigned __int64 __fastcall CompareExchange(unsigned __int64 &Target, unsigned __int64 Value, unsigned __int64 Comparand, /* out */ bool &Succeeded)/* overload */;
static System::TObject* __fastcall CompareExchange(System::TObject* &Target, System::TObject* Value, System::TObject* Comparand)/* overload */;
static System::TObject* __fastcall CompareExchange(System::TObject* &Target, System::TObject* Value, System::TObject* Comparand, /* out */ bool &Succeeded)/* overload */;
static double __fastcall CompareExchange(double &Target, double Value, double Comparand)/* overload */;
static double __fastcall CompareExchange(double &Target, double Value, double Comparand, /* out */ bool &Succeeded)/* overload */;
static float __fastcall CompareExchange(float &Target, float Value, float Comparand)/* overload */;
static float __fastcall CompareExchange(float &Target, float Value, float Comparand, /* out */ bool &Succeeded)/* overload */;
static bool __fastcall CompareExchange(bool &Target, bool Value, bool Comparand)/* overload */;
static bool __fastcall CompareExchange(bool &Target, bool Value, bool Comparand, /* out */ bool &Succeeded)/* overload */;
template<typename T> static T __fastcall CompareExchange(T &Target, T Value, T Comparand)/* overload */;
template<typename T> static T __fastcall CompareExchange(T &Target, T Value, T Comparand, /* out */ bool &Succeeded)/* overload */;

プロパティ

種類 可視性 ソース ユニット
function public
System.SyncObjs.pas
System.SyncObjs.hpp
System.SyncObjs TInterlocked


説明

TargetComparand のコンテンツを比較し、同じ場合には、Target のコンテンツを変更します。

CompareExchange は、Target 値を Comparand 値と比較します。Target 値が Comparand 値と同じ場合、Value 値は Target で指定されたアドレスに格納されます。そうでなければ、オペレーションは実行されません。

CompareExchange のオーバーロードは 8 つあります。そのうちの 1 つでは、追加パラメータ Succeeded を受け取ります。このパラメータは、オペレーションが正常終了した場合には True を、そうでなければ False を受け取ります。

最後のメソッドは、汎用パラメータと汎用戻り値の両方を持っており、どのオブジェクト型のパラメータも受け取ることができます。

関連項目