summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLiu Liu <i@liuliu.me>2020-07-31 00:07:45 -0700
committerGitHub <noreply@github.com>2020-07-31 10:07:45 +0300
commita0fb30575c2425512ebc2757910d106e15114b58 (patch)
tree3ad5f378c2a01e3656c1eff0c1d42571c03a08dc /src
parent77c18c1d6980bb4f7119eb1b75753de95611a315 (diff)
downloadflatbuffers-a0fb30575c2425512ebc2757910d106e15114b58.tar.gz
flatbuffers-a0fb30575c2425512ebc2757910d106e15114b58.tar.bz2
flatbuffers-a0fb30575c2425512ebc2757910d106e15114b58.zip
[Swift] Append namespace for Swift Grpc implementation (#6049)
* [Swift] Append namespace for Swift Grpc implementation * Separate ServiceName from ServiceQualifiedName.
Diffstat (limited to 'src')
-rw-r--r--src/idl_gen_grpc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/idl_gen_grpc.cpp b/src/idl_gen_grpc.cpp
index 96560fff..a9d4d7df 100644
--- a/src/idl_gen_grpc.cpp
+++ b/src/idl_gen_grpc.cpp
@@ -59,12 +59,18 @@ class FlatBufMethod : public grpc_generator::Method {
std::string name() const { return method_->name; }
+ // TODO: This method need to incorporate namespace for C++ side. Other language bindings
+ // simply don't use this method.
std::string GRPCType(const StructDef &sd) const {
return "flatbuffers::grpc::Message<" + sd.name + ">";
}
+ std::vector<std::string> get_input_namespace_parts() const { return (*method_->request).defined_namespace->components; }
+
std::string get_input_type_name() const { return (*method_->request).name; }
+ std::vector<std::string> get_output_namespace_parts() const { return (*method_->response).defined_namespace->components; }
+
std::string get_output_type_name() const { return (*method_->response).name; }
bool get_module_and_message_path_input(grpc::string * /*str*/,
@@ -111,6 +117,8 @@ class FlatBufService : public grpc_generator::Service {
return service_->doc_comment;
}
+ std::vector<grpc::string> namespace_parts() const { return service_->defined_namespace->components; }
+
std::string name() const { return service_->name; }
int method_count() const {