#include "src/compiler/python_generator.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <sstream>
#include <tuple>
#include <vector>
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/protobuf_plugin.h"
#include "src/compiler/python_generator_helpers.h"
#include "src/compiler/python_private_generator.h"
FileDescriptor;
GeneratorContext;
CodedOutputStream;
ZeroCopyOutputStream;
make_pair;
map;
pair;
replace;
set;
tuple;
vector;
namespace grpc_python_generator {
std::string generator_file_name;
namespace {
StringMap;
StringVector;
StringPair;
StringPairSet;
class IndentScope { … };
PrivateGenerator::PrivateGenerator(const GeneratorConfiguration& config,
const grpc_generator::File* file)
: … { … }
void PrivateGenerator::PrintAllComments(StringVector comments,
grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintBetaServicer(const grpc_generator::Service* service,
grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintBetaStub(const grpc_generator::Service* service,
grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintBetaServerFactory(
const std::string& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintBetaStubFactory(
const std::string& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintStub(
const std::string& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintServicer(const grpc_generator::Service* service,
grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintAddServicerToServer(
const std::string& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintServiceClass(
const std::string& package_qualified_service_name,
const grpc_generator::Service* service, grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintBetaPreamble(grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintPreamble(grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintGAServices(grpc_generator::Printer* out) { … }
bool PrivateGenerator::PrintBetaServices(grpc_generator::Printer* out) { … }
pair<bool, std::string> PrivateGenerator::GetGrpcServices() { … }
}
GeneratorConfiguration::GeneratorConfiguration()
: … { … }
PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config)
: … { … }
PythonGrpcGenerator::~PythonGrpcGenerator() { … }
static bool GenerateGrpc(GeneratorContext* context, PrivateGenerator& generator,
std::string file_name, bool generate_in_pb2_grpc) { … }
static bool ParseParameters(const std::string& parameter,
std::string* grpc_version,
std::vector<std::string>* strip_prefixes,
std::string* error) { … }
uint64_t PythonGrpcGenerator::GetSupportedFeatures() const { … }
bool PythonGrpcGenerator::Generate(const FileDescriptor* file,
const std::string& parameter,
GeneratorContext* context,
std::string* error) const { … }
}