aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler/csharp_generator.cc
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-03-23 09:16:49 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-04-01 16:25:45 -0700
commit2f0a837819a594db1397aff69f51323e948d2aba (patch)
treeed5343e2c023e3ab10b89f14aa4123096ad4f83b /src/compiler/csharp_generator.cc
parent054fae7e9d44414a1f27ea0dd6cbba237f735adf (diff)
introduce concept of opaque client base configuration
Diffstat (limited to 'src/compiler/csharp_generator.cc')
-rw-r--r--src/compiler/csharp_generator.cc13
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");