GenInterfaceDelegatorSerializer(stream, id, decl);
GenInterfaceDelegatorDeserializer(stream, id, decl);
GenInterfaceDelegatorConstructor(stream, id, decl);
+ GenInterfaceDelegatorDestructor(stream, id, decl);
GenInterfaceDelegatorDisposer(stream, id, decl);
GenInterfaceDelegatorInvoker(stream, id, decl);
}
}));
}
+void CProxyBodyGen::GenInterfaceDelegatorDestructor(
+ std::ofstream& stream, const std::string& id, const Declaration& decl) {
+ stream << SmartIndent(ReplaceAll(
+ CB_DELEGATE_DTOR, "##", id + "_" + decl.GetID()));
+}
+
void CProxyBodyGen::GenInterfaceDelegatorTable(std::ofstream& stream,
const Interface& inf) {
const char block[] =
void GenInterfaceDelegatorInvoker(std::ofstream& stream,
const std::string& id,
const Declaration& decl);
+ void GenInterfaceDelegatorDestructor(std::ofstream& stream,
+ const std::string& id,
+ const Declaration& decl);
private:
std::string GetMethodWriteString(const Interface& inf,
}
)__c_cb";
+const char CB_DELEGATE_DTOR[] =
+R"__c_cb(
+int rpc_port_proxy_##_destroy(rpc_port_##_h delegate)
+{
+ if (!delegate) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ free(delegate);
+
+ return 0;
+}
+)__c_cb";
+
const char CB_DELEGATE_INVOKER[] =
R"__c_cb(
static void __$$_delegate_$$(GList **list, rpc_port_parcel_h parcel, int seq_id, int id)
});
stream << ReplaceAll(CB_DELEGATE_CTOR, "##", id + "_" + decl.GetID());
+ stream << ReplaceAll(CB_DELEGATE_DTOR, "##", id + "_" + decl.GetID());
stream << GenTemplateString(
ReplaceAll(CB_DELEGATE_DISPOSER, "##", id + "_" + decl.GetID()),
[&]()->std::string {
int rpc_port_proxy_##_dispose(rpc_port_proxy_$$_h proxy, rpc_port_##_h delegate);
)__c_cb";
+const char CB_DELEGATE_DTOR[] =
+R"__c_cb(
+int rpc_port_##_destroy(rpc_port_##_h delegate);
+)__c_cb";
+
#endif // IDLC_C_GEN_C_PROXY_HEADER_GEN_CB_H_