void CBodyGeneratorBase::AddParameterType(
std::shared_ptr<ParameterType> param_type) {
- if (param_type->GetBaseType().GetUserDefinedType() == BaseType::UserType::ENUM)
+ auto& type = param_type->GetBaseType();
+ if (type.GetUserDefinedType() == BaseType::UserType::ENUM)
return;
std::string key = param_type->GetBaseType().GetFullName(true) +
std::to_string(static_cast<int>(param_type->GetDirection()));
-
key = GetEnumTypeString(key);
-
if (param_types_.find(key) != param_types_.end())
return;
if (decl->GetMethodType() == Declaration::MethodType::DELEGATE) {
AddParameterType(iface, type, ParameterType::Direction::OUT);
} else {
- AddParameterType(iface, type,
- param->GetParameterType().GetDirection());
+ auto direction = param->GetParameterType().GetDirection();
+ if (direction == ParameterType::Direction::REF) {
+ AddParameterType(iface, type,
+ ParameterType::Direction::IN);
+ AddParameterType(iface, type,
+ ParameterType::Direction::OUT);
+ } else {
+ AddParameterType(iface, type,
+ param->GetParameterType().GetDirection());
+ }
}
}
<PREFIX>_<NAME>_<DELEGATE_NAME>_h handle;
GList *iter;
bool once;
- int ret;
+ int ret_;
<DELEGATE_ARGS_DECL>
<DELEGATE_UNIT_MAP_READ>
*/
constexpr const char CB_INTERFACE_DELEGATE_USER_DEFINED_UNIT_MAP_READ[] =
R"__c_cb(
-ret = rpc_port_unit_map_read_<TYPE_NAME>(map, "<ARG>", &<ARG>);
-if (ret != RPC_PORT_ERROR_NONE) {
- _E("Failed to read <TYPE_NAME>. error(%d)", ret);
+ret_ = rpc_port_unit_map_read_<TYPE_NAME>(map, "<ARG>", &<ARG>);
+if (ret_ != RPC_PORT_ERROR_NONE) {
+ _E("Failed to read <TYPE_NAME>. error(%d)", ret_);
goto out;
}
)__c_cb";
*/
constexpr const char CB_INTERFACE_DELEGATE_BUNDLE_UNIT_MAP_READ[] =
R"__c_cb(
-ret = rpc_port_unit_map_read_bundle(map, "<ARG>", &<ARG>);
-if (ret != RPC_PORT_ERROR_NONE) {
- _E("Failed to read bundle. error(%d)", ret);
+ret_ = rpc_port_unit_map_read_bundle(map, "<ARG>", &<ARG>);
+if (ret_ != RPC_PORT_ERROR_NONE) {
+ _E("Failed to read bundle. error(%d)", ret_);
goto out;
}
)__c_cb";
*/
constexpr const char CB_INTERFACE_DELEGATE_STRING_UNIT_MAP_READ[] =
R"__c_cb(
-ret = rpc_port_unit_map_read_string(map, "<ARG>", &<ARG>);
-if (ret != RPC_PORT_ERROR_NONE) {
- _E("Failed to read string. error(%d)", ret);
+ret_ = rpc_port_unit_map_read_string(map, "<ARG>", &<ARG>);
+if (ret_ != RPC_PORT_ERROR_NONE) {
+ _E("Failed to read string. error(%d)", ret_);
goto out;
}
)__c_cb";
*/
constexpr const char CB_INTERFACE_DELEGATE_ENUM_UNIT_MAP_READ[] =
R"__c_cb(
-ret = rpc_port_unit_map_read_int(map, "<ARG_NAME>", (int *)&<ARG>);
-if (ret != RPC_PORT_ERROR_NONE) {
- _E("Failed to read <TYPE_NAME>. error(%d)", ret);
+ret_ = rpc_port_unit_map_read_int(map, "<ARG_NAME>", (int *)&<ARG>);
+if (ret_ != RPC_PORT_ERROR_NONE) {
+ _E("Failed to read <TYPE_NAME>. error(%d)", ret_);
goto out;
}
)__c_cb";
*/
constexpr const char CB_INTERFACE_DELEGATE_BASE_UNIT_MAP_READ[] =
R"__c_cb(
-ret = rpc_port_unit_map_read_<TYPE_NAME>(map, "<ARG_NAME>", &<ARG>);
-if (ret != RPC_PORT_ERROR_NONE) {
- _E("Failed to read <TYPE_NAME>. error(%d)", ret);
+ret_ = rpc_port_unit_map_read_<TYPE_NAME>(map, "<ARG_NAME>", &<ARG>);
+if (ret_ != RPC_PORT_ERROR_NONE) {
+ _E("Failed to read <TYPE_NAME>. error(%d)", ret_);
goto out;
}
)__c_cb";