unit Globals;

interface

uses OpenProjectManager, SupportUnit, ProjectManagerDm, ReportManager, LogUtils;

function OpenProjectManager: TOpenProjectManager;

function SupportManager: TSupportManager;

function ProjectManager: TProjectManagerData;

function ReportTemplateManager: TTemplateManager;

function ReportConfig: TReportConfig;

function MemoryReportManager: TMemoryReportManager;

function MeasureLog: TLogUtils;

implementation

var
  _OpenProjectManager: TOpenProjectManager;
  _SupportManager: TSupportManager;
  _ProjectManager: TProjectManagerData;
  _ReportTemplateManager: TTemplateManager;
  _ReportConfig: TReportConfig;
  _MemoryReportManager: TMemoryReportManager;
  _MeasureLog: TLogUtils;

function OpenProjectManager: TOpenProjectManager;
begin
  if not Assigned(_OpenProjectManager) then
    _OpenProjectManager := TOpenProjectManager.Create;
  Result := _OpenProjectManager;
end;

function SupportManager: TSupportManager;
begin
  if not Assigned(_SupportManager) then
    _SupportManager := TSupportManager.Create;
  Result := _SupportManager;
end;

function ProjectManager: TProjectManagerData;
begin
  if not Assigned(_ProjectManager) then
    _ProjectManager := TProjectManagerData.Create;
  Result := _ProjectManager;
end;

function ReportTemplateManager: TTemplateManager;
begin
  if not Assigned(_ReportTemplateManager) then
    _ReportTemplateManager := TTemplateManager.Create;
  Result := _ReportTemplateManager;
end;

function ReportConfig: TReportConfig;
begin
  if not Assigned(_ReportConfig) then
    _ReportConfig := TReportConfig.Create;
  Result := _ReportConfig;
end;

function MemoryReportManager: TMemoryReportManager;
begin
  if not Assigned(_MemoryReportManager) then
    _MemoryReportManager := TMemoryReportManager.Create;
  Result := _MemoryReportManager;
end;

function MeasureLog: TLogUtils;
begin
  if not Assigned(_MeasureLog) then
    _MeasureLog := TLogUtils.Create;
  Result := _MeasureLog;
end;

initialization

finalization
  _OpenProjectManager.Free;
  _SupportManager.Free;
  _ProjectManager.Free;
  _ReportTemplateManager.Free;
  _ReportConfig.Free;
  _MemoryReportManager.Free;
  _MeasureLog.Free;
end.
