#include "src/compiler/cpp_generator.h"
#include <map>
#include <sstream>
#include "flatbuffers/util.h"
namespace grpc_cpp_generator {
namespace {
template<class T>
static grpc::string as_string(T x) { … }
static inline bool ClientOnlyStreaming(const grpc_generator::Method *method) { … }
static inline bool ServerOnlyStreaming(const grpc_generator::Method *method) { … }
static grpc::string FilenameIdentifier(const grpc::string &filename) { … }
template<class T, size_t N>
static T *array_end(T (&array)[N]) { … }
static void PrintIncludes(grpc_generator::Printer *printer,
const std::vector<grpc::string> &headers,
const Parameters ¶ms) { … }
}
grpc::string GetHeaderPrologue(grpc_generator::File *file,
const Parameters ¶ms) { … }
grpc::string GetHeaderIncludes(grpc_generator::File *file,
const Parameters ¶ms) { … }
namespace {
static void PrintHeaderClientMethodInterfaces(
grpc_generator::Printer *printer, const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars, bool is_public) { … }
static void PrintHeaderClientMethod(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars,
bool is_public) { … }
static void PrintHeaderClientMethodData(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintHeaderServerMethodSync(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintHeaderServerMethodAsync(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintHeaderServerMethodStreamedUnary(
grpc_generator::Printer *printer, const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintHeaderServerMethodSplitStreaming(
grpc_generator::Printer *printer, const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintHeaderServerMethodGeneric(
grpc_generator::Printer *printer, const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintHeaderService(grpc_generator::Printer *printer,
const grpc_generator::Service *service,
std::map<grpc::string, grpc::string> *vars) { … }
}
grpc::string GetHeaderServices(grpc_generator::File *file,
const Parameters ¶ms) { … }
grpc::string GetHeaderEpilogue(grpc_generator::File *file,
const Parameters & ) { … }
grpc::string GetSourcePrologue(grpc_generator::File *file,
const Parameters ¶ms) { … }
grpc::string GetSourceIncludes(grpc_generator::File *file,
const Parameters ¶ms) { … }
namespace {
static void PrintSourceClientMethod(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintSourceServerMethod(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintSourceService(grpc_generator::Printer *printer,
const grpc_generator::Service *service,
std::map<grpc::string, grpc::string> *vars) { … }
}
grpc::string GetSourceServices(grpc_generator::File *file,
const Parameters ¶ms) { … }
grpc::string GetSourceEpilogue(grpc_generator::File *file,
const Parameters & ) { … }
grpc::string GetMockPrologue(grpc_generator::File *file,
const Parameters ¶ms) { … }
grpc::string GetMockIncludes(grpc_generator::File *file,
const Parameters ¶ms) { … }
namespace {
static void PrintMockClientMethods(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) { … }
static void PrintMockService(grpc_generator::Printer *printer,
const grpc_generator::Service *service,
std::map<grpc::string, grpc::string> *vars) { … }
}
grpc::string GetMockServices(grpc_generator::File *file,
const Parameters ¶ms) { … }
grpc::string GetMockEpilogue(grpc_generator::File *file,
const Parameters & ) { … }
}