System.SyncObjs.TInterlocked.Exchange
Delphi
class function Exchange(var Target: Pointer; Value: Pointer): Pointer; overload; static; inline;
class function Exchange(var Target: Integer; Value: Integer): Integer; overload; static; inline;
class function Exchange(var Target: Cardinal; Value: Cardinal): Cardinal; overload; static; inline;
class function Exchange(var Target: Int64; Value: Int64): Int64; overload; static; inline;
class function Exchange(var Target: UInt64; Value: UInt64): UInt64; overload; static; inline;
class function Exchange(var Target: TObject; Value: TObject): TObject; overload; static; inline;
class function Exchange(var Target: Single; Value: Single): Single; overload; static; inline;
class function Exchange(var Target: Double; Value: Double): Double; overload; static; inline;
class function Exchange(var Target: Boolean; Value: Boolean): Boolean; overload; static; inline;
class function Exchange<T: class>(var Target: T; Value: T): T; overload; static; inline;
C++
static void * __fastcall Exchange(void * &Target, void * Value)/* overload */;
static int __fastcall Exchange(int &Target, int Value)/* overload */;
static unsigned __fastcall Exchange(unsigned &Target, unsigned Value)/* overload */;
static __int64 __fastcall Exchange(__int64 &Target, __int64 Value)/* overload */;
static unsigned __int64 __fastcall Exchange(unsigned __int64 &Target, unsigned __int64 Value)/* overload */;
static System::TObject* __fastcall Exchange(System::TObject* &Target, System::TObject* Value)/* overload */;
static float __fastcall Exchange(float &Target, float Value)/* overload */;
static double __fastcall Exchange(double &Target, double Value)/* overload */;
static bool __fastcall Exchange(bool &Target, bool Value)/* overload */;
template<typename T> static T __fastcall Exchange(T &Target, T Value)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SyncObjs.pas System.SyncObjs.hpp |
System.SyncObjs | TInterlocked |
Description
Swaps the value of the two method parameters.
There are seven Exchange overloads and they all swap the value of the Target with Value. The last Exchange method has generic parameters and return type and can receive parameters of any type.