Adds proper access types for swift object api & flatbuffers & grpc (#6081)

Fixes accessor in greeter.swift

Small fix for ci
This commit is contained in:
mustiikhalil
2020-08-22 22:39:09 +03:00
committed by GitHub
parent f3003e08d0
commit eeacc53d22
10 changed files with 257 additions and 222 deletions

View File

@@ -59,17 +59,21 @@ 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.
// 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::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::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; }
@@ -117,9 +121,14 @@ class FlatBufService : public grpc_generator::Service {
return service_->doc_comment;
}
std::vector<grpc::string> namespace_parts() const { return service_->defined_namespace->components; }
std::vector<grpc::string> namespace_parts() const {
return service_->defined_namespace->components;
}
std::string name() const { return service_->name; }
bool is_internal() const {
return service_->Definition::attributes.Lookup("private") ? true : false;
}
int method_count() const {
return static_cast<int>(service_->calls.vec.size());