".TClient.Create( const iprot: IProtocol; const oprot: IProtocol);" << endl;
indent_impl(s_service_impl) << "begin" << endl;
indent_up_impl();
+ indent_impl(s_service_impl) << "inherited Create;" << endl;
indent_impl(s_service_impl) << "iprot_ := iprot;" << endl;
indent_impl(s_service_impl) << "oprot_ := oprot;" << endl;
indent_down_impl();
\r
constructor TThriftDictionaryImpl<TKey, TValue>.Create(ACapacity: Integer);\r
begin\r
+ inherited Create;\r
FDictionaly := TDictionary<TKey,TValue>.Create( ACapacity );\r
end;\r
\r
\r
constructor TThriftListImpl<T>.Create;\r
begin\r
+ inherited;\r
FList := TList<T>.Create;\r
end;\r
\r
\r
constructor TGUIConsole.Create( AMemo: TMemo);\r
begin\r
+ inherited Create;\r
FMemo := AMemo;\r
FLineBreak := True;\r
end;\r
constructor TFieldImpl.Create(const AName: string; const AType: TType;\r
AId: SmallInt);\r
begin\r
+ inherited Create;\r
FName := AName;\r
FType := AType;\r
FId := AId;\r
\r
constructor TFieldImpl.Create;\r
begin\r
+ inherited Create;\r
FName := '';\r
FType := Low(TType);\r
FId := 0;\r
\r
constructor TMapImpl.Create;\r
begin\r
-\r
+ inherited Create;\r
end;\r
\r
function TMapImpl.GetCount: Integer;\r
\r
constructor TSetImpl.Create;\r
begin\r
-\r
+ inherited Create;\r
end;\r
\r
function TSetImpl.GetCount: Integer;\r
\r
constructor TListImpl.Create;\r
begin\r
-\r
+ inherited Create;\r
end;\r
\r
function TListImpl.GetCount: Integer;\r
\r
constructor TBinaryProtocolImpl.Create( const trans: ITransport);\r
begin\r
+ //no inherited\r
Create( trans, False, True);\r
end;\r
\r
\r
constructor TBinaryProtocolImpl.TFactory.Create(AStrictRead, AStrictWrite: Boolean);\r
begin\r
+ inherited Create;\r
FStrictRead := AStrictRead;\r
FStrictWrite := AStrictWrite;\r
end;\r
\r
constructor TBinaryProtocolImpl.TFactory.Create;\r
begin\r
+ //no inherited; \r
Create( False, True )\r
end;\r
\r
constructor TSerializer.Create();
// Create a new TSerializer that uses the TBinaryProtocol by default.
begin
+ //no inherited;
Create( TBinaryProtocolImpl.TFactory.Create);
end;
constructor TDeserializer.Create();
// Create a new TDeserializer that uses the TBinaryProtocol by default.
begin
+ //no inherited;
Create( TBinaryProtocolImpl.TFactory.Create);
end;
InputTransFactory := TTransportFactoryImpl.Create;
OutputTransFactory := TTransportFactoryImpl.Create;
+ //no inherited;
Create(
AProcessor,
AServerTransport,
InputTransFactory := TTransportFactoryImpl.Create;
OutputTransFactory := TTransportFactoryImpl.Create;
+ //no inherited;
Create(
AProcessor,
AServerTransport,
InputProtocolFactory := TBinaryProtocolImpl.TFactory.Create;
OutputProtocolFactory := TBinaryProtocolImpl.TFactory.Create;
+ //no inherited;
Create( AProcessor, AServerTransport, ATransportFactory, ATransportFactory,
InputProtocolFactory, OutputProtocolFactory, DefaultLogDelegate);
end;
const AInputProtocolFactory, AOutputProtocolFactory: IProtocolFactory;
const ALogDelegate : TLogDelegate);
begin
+ inherited Create;
FProcessor := AProcessor;
FServerTransport := AServerTransport;
FInputTransportFactory := AInputTransportFactory;
const AServerTransport: IServerTransport; const ATransportFactory: ITransportFactory;
const AProtocolFactory: IProtocolFactory);
begin
+ //no inherited;
Create( AProcessor, AServerTransport,
ATransportFactory, ATransportFactory,
AProtocolFactory, AProtocolFactory,
\r
constructor TThriftStreamAdapterCOM.Create( const AStream: IStream);\r
begin\r
+ inherited Create;\r
FStream := AStream;\r
end;\r
\r
\r
constructor TThriftStreamAdapterDelphi.Create( const AStream: TStream; AOwnsStream: Boolean);\r
begin\r
+ inherited Create;\r
FStream := AStream;\r
FOwnsStream := AOwnsStream;\r
end;\r
\r
constructor TTransportException.Create(AType: TExceptionType);\r
begin\r
+ //no inherited; \r
Create( AType, '' )\r
end;\r
\r
\r
constructor TServerSocketImpl.Create( const AServer: TTcpServer; AClientTimeout: Integer);\r
begin\r
+ inherited Create;\r
FServer := AServer;\r
FClientTimeout := AClientTimeout;\r
end;\r
\r
constructor TServerSocketImpl.Create( const AServer: TTcpServer);\r
begin\r
+ //no inherited; \r
Create( AServer, 0 );\r
end;\r
\r
constructor TServerSocketImpl.Create(APort: Integer);\r
begin\r
+ //no inherited; \r
Create( APort, 0 );\r
end;\r
\r
constructor TServerSocketImpl.Create(APort, AClientTimeout: Integer;\r
AUseBufferedSockets: Boolean);\r
begin\r
+ inherited Create;\r
FPort := APort;\r
FClientTimeout := AClientTimeout;\r
FUseBufferedSocket := AUseBufferedSockets;\r
\r
constructor TServerSocketImpl.Create(APort, AClientTimeout: Integer);\r
begin\r
+ //no inherited; \r
Create( APort, AClientTimeout, False );\r
end;\r
\r
begin\r
FClient := AClient;\r
stream := TTcpSocketStreamImpl.Create( FClient);\r
- FInputStream := stream;\r
- FOutputStream := stream;\r
+ inherited Create( stream, stream);\r
end;\r
\r
constructor TSocketImpl.Create(const AHost: string; APort: Integer);\r
begin\r
+ //no inherited; \r
Create( AHost, APort, 0);\r
end;\r
\r
procedure TSocketImpl.Close;\r
begin\r
inherited Close;\r
- if FClient <> nil then\r
- begin\r
- FClient.Free;\r
- FClient := nil;\r
- end;\r
+ if FClient <> nil\r
+ then FreeAndNil( FClient);\r
end;\r
\r
constructor TSocketImpl.Create(const AHost: string; APort, ATimeout: Integer);\r
begin\r
+ inherited Create(nil,nil);\r
FHost := AHost;\r
FPort := APort;\r
FTimeout := ATimeout;\r
\r
constructor TBufferedStreamImpl.Create( const AStream: IThriftStream; ABufSize: Integer);\r
begin\r
+ inherited Create;\r
FStream := AStream;\r
FBufSize := ABufSize;\r
FReadBuffer := TMemoryStream.Create;\r
\r
constructor TStreamTransportImpl.Create( const AInputStream : IThriftStream; const AOutputStream : IThriftStream);\r
begin\r
+ inherited Create;\r
FInputStream := AInputStream;\r
FOutputStream := AOutputStream;\r
end;\r
\r
constructor TBufferedTransportImpl.Create( const ATransport: IStreamTransport);\r
begin\r
+ //no inherited; \r
Create( ATransport, 1024 );\r
end;\r
\r
constructor TBufferedTransportImpl.Create( const ATransport: IStreamTransport;\r
ABufSize: Integer);\r
begin\r
+ inherited Create;\r
FTransport := ATransport;\r
FBufSize := ABufSize;\r
InitBuffers;\r
\r
constructor TFramedTransportImpl.Create;\r
begin\r
+ inherited Create;\r
InitWriteBuffer;\r
end;\r
\r
\r
constructor TFramedTransportImpl.Create( const ATrans: ITransport);\r
begin\r
+ inherited Create;\r
InitWriteBuffer;\r
FTransport := ATrans;\r
end;\r
\r
constructor TTcpSocketStreamImpl.Create( const ATcpClient: TCustomIpClient);\r
begin\r
+ inherited Create;\r
FTcpClient := ATcpClient;\r
end;\r
\r
procedure ClientTest;
procedure JSONProtocolReadWriteTest;
+ {$IFDEF StressTest}
procedure StressTest(const client : TThriftTest.Iface);
+ {$ENDIF}
protected
procedure Execute; override;
public
end;
+{$IFDEF StressTest}
procedure TClientThread.StressTest(const client : TThriftTest.Iface);
begin
while TRUE do begin
end;
end;
end;
-
+{$ENDIF}
procedure TClientThread.JSONProtocolReadWriteTest;
// Tests only then read/write procedures of the JSON protocol
constructor TThreadConsole.Create(AThread: TThread);
begin
+ inherited Create;
FThread := AThread;
end;
constructor TTestClient.Create( const args: array of string);
begin
+ inherited;
ParseArgs(args);
Setup;
end;