Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 3 | * Copyright 2015 gRPC authors. |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 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 |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame^] | 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. |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 16 | * |
| 17 | */ |
| 18 | |
Nicolas "Pixel" Noble | 1ff52d5 | 2015-03-01 05:24:36 +0100 | [diff] [blame] | 19 | #ifndef GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H |
| 20 | #define GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 21 | |
Masood Malekghassemi | 59d9ff4 | 2015-02-23 15:28:07 -0800 | [diff] [blame] | 22 | #include <utility> |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 23 | |
Masood Malekghassemi | 65c803b | 2015-03-20 06:48:47 -0700 | [diff] [blame] | 24 | #include "src/compiler/config.h" |
Harsh Vardhan | 5b8fa87 | 2016-09-12 20:37:42 +0530 | [diff] [blame] | 25 | #include "src/compiler/schema_interface.h" |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 26 | |
| 27 | namespace grpc_python_generator { |
| 28 | |
Masood Malekghassemi | 3bb5215 | 2015-03-17 21:52:52 -0700 | [diff] [blame] | 29 | // Data pertaining to configuration of the generator with respect to anything |
| 30 | // that may be used internally at Google. |
| 31 | struct GeneratorConfiguration { |
Masood Malekghassemi | 71448b2 | 2016-06-29 11:41:24 -0700 | [diff] [blame] | 32 | GeneratorConfiguration(); |
Nathaniel Manista | 4547940 | 2016-06-13 20:14:18 +0000 | [diff] [blame] | 33 | grpc::string grpc_package_root; |
Nathaniel Manista | 40d55f9 | 2017-03-14 00:01:35 +0000 | [diff] [blame] | 34 | // TODO(https://github.com/grpc/grpc/issues/8622): Drop this. |
Nathaniel Manista | cd9ec0e | 2015-08-31 07:49:45 +0000 | [diff] [blame] | 35 | grpc::string beta_package_root; |
Nathaniel Manista | 40d55f9 | 2017-03-14 00:01:35 +0000 | [diff] [blame] | 36 | // TODO(https://github.com/google/protobuf/issues/888): Drop this. |
| 37 | grpc::string import_prefix; |
Masood Malekghassemi | 3bb5215 | 2015-03-17 21:52:52 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
Masood Malekghassemi | 65c803b | 2015-03-20 06:48:47 -0700 | [diff] [blame] | 40 | class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { |
Masood Malekghassemi | 3bb5215 | 2015-03-17 21:52:52 -0700 | [diff] [blame] | 41 | public: |
| 42 | PythonGrpcGenerator(const GeneratorConfiguration& config); |
| 43 | ~PythonGrpcGenerator(); |
| 44 | |
Masood Malekghassemi | 65c803b | 2015-03-20 06:48:47 -0700 | [diff] [blame] | 45 | bool Generate(const grpc::protobuf::FileDescriptor* file, |
| 46 | const grpc::string& parameter, |
| 47 | grpc::protobuf::compiler::GeneratorContext* context, |
| 48 | grpc::string* error) const; |
Masood Malekghassemi | ac59245 | 2016-07-01 11:58:04 -0700 | [diff] [blame] | 49 | |
Masood Malekghassemi | 3bb5215 | 2015-03-17 21:52:52 -0700 | [diff] [blame] | 50 | private: |
| 51 | GeneratorConfiguration config_; |
| 52 | }; |
| 53 | |
Masood Malekghassemi | f8e297a | 2015-02-19 15:39:32 -0800 | [diff] [blame] | 54 | } // namespace grpc_python_generator |
| 55 | |
Nicolas "Pixel" Noble | 1ff52d5 | 2015-03-01 05:24:36 +0100 | [diff] [blame] | 56 | #endif // GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H |