THRIFT-5437 Make TProtocolImpl CTOR virtual
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Protocol.Compact.pas b/lib/delphi/src/Thrift.Protocol.Compact.pas
index 424b267..3a1dbfd 100644
--- a/lib/delphi/src/Thrift.Protocol.Compact.pas
+++ b/lib/delphi/src/Thrift.Protocol.Compact.pas
@@ -134,7 +134,7 @@
     strict private  boolValue_  : ( unused, bool_true, bool_false);
 
   public
-    constructor Create(const trans : ITransport);
+    constructor Create(const trans : ITransport);  override;
     destructor Destroy;  override;
 
   strict private
diff --git a/lib/delphi/src/Thrift.Protocol.JSON.pas b/lib/delphi/src/Thrift.Protocol.JSON.pas
index 515d85c..52909b7 100644
--- a/lib/delphi/src/Thrift.Protocol.JSON.pas
+++ b/lib/delphi/src/Thrift.Protocol.JSON.pas
@@ -140,7 +140,7 @@
 
   public
     // TJSONProtocolImpl Constructor
-    constructor Create( const aTrans : ITransport);
+    constructor Create( const aTrans : ITransport);  override;
     destructor Destroy;   override;
 
   strict protected
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);