Componentes.Terceros.RemObj.../internal/5.0.23.613/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Intf.pas
david 2824855ea7 - Modificación del paquete RemObjects_Core_D10 para que sea un paquete de runtime/designtime (antes era designtime sólo)
- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10
- Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10

git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
2007-09-10 14:06:19 +00:00

98 lines
2.7 KiB
ObjectPascal

unit AsyncLibrary_Intf;
{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading }
{ the RODL file associated with this project . }
{ }
{ Do not modify this unit manually, or your changes will be lost when this }
{ unit is regenerated the next time you compile the project. }
{----------------------------------------------------------------------------}
{$I Remobjects.inc}
interface
uses
{vcl:} Classes, TypInfo,
{RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf;
const
{ Library ID }
LibraryUID = '{D34B1991-1F3D-47A0-9984-50FE83013C35}';
TargetNamespace = '';
{ Service Interface ID's }
IAsyncService_IID : TGUID = '{D34B1991-1F3D-47A0-9984-50FE83013C35}';
{ Event ID's }
type
{ Forward declarations }
IAsyncService = interface;
{ IAsyncService }
IAsyncService = interface
['{D34B1991-1F3D-47A0-9984-50FE83013C35}']
function Sum(const A: Integer; const B: Integer): Integer;
end;
{ CoAsyncService }
CoAsyncService = class
class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAsyncService;
end;
{ TAsyncService_Proxy }
TAsyncService_Proxy = class(TROProxy, IAsyncService)
protected
function __GetInterfaceName:string; override;
function Sum(const A: Integer; const B: Integer): Integer;
end;
implementation
uses
{vcl:} SysUtils,
{RemObjects:} uROEventRepository, uROSerializer, uRORes;
{ CoAsyncService }
class function CoAsyncService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAsyncService;
begin
result := TAsyncService_Proxy.Create(aMessage, aTransportChannel);
end;
{ TAsyncService_Proxy }
function TAsyncService_Proxy.__GetInterfaceName:string;
begin
result := 'AsyncService';
end;
function TAsyncService_Proxy.Sum(const A: Integer; const B: Integer): Integer;
begin
try
__Message.InitializeRequestMessage(__TransportChannel, 'AsyncLibrary', __InterfaceName, 'Sum');
__Message.Write('A', TypeInfo(Integer), A, []);
__Message.Write('B', TypeInfo(Integer), B, []);
__Message.Finalize;
__TransportChannel.Dispatch(__Message);
__Message.Read('Result', TypeInfo(Integer), result, []);
finally
__Message.UnsetAttributes(__TransportChannel);
__Message.FreeStream;
end
end;
initialization
RegisterProxyClass(IAsyncService_IID, TAsyncService_Proxy);
finalization
UnregisterProxyClass(IAsyncService_IID);
end.