Add to ConceptSingleton to PABCSystem
This commit is contained in:
parent
a6c6ce9f8f
commit
cd9912deb7
|
|
@ -2048,6 +2048,24 @@ type
|
|||
constructor(ptr: pointer);
|
||||
end;
|
||||
|
||||
type
|
||||
///--
|
||||
__ConceptSingleton<T> = class where T: constructor;
|
||||
class _instance: T;
|
||||
class inited: boolean := false;
|
||||
public
|
||||
class function &Instance: T;
|
||||
begin
|
||||
if inited = false then
|
||||
begin
|
||||
inited := true;
|
||||
_instance := new T;
|
||||
end;
|
||||
|
||||
Result := _instance;
|
||||
end;
|
||||
end;
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Internal procedures for PABCRTL.dll
|
||||
// -----------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1966,6 +1966,24 @@ type
|
|||
constructor(ptr: pointer);
|
||||
end;
|
||||
|
||||
type
|
||||
///--
|
||||
__ConceptSingleton<T> = class where T: constructor;
|
||||
class _instance: T;
|
||||
class inited: boolean := false;
|
||||
public
|
||||
class function &Instance: T;
|
||||
begin
|
||||
if inited = false then
|
||||
begin
|
||||
inited := true;
|
||||
_instance := new T;
|
||||
end;
|
||||
|
||||
Result := _instance;
|
||||
end;
|
||||
end;
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Internal procedures for PABCRTL.dll
|
||||
// -----------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -2048,6 +2048,24 @@ type
|
|||
constructor(ptr: pointer);
|
||||
end;
|
||||
|
||||
type
|
||||
///--
|
||||
__ConceptSingleton<T> = class where T: constructor;
|
||||
class _instance: T;
|
||||
class inited: boolean := false;
|
||||
public
|
||||
class function &Instance: T;
|
||||
begin
|
||||
if inited = false then
|
||||
begin
|
||||
inited := true;
|
||||
_instance := new T;
|
||||
end;
|
||||
|
||||
Result := _instance;
|
||||
end;
|
||||
end;
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Internal procedures for PABCRTL.dll
|
||||
// -----------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue