FMX.Utils.TNonReentrantHelper.Execute
Delphi
class function Execute(var Guard: Boolean; const Proc: TProc): Boolean; overload;
class function Execute<A>(var Guard: Boolean; const Proc: TProc<A>; const Arg: A): Boolean; overload;
class function Execute<R>(var Guard: Boolean; const Func: TFunc<R>; const Default: R): R; overload;
class function Execute<A; R>(var Guard: Boolean; const Func: TFunc<A, R>; const Arg: A; const Default: R): R; overload;
C++
__classmethod bool __fastcall Execute(bool &Guard, const System::Sysutils::_di_TProc Proc)/* overload */;
template<typename A> __classmethod bool __fastcall Execute(bool &Guard, const System::DelphiInterface<System::Sysutils::TProc__1<A> > Proc, const A Arg)/* overload */;
template<typename R> __classmethod R __fastcall Execute(bool &Guard, const System::DelphiInterface<System::Sysutils::TFunc__1<R> > Func, const R Default)/* overload */;
template<typename A, typename R> __classmethod R __fastcall Execute(bool &Guard, const System::DelphiInterface<System::Sysutils::TFunc__2<A,R> > Func, const A Arg, const R Default)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | FMX.Utils.pas FMX.Utils.hpp |
FMX.Utils | TNonReentrantHelper |
Description
Executes a non-reentrable procedure using a guard variable.
The Execute method is overloaded:
- The first overloaded method executes the non-reentrable procedure
TProc
, using the guard variableGuard
. Execute returnsTrue
if the procedure is executed. - The second overloaded method executes the non-reentrable procedure
TProc<A>
(procedure with an argument of typeA
). Execute returnsTrue
if the procedure is executed. - The third overloaded method executes the non-reentrable function
TFunc<R>
. Execute returns:- The function result (of type
R
) if the function is executed. - The default value of type
R
if the code is not executed.
- The function result (of type
- The fourth overloaded method executes the non-reentrable function
TFunc<A,R>
(an argument of typeA
and the result type ofR
). Execute returns:- The function result (of type
R
) if the function is executed. - The default value of type
R
if the code is not executed.
- The function result (of type