четверг, 9 июля 2015 г.

ToDo. Переделать TREAD на "новые шаблоны"

Вот тут:

unit kwCompiledThread;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Библиотека "ScriptEngine"
// Модуль: "kwCompiledThread.pas"
// Родные Delphi интерфейсы (.pas)
// Generated from UML model, root element: SimpleClass::Class Shared Delphi Low Level::ScriptEngine::CodeFlowWords::TkwCompiledThread
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

{$Include ..\ScriptEngine\seDefine.inc}

interface

{$If not defined(NoScripts)}
uses
  kwCompiledWordWorker,
  tfwScriptingInterfaces
  ;
{$IfEnd} //not NoScripts

{$If not defined(NoScripts)}
type
 TkwCompiledThread = class(TkwCompiledWordWorker)
 protected
 // realized methods
   procedure DoDoIt(const aCtx: TtfwContext); override;
 end;//TkwCompiledThread
{$IfEnd} //not NoScripts

implementation

{$If not defined(NoScripts)}
uses
  seThreadSupport
  ;
{$IfEnd} //not NoScripts

{$If not defined(NoScripts)}

// start class TkwCompiledThread

procedure TkwCompiledThread.DoDoIt(const aCtx: TtfwContext);
//#UC START# *4DAEEDE10285_4FFFD8970110_var*
//#UC END# *4DAEEDE10285_4FFFD8970110_var*
begin
//#UC START# *4DAEEDE10285_4FFFD8970110_impl*
 TseWorkThreadList.Instance.AddAndResumeThread(aCtx, f_Word);
//#UC END# *4DAEEDE10285_4FFFD8970110_impl*
end;//TkwCompiledThread.DoDoIt

{$IfEnd} //not NoScripts

initialization
{$If not defined(NoScripts)}
// Регистрация TkwCompiledThread
 TkwCompiledThread.RegisterClass;
{$IfEnd} //not NoScripts

end.
unit kwTHREAD;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Библиотека "ScriptEngine"
// Модуль: "kwTHREAD.pas"
// Родные Delphi интерфейсы (.pas)
// Generated from UML model, root element: ScriptKeyword::Class Shared Delphi Low Level::ScriptEngine::CodeFlowWords::THREAD
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

{$Include ..\ScriptEngine\seDefine.inc}

interface

{$If not defined(NoScripts)}
uses
  tfwWordWorker,
  tfwScriptingInterfaces,
  kwCompiledWordWorker
  ;
{$IfEnd} //not NoScripts

{$If not defined(NoScripts)}
type
 TkwTHREAD = {final scriptword} class(TtfwWordWorker)
 protected
 // realized methods
   function CompiledWorkerClass(const aCtx: TtfwContext): RkwCompiledWordWorker; override;
 protected
 // overridden protected methods
   class function GetWordNameForRegister: AnsiString; override;
 end;//TkwTHREAD
{$IfEnd} //not NoScripts

implementation

{$If not defined(NoScripts)}
uses
  kwCompiledThread
  ;
{$IfEnd} //not NoScripts

{$If not defined(NoScripts)}

// start class TkwTHREAD

function TkwTHREAD.CompiledWorkerClass(const aCtx: TtfwContext): RkwCompiledWordWorker;
//#UC START# *4DCBD67C0362_4FFFCE260353_var*
//#UC END# *4DCBD67C0362_4FFFCE260353_var*
begin
//#UC START# *4DCBD67C0362_4FFFCE260353_impl*
 Result := TkwCompiledThread;
//#UC END# *4DCBD67C0362_4FFFCE260353_impl*
end;//TkwTHREAD.CompiledWorkerClass

class function TkwTHREAD.GetWordNameForRegister: AnsiString;
 {-}
begin
 Result := 'THREAD';
end;//TkwTHREAD.GetWordNameForRegister

{$IfEnd} //not NoScripts

initialization
{$If not defined(NoScripts)}
// Регистрация THREAD
 TkwTHREAD.RegisterInEngine;
{$IfEnd} //not NoScripts

end.

Уже сделано.

Вот:

type
 TkwTHREAD = {final scriptword} class(TtfwWordWorkerEx)
  {* Слово скрипта THREAD
*Пример:*
[code]
 THREAD aWord
[code]  }
 private
 // private methods
   procedure THREAD(const aCtx: TtfwContext;
    aWord: TtfwWord);
     {* Реализация слова скрипта THREAD }
 protected
 // overridden protected methods
   class function GetWordNameForRegister: AnsiString; override;
 public
 // overridden public methods
   procedure DoRun(const aCtx: TtfwContext); override;
   function GetResultTypeInfo(const aCtx: TtfwContext): PTypeInfo; override;
 end;//TkwTHREAD

// start class TkwTHREAD

procedure TkwTHREAD.THREAD(const aCtx: TtfwContext;
  aWord: TtfwWord);
//#UC START# *A56425D1C72F_44C318D8896A_var*
//#UC END# *A56425D1C72F_44C318D8896A_var*
begin
//#UC START# *A56425D1C72F_44C318D8896A_impl*
 TseWorkThreadList.Instance.AddAndResumeThread(aCtx, aWord);
//#UC END# *A56425D1C72F_44C318D8896A_impl*
end;//TkwTHREAD.THREAD

class function TkwTHREAD.GetWordNameForRegister: AnsiString;
 {-}
begin
 Result := 'THREAD';
end;//TkwTHREAD.GetWordNameForRegister

procedure TkwTHREAD.DoRun(const aCtx: TtfwContext);
 {-}
var
 l_aWord : TtfwWord;
begin
 try
  l_aWord := TtfwWord(aCtx.rEngine.PopObjAs(TtfwWord));
 except
  on E: Exception do
  begin
   RunnerError('Ошибка при получении параметра aWord: TtfwWord : ' + E.Message, aCtx);
   Exit;
  end;//on E: Exception
 end;//try..except
 THREAD(aCtx, l_aWord);
end;//TkwTHREAD.DoRun

function TkwTHREAD.GetResultTypeInfo(const aCtx: TtfwContext): PTypeInfo;
 {-}
begin
 Result := @tfw_tiVoid;
end;//TkwTHREAD.GetResultTypeInfo

Комментариев нет:

Отправить комментарий