THRIFT-805. cocoa: Don't generate process_XXXX methods for oneway methods
authorBryan Duxbury <bryanduxbury@apache.org>
Thu, 2 Sep 2010 00:43:16 +0000 (00:43 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Thu, 2 Sep 2010 00:43:16 +0000 (00:43 +0000)
Patch: Brad Taylor

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

compiler/cpp/src/generate/t_cocoa_generator.cc

index 64c2939..57a753b 100644 (file)
@@ -1149,7 +1149,11 @@ void t_cocoa_generator::generate_cocoa_service_helpers(t_service* tservice) {
 }
 
 string t_cocoa_generator::function_result_helper_struct_type(t_function* tfunction) {
-  return capitalize(tfunction->get_name()) + "_result";
+  if (tfunction->is_oneway()) {
+    return capitalize(tfunction->get_name());
+  } else {
+    return capitalize(tfunction->get_name()) + "_result";
+  }
 }
 
 
@@ -1541,6 +1545,9 @@ void t_cocoa_generator::generate_cocoa_service_server_implementation(ofstream& o
   // generate a process_XXXX method for each service function, which reads args, calls the service, and writes results
   functions = tservice->get_functions();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
+    if ((*f_iter)->is_oneway()) {
+        continue;
+    }
     out << endl;
     string funname = (*f_iter)->get_name();
     out << indent() << "- (void) process_" << funname << "_withSequenceID: (int32_t) seqID inProtocol: (id<TProtocol>) inProtocol outProtocol: (id<TProtocol>) outProtocol" << endl;