Re: [protobuf] Disabling the 'gen_cpp' output of Services?

2010-03-11 Thread Andrew Kimpton
On Wed, Mar 10, 2010 at 8:50 PM, Kenton Varda ken...@google.com wrote: Note that to write your plugin, you do *not* have to copy the CppGenerator sources. Instead, write your plugin to use output_directory-OpenForInsert() to insert additional code into what the C++ code generator already

Re: [protobuf] Disabling the 'gen_cpp' output of Services?

2010-03-11 Thread Kenton Varda
On the first call to your descriptor() or GetDescriptor() method, you could look up the ServiceDescriptor in google::protobuf::DescriptorPool::generated_pool(). Alternatively, we could add a (public) way to directly fetch the file's FileDescriptor, then your descriptor getter could simply return

Re: [protobuf] Disabling the 'gen_cpp' output of Services?

2010-03-11 Thread Andrew Kimpton
On Thu, Mar 11, 2010 at 2:27 PM, Kenton Varda ken...@google.com wrote: On the first call to your descriptor() or GetDescriptor() method, you could look up the ServiceDescriptor in google::protobuf::DescriptorPool::generated_pool(). I think that's what my generated code is essentially now

Re: [protobuf] Disabling the 'gen_cpp' output of Services?

2010-03-11 Thread Kenton Varda
Cool. If you like, feel free to propose a modification to the standard code generator which makes the file descriptor pointer directly accessible, so that you don't have to have the extra lookup step. On Thu, Mar 11, 2010 at 11:58 AM, Andrew Kimpton awkimp...@gmail.comwrote: On Thu, Mar 11,

Re: [protobuf] Disabling the 'gen_cpp' output of Services?

2010-03-10 Thread Jason Hsueh
In your .proto file, just specify the file-level option cc_generic_services = false. Comments from descriptor.proto: // Should generic services be generated in each language? Generic services // are not specific to any particular RPC system. They are generated by the // main code

Re: [protobuf] Disabling the 'gen_cpp' output of Services?

2010-03-10 Thread Kenton Varda
Note that to write your plugin, you do *not* have to copy the CppGenerator sources. Instead, write your plugin to use output_directory-OpenForInsert() to insert additional code into what the C++ code generator already generated. Specifically, you want to insert at the namespace_scope insertion