diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2016-03-23 09:16:49 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2016-04-01 16:25:45 -0700 |
commit | 2f0a837819a594db1397aff69f51323e948d2aba (patch) | |
tree | ed5343e2c023e3ab10b89f14aa4123096ad4f83b /src/compiler | |
parent | 054fae7e9d44414a1f27ea0dd6cbba237f735adf (diff) |
introduce concept of opaque client base configuration
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/csharp_generator.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 1343233423..a83290af12 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -363,11 +363,18 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor *service) { "name", GetClientClassName(service)); out->Print("{\n"); out->Print("}\n"); - out->Print("///<summary>Parameterless constructor to allow creation" + out->Print("///<summary>Protected parameterless constructor to allow creation" " of test doubles.</summary>\n"); out->Print("protected $name$() : base()\n", "name", GetClientClassName(service)); out->Print("{\n"); + out->Print("}\n"); + out->Print("///<summary>Protected constructor to allow creation of configured" + " clients.</summary>\n"); + out->Print("protected $name$(ClientBaseConfiguration configuration)" + " : base(configuration)\n", + "name", GetClientClassName(service)); + out->Print("{\n"); out->Print("}\n\n"); for (int i = 0; i < service->method_count(); i++) { @@ -452,11 +459,11 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor *service) { } // override NewInstance method - out->Print("protected override $name$ NewInstance(CallInvoker callInvoker)\n", + out->Print("protected override $name$ NewInstance(ClientBaseConfiguration configuration)\n", "name", GetClientClassName(service)); out->Print("{\n"); out->Indent(); - out->Print("return new $name$(callInvoker);\n", + out->Print("return new $name$(configuration);\n", "name", GetClientClassName(service)); out->Outdent(); out->Print("}\n"); |