1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.
3 // http://code.google.com/p/protobuf/
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
17 // Author: kenton@google.com (Kenton Varda)
18 // Based on original Protocol Buffers design by
19 // Sanjay Ghemawat, Jeff Dean, and others.
21 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_SERVICE_H__
22 #define GOOGLE_PROTOBUF_COMPILER_JAVA_SERVICE_H__
25 #include <google/protobuf/descriptor.h>
30 class Printer
; // printer.h
38 class ServiceGenerator
{
40 explicit ServiceGenerator(const ServiceDescriptor
* descriptor
);
43 void Generate(io::Printer
* printer
);
46 // Generate the implementation of Service.callMethod().
47 void GenerateCallMethod(io::Printer
* printer
);
49 // Generate the implementations of Service.get{Request,Response}Prototype().
50 enum RequestOrResponse
{ REQUEST
, RESPONSE
};
51 void GenerateGetPrototype(RequestOrResponse which
, io::Printer
* printer
);
53 // Generate a stub implementation of the service.
54 void GenerateStub(io::Printer
* printer
);
56 const ServiceDescriptor
* descriptor_
;
58 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator
);
62 } // namespace compiler
63 } // namespace protobuf
65 #endif // NET_PROTO2_COMPILER_JAVA_SERVICE_H__