Implement inheritance in the alterl generator
authorDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 00:58:33 +0000 (00:58 +0000)
committerDavid Reiss <dreiss@apache.org>
Wed, 11 Jun 2008 00:58:33 +0000 (00:58 +0000)
Summary:
  - Simply forwards function_info calls through to the base service

Test plan: cpiro will test it?

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666422 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_alterl_generator.cc

index f3d661f..f27670f 100644 (file)
@@ -490,6 +490,15 @@ void t_alterl_generator::generate_service_interface(t_service* tservice) {
     generate_function_info(tservice, *f_iter);
   }
 
+  // Inheritance - pass unknown functions to base class
+  if (tservice->get_extends() != NULL) {
+      indent(f_service_) << "function_info(Function, InfoType) ->" << endl;
+      indent_up();
+      indent(f_service_) << uncapitalize(tservice->get_extends()->get_name())
+                         << "_thrift:function_info(Function, InfoType);" << endl;
+      indent_down();
+  }
+
   // Dummy function_info so we don't worry about the ;s
   indent(f_service_) << "function_info(xxx, dummy) -> dummy." << endl;