THRIFT-5437 Make TProtocolImpl CTOR virtual
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Protocol.pas b/lib/delphi/src/Thrift.Protocol.pas
index aa12ad3..03cc371 100644
--- a/lib/delphi/src/Thrift.Protocol.pas
+++ b/lib/delphi/src/Thrift.Protocol.pas
@@ -250,6 +250,8 @@
function Configuration : IThriftConfiguration;
end;
+ TProtocolImplClass = class of TProtocolImpl;
+
TProtocolImpl = class abstract( TInterfacedObject, IProtocol)
strict protected
FTrans : ITransport;
@@ -317,7 +319,7 @@
property Transport: ITransport read GetTransport;
public
- constructor Create( const aTransport : ITransport);
+ constructor Create( const aTransport : ITransport); virtual;
end;
IBase = interface( ISupportsToString)
@@ -352,7 +354,8 @@
constructor Create( const aStrictRead : Boolean = FALSE; const aStrictWrite: Boolean = TRUE); reintroduce;
end;
- constructor Create( const trans: ITransport; strictRead: Boolean = FALSE; strictWrite: Boolean = TRUE); reintroduce;
+ constructor Create( const trans: ITransport); overload; override;
+ constructor Create( const trans: ITransport; strictRead, strictWrite: Boolean); reintroduce; overload;
procedure WriteMessageBegin( const msg: TThriftMessage); override;
procedure WriteMessageEnd; override;
@@ -414,7 +417,7 @@
public
// Encloses the specified protocol.
// All operations will be forward to the given protocol. Must be non-null.
- constructor Create( const aProtocol : IProtocol);
+ constructor Create( const aProtocol : IProtocol); reintroduce;
procedure WriteMessageBegin( const msg: TThriftMessage); override;
procedure WriteMessageEnd; override;
@@ -714,6 +717,12 @@
{ TBinaryProtocolImpl }
+constructor TBinaryProtocolImpl.Create( const trans: ITransport);
+begin
+ // call the real CTOR
+ Self.Create( trans, FALSE, TRUE);
+end;
+
constructor TBinaryProtocolImpl.Create( const trans: ITransport; strictRead, strictWrite: Boolean);
begin
inherited Create( trans);