});
for (const auto& i : iface.GetDeclarations()) {
- if (i->GetMethodType() == Declaration::MethodType::DELEGATE ||
- i->GetMethodType() == Declaration::MethodType::SYNC)
- continue;
stream << Tab(2) << "case static_cast<int>(MethodId::"
<< i->GetID() << "): ";
GenBrace(stream, TAB_SIZE * 2, [&]() {
auto& decls = iface.GetDeclarations();
for (const auto& i : decls) {
- if (i->GetMethodType() == Declaration::MethodType::DELEGATE)
- continue;
-
GenDeclaration(stream, iface, *i);
GenBrace(stream, 0, [&]() {
GenInvocation(stream, *i);
<< "rpc_port_parcel_write_int32(p, static_cast<int>(MethodId::"
<< decl.GetID() << "));" << NLine(1);
std::string m;
- std::string l;
for (const auto& i : decl.GetParameters()) {
auto& pt = i->GetParameterType();
m += ConvertTypeToSerializer(pt.GetBaseType(), i->GetID(), "p");
- if (IsDelegateType(pt.GetBaseType())) {
- l += "delegate_list_.emplace_back(" + i->GetID() + ".release());\n";
- }
}
stream << AddIndent(TAB_SIZE, m) << NLine(1);
GenBrace(stream, TAB_SIZE, [&]() {
stream << Tab(2) << "std::lock_guard<std::recursive_mutex> lock(mutex_);"
<< NLine(2);
- if (!l.empty())
- stream << AddIndent(TAB_SIZE * 2, l);
- else if (decl.GetMethodType() == Declaration::MethodType::ASYNC)
- stream << ReplaceAll(CB_INVOCATION_ASYNC_MID, {
- { "<PAYLOAD_T>", GetTransportable().Cpp().GenPayloadType() },
- { "<GROUP_PUBLISH>", GetTransportable().Cpp().GenGroupPublish() }
- }) << NLine(1);
+ stream << ReplaceAll(CB_INVOCATION_ASYNC_MID, {
+ { "<PAYLOAD_T>", GetTransportable().Cpp().GenPayloadType() },
+ { "<GROUP_PUBLISH>", GetTransportable().Cpp().GenGroupPublish() }
+ }) << NLine(1);
}, false, false);
stream << " while (false);" << NLine(1);
- if (decl.GetMethodType() == Declaration::MethodType::ASYNC) {
- stream << Tab(1) << "rpc_port_parcel_destroy(p);"
- << NLine(1);
- return;
- }
-
- stream << CB_INVOCATION_END;
+ stream << Tab(1) << "rpc_port_parcel_destroy(p);"
+ << NLine(1);
}
} // namespace tidl