Advertisement
johngriswold

thrift-0.8-generator

May 9th, 2012
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.29 KB | None | 0 0
  1. --- t_cpp_generator.cc.bak 2011-11-26 14:00:48.000000000 -0500
  2. +++ t_cpp_generator.cc 2012-05-09 11:01:58.000000000 -0400
  3. @@ -2696,7 +2696,7 @@
  4. f_header_ <<
  5. indent() << "boost::shared_ptr<" << if_name_ << "> iface_;" << endl;
  6. f_header_ <<
  7. - indent() << "virtual " << ret_type_ << "process_fn(" << finish_cob_ << "apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid" << call_context_ << ");" << endl;
  8. + indent() << "virtual " << ret_type_ << "process_fn(" << finish_cob_ << "::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid" << call_context_ << ");" << endl;
  9. indent_down();
  10.  
  11. // Process function declarations
  12. @@ -2706,12 +2706,12 @@
  13. f_header_ <<
  14. indent() << "std::map<std::string, void (" <<
  15. class_name_ << "::*)(" << finish_cob_decl_ <<
  16. - "int32_t, apache::thrift::protocol::TProtocol*, " <<
  17. - "apache::thrift::protocol::TProtocol*" << call_context_decl_ <<
  18. + "int32_t, ::apache::thrift::protocol::TProtocol*, " <<
  19. + "::apache::thrift::protocol::TProtocol*" << call_context_decl_ <<
  20. ")> processMap_;" << endl;
  21. for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
  22. indent(f_header_) <<
  23. - "void process_" << (*f_iter)->get_name() << "(" << finish_cob_ << "int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot" << call_context_ << ");" << endl;
  24. + "void process_" << (*f_iter)->get_name() << "(" << finish_cob_ << "int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot" << call_context_ << ");" << endl;
  25. if (generator_->gen_templates_) {
  26. indent(f_header_) <<
  27. "void process_" << (*f_iter)->get_name() << "(" << finish_cob_ <<
  28. @@ -2738,8 +2738,8 @@
  29. f_header_ <<
  30. indent() << "void throw_" << (*f_iter)->get_name() <<
  31. "(std::tr1::function<void(bool ok)> cob, int32_t seqid, " <<
  32. - "apache::thrift::protocol::TProtocol* oprot, void* ctx, " <<
  33. - "apache::thrift::TDelayedException* _throw);" << endl;
  34. + "::apache::thrift::protocol::TProtocol* oprot, void* ctx, " <<
  35. + "::apache::thrift::TDelayedException* _throw);" << endl;
  36. if (generator_->gen_templates_) {
  37. f_header_ <<
  38. indent() << "void throw_" << (*f_iter)->get_name() <<
  39. @@ -2783,7 +2783,7 @@
  40. declare_map <<
  41. indent() << "}" << endl <<
  42. endl <<
  43. - indent() << "virtual " << ret_type_ << "process(" << finish_cob_ << "boost::shared_ptr<apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr<apache::thrift::protocol::TProtocol> poprot" << call_context_ << ");" << endl <<
  44. + indent() << "virtual " << ret_type_ << "process(" << finish_cob_ << "boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot" << call_context_ << ");" << endl <<
  45. indent() << "virtual ~" << class_name_ <<
  46. "() {}" << endl;
  47. indent_down();
  48. @@ -2802,7 +2802,7 @@
  49. // template parameter here.
  50. f_header_ <<
  51. "typedef " << class_name_ <<
  52. - "<apache::thrift::protocol::TDummyProtocol> " <<
  53. + "< ::apache::thrift::protocol::TDummyProtocol> " <<
  54. service_name_ << pstyle_ << "Processor;" << endl << endl;
  55. }
  56. }
  57. @@ -2812,8 +2812,8 @@
  58. template_header_ <<
  59. ret_type_ << class_name_ <<
  60. template_suffix_ << "::process(" << finish_cob_ <<
  61. - "boost::shared_ptr<apache::thrift::protocol::TProtocol> piprot, " <<
  62. - "boost::shared_ptr<apache::thrift::protocol::TProtocol> poprot" <<
  63. + "boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, " <<
  64. + "boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot" <<
  65. call_context_ << ") {" << endl;
  66. indent_up();
  67.  
  68. @@ -2855,8 +2855,8 @@
  69. template_header_ <<
  70. ret_type_ << class_name_ <<
  71. template_suffix_ << "::process_fn(" << finish_cob_ <<
  72. - "apache::thrift::protocol::TProtocol* iprot, " <<
  73. - "apache::thrift::protocol::TProtocol* oprot, " <<
  74. + " ::apache::thrift::protocol::TProtocol* iprot, " <<
  75. + " ::apache::thrift::protocol::TProtocol* oprot, " <<
  76. "std::string& fname, int32_t seqid" << call_context_ << ") {" << endl;
  77. indent_up();
  78.  
  79. @@ -2864,13 +2864,13 @@
  80. f_out_ <<
  81. indent() << typename_str_ << "std::map<std::string, void (" <<
  82. class_name_ << "::*)(" << finish_cob_decl_ <<
  83. - "int32_t, apache::thrift::protocol::TProtocol*, " <<
  84. - "apache::thrift::protocol::TProtocol*" << call_context_decl_ << ")>::iterator pfn;" << endl <<
  85. + "int32_t, ::apache::thrift::protocol::TProtocol*, " <<
  86. + "::apache::thrift::protocol::TProtocol*" << call_context_decl_ << ")>::iterator pfn;" << endl <<
  87. indent() << "pfn = processMap_.find(fname);" << endl <<
  88. indent() << "if (pfn == processMap_.end()) {" << endl;
  89. if (extends_.empty()) {
  90. f_out_ <<
  91. - indent() << " iprot->skip(apache::thrift::protocol::T_STRUCT);" << endl <<
  92. + indent() << " iprot->skip(::apache::thrift::protocol::T_STRUCT);" << endl <<
  93. indent() << " iprot->readMessageEnd();" << endl <<
  94. indent() << " iprot->getTransport()->readEnd();" << endl <<
  95. indent() << " ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, \"Invalid method name: '\"+fname+\"'\");" << endl <<
  96. @@ -3109,7 +3109,7 @@
  97. indent() << " ctx = this->eventHandler_->getContext(\"" <<
  98. service_func_name << "\", callContext);" << endl <<
  99. indent() << "}" << endl <<
  100. - indent() << "apache::thrift::TProcessorContextFreer freer(" <<
  101. + indent() << " ::apache::thrift::TProcessorContextFreer freer(" <<
  102. "this->eventHandler_.get(), ctx, \"" << service_func_name << "\");" <<
  103. endl << endl <<
  104. indent() << "if (this->eventHandler_.get() != NULL) {" << endl <<
  105. @@ -3202,10 +3202,10 @@
  106. if (!tfunction->is_oneway()) {
  107. out <<
  108. endl <<
  109. - indent() << "apache::thrift::TApplicationException x(e.what());" <<
  110. + indent() << " ::apache::thrift::TApplicationException x(e.what());" <<
  111. endl <<
  112. indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() <<
  113. - "\", apache::thrift::protocol::T_EXCEPTION, seqid);" << endl <<
  114. + "\", ::apache::thrift::protocol::T_EXCEPTION, seqid);" << endl <<
  115. indent() << "x.write(oprot);" << endl <<
  116. indent() << "oprot->writeMessageEnd();" << endl <<
  117. indent() << "oprot->getTransport()->writeEnd();" << endl <<
  118. @@ -3236,7 +3236,7 @@
  119. service_func_name << "\");" << endl <<
  120. indent() << "}" << endl << endl <<
  121. indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() <<
  122. - "\", apache::thrift::protocol::T_REPLY, seqid);" << endl <<
  123. + "\", ::apache::thrift::protocol::T_REPLY, seqid);" << endl <<
  124. indent() << "result.write(oprot);" << endl <<
  125. indent() << "oprot->writeMessageEnd();" << endl <<
  126. indent() << "bytes = oprot->getTransport()->writeEnd();" << endl <<
  127. @@ -3298,7 +3298,7 @@
  128. indent() << " ctx = this->eventHandler_->getContext(\"" <<
  129. service_func_name << "\", NULL);" << endl <<
  130. indent() << "}" << endl <<
  131. - indent() << "apache::thrift::TProcessorContextFreer freer(" <<
  132. + indent() << " ::apache::thrift::TProcessorContextFreer freer(" <<
  133. "this->eventHandler_.get(), ctx, \"" << service_func_name << "\");" <<
  134. endl << endl <<
  135. indent() << "try {" << endl;
  136. @@ -3452,7 +3452,7 @@
  137. indent() << " ctx = this->eventHandler_->getContext(\"" <<
  138. service_func_name << "\", NULL);" << endl <<
  139. indent() << "}" << endl <<
  140. - indent() << "apache::thrift::TProcessorContextFreer freer(" <<
  141. + indent() << " ::apache::thrift::TProcessorContextFreer freer(" <<
  142. "this->eventHandler_.get(), ctx, \"" << service_func_name <<
  143. "\");" << endl << endl <<
  144. indent() << "if (this->eventHandler_.get() != NULL) {" << endl <<
  145. @@ -3460,7 +3460,7 @@
  146. service_func_name << "\");" << endl <<
  147. indent() << "}" << endl << endl <<
  148. indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() <<
  149. - "\", apache::thrift::protocol::T_REPLY, seqid);" << endl <<
  150. + "\", ::apache::thrift::protocol::T_REPLY, seqid);" << endl <<
  151. indent() << "result.write(oprot);" << endl <<
  152. indent() << "oprot->writeMessageEnd();" << endl <<
  153. indent() << "uint32_t bytes = oprot->getTransport()->writeEnd();" <<
  154. @@ -3510,7 +3510,7 @@
  155. indent() << " ctx = this->eventHandler_->getContext(\"" <<
  156. service_func_name << "\", NULL);" << endl <<
  157. indent() << "}" << endl <<
  158. - indent() << "apache::thrift::TProcessorContextFreer freer(" <<
  159. + indent() << " ::apache::thrift::TProcessorContextFreer freer(" <<
  160. "this->eventHandler_.get(), ctx, \"" << service_func_name << "\");" <<
  161. endl << endl;
  162.  
  163. @@ -3547,10 +3547,10 @@
  164. service_func_name << "\");" << endl <<
  165. indent() << "}" << endl <<
  166. endl <<
  167. - indent() << "apache::thrift::TApplicationException x(e.what());" <<
  168. + indent() << " ::apache::thrift::TApplicationException x(e.what());" <<
  169. endl <<
  170. indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() <<
  171. - "\", apache::thrift::protocol::T_EXCEPTION, seqid);" << endl <<
  172. + "\", ::apache::thrift::protocol::T_EXCEPTION, seqid);" << endl <<
  173. indent() << "x.write(oprot);" << endl <<
  174. indent() << "oprot->writeMessageEnd();" << endl <<
  175. indent() << "oprot->getTransport()->writeEnd();" << endl <<
  176. @@ -3568,7 +3568,7 @@
  177. service_func_name << "\");" << endl <<
  178. indent() << "}" << endl << endl <<
  179. indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() <<
  180. - "\", apache::thrift::protocol::T_REPLY, seqid);" << endl <<
  181. + "\", ::apache::thrift::protocol::T_REPLY, seqid);" << endl <<
  182. indent() << "result.write(oprot);" << endl <<
  183. indent() << "oprot->writeMessageEnd();" << endl <<
  184. indent() << "uint32_t bytes = oprot->getTransport()->writeEnd();" <<
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement