From: David Reiss Date: Wed, 11 Jun 2008 00:58:33 +0000 (+0000) Subject: Implement inheritance in the alterl generator X-Git-Tag: 0.2.0~739 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=1d8b75297176d810aa63b5f58f3269b8ddca133a;p=common%2Fthrift.git Implement inheritance in the alterl generator 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 --- diff --git a/compiler/cpp/src/generate/t_alterl_generator.cc b/compiler/cpp/src/generate/t_alterl_generator.cc index f3d661fb..f27670f1 100644 --- a/compiler/cpp/src/generate/t_alterl_generator.cc +++ b/compiler/cpp/src/generate/t_alterl_generator.cc @@ -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;