unit uRODLAsyncConverter; {----------------------------------------------------------------------------} { RemObjects SDK Library - CodeGen2 } { } { compiler: Delphi 5 and up, Kylix 2 and up } { platform: Win32, Linux } { } { (c)opyright RemObjects Software. all rights reserved. } { } { Using this code requires a valid license of the RemObjects SDK } { which can be obtained at http://www.remobjects.com. } {----------------------------------------------------------------------------} {$IFDEF LINUX} {$I ../RemObjects.inc} {$ELSE} {$I ..\RemObjects.inc} {$ENDIF LINUX} interface uses uRODL, uRODLTemplateBasedConverter, uRODLIntfConverter; type TRODLAsyncConverter = class (TRODLIntfConverter) protected function GetServicesSectionClass: TServicesSectionClass; override; end; type TAsyncServicesSection = class (TIntfServicesSection) protected function GetAncestorName(const aService: TRODLBaseService): string; override; function GetProxyAncestorName(const aService: TRODLBaseService): string; override; function GetProxySuffix: string; override; procedure DoReplacements(var curLine: string; const aService: TRODLBaseService; const aLibrary: TRODLLibrary); override; end; implementation uses uROClasses, uRODLTemplateBasedConverterUtils; { TRODLAsyncConverter } function TRODLAsyncConverter.GetServicesSectionClass: TServicesSectionClass; begin Result := TAsyncServicesSection; end; { TAsyncServicesSection } procedure TAsyncServicesSection.DoReplacements(var curLine: string; const aService: TRODLBaseService; const aLibrary: TRODLLibrary); begin inherited DoReplacements(curLine, aService, aLibrary); MacroReplace(curLine, '%', ['ASYNC_SERVICE_UID', NewGuidAsString ]); end; function TAsyncServicesSection.GetAncestorName( const aService: TRODLBaseService): string; begin Result := inherited GetAncestorName(aService); if Length(Result) > 0 then Result := Result + DEFAULT_ASYNC_SUFFIX else Result := DEFAULT_SERVICE_ASYNC_ANCESTOR_NAME; end; function TAsyncServicesSection.GetProxyAncestorName( const aService: TRODLBaseService): string; begin Result := inherited GetProxyAncestorName(aService); if (Length(Result) = 0) or (Result = DEFAULT_SERVICE_PROXY_ANCESTOR_NAME) then Result := DEFAULT_SERVICE_ASYNC_PROXY_ANCESTOR_NAME; end; function TAsyncServicesSection.GetProxySuffix: string; begin Result := DEFAULT_ASYNC_PROXY_SUFFIX; end; end.