[v1] utils: ipc: Do not duplicate signals in proxy object
diff mbox series

Message ID 20250415154818.398689-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v1] utils: ipc: Do not duplicate signals in proxy object
Related show

Commit Message

Barnabás Pőcze April 15, 2025, 3:48 p.m. UTC
The specific proxy type (see `module_ipa_proxy.h.tmpl`) inherits `IPAProxy`,
the specific interface type, and `Object`. The interface type already
provides public definitions of the necessary `Signal<>` objects (see
`module_ipa_interface.h.tmpl`), so do not duplicate them.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 .../libcamera_templates/module_ipa_proxy.h.tmpl          | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Kieran Bingham April 17, 2025, 8:37 a.m. UTC | #1
Quoting Barnabás Pőcze (2025-04-15 16:48:18)
> The specific proxy type (see `module_ipa_proxy.h.tmpl`) inherits `IPAProxy`,
> the specific interface type, and `Object`. The interface type already
> provides public definitions of the necessary `Signal<>` objects (see
> `module_ipa_interface.h.tmpl`), so do not duplicate them.

This sounds like a good thing - but reviewing the IPA templates is
really hard for me.

Paul - can you review this please?

--
Kieran

> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  .../libcamera_templates/module_ipa_proxy.h.tmpl          | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> index e213b18a0..a0312a7c1 100644
> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> @@ -44,15 +44,6 @@ public:
>  {{proxy_funcs.func_sig(proxy_name, method, "", false, true)|indent(8, true)}};
>  {% endfor %}
>  
> -{%- for method in interface_event.methods %}
> -       Signal<
> -{%- for param in method.parameters -%}
> -               {{"const " if not param|is_pod}}{{param|name}}{{" &" if not param|is_pod and not param|is_enum}}
> -               {{- ", " if not loop.last}}
> -{%- endfor -%}
> -> {{method.mojom_name}};
> -{% endfor %}
> -
>  private:
>         void recvMessage(const IPCMessage &data);
>  
> -- 
> 2.49.0
>
Paul Elder April 18, 2025, 7:38 a.m. UTC | #2
Hi Barnabás,

Thanks for the patch.

On Tue, Apr 15, 2025 at 05:48:18PM +0200, Barnabás Pőcze wrote:
> The specific proxy type (see `module_ipa_proxy.h.tmpl`) inherits `IPAProxy`,
> the specific interface type, and `Object`. The interface type already
> provides public definitions of the necessary `Signal<>` objects (see
> `module_ipa_interface.h.tmpl`), so do not duplicate them.

Good catch.

> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  .../libcamera_templates/module_ipa_proxy.h.tmpl          | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> index e213b18a0..a0312a7c1 100644
> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
> @@ -44,15 +44,6 @@ public:
>  {{proxy_funcs.func_sig(proxy_name, method, "", false, true)|indent(8, true)}};
>  {% endfor %}
>  
> -{%- for method in interface_event.methods %}
> -	Signal<
> -{%- for param in method.parameters -%}
> -		{{"const " if not param|is_pod}}{{param|name}}{{" &" if not param|is_pod and not param|is_enum}}
> -		{{- ", " if not loop.last}}
> -{%- endfor -%}
> -> {{method.mojom_name}};
> -{% endfor %}
> -
>  private:
>  	void recvMessage(const IPCMessage &data);
>  
> -- 
> 2.49.0
>

Patch
diff mbox series

diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
index e213b18a0..a0312a7c1 100644
--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl
@@ -44,15 +44,6 @@  public:
 {{proxy_funcs.func_sig(proxy_name, method, "", false, true)|indent(8, true)}};
 {% endfor %}
 
-{%- for method in interface_event.methods %}
-	Signal<
-{%- for param in method.parameters -%}
-		{{"const " if not param|is_pod}}{{param|name}}{{" &" if not param|is_pod and not param|is_enum}}
-		{{- ", " if not loop.last}}
-{%- endfor -%}
-> {{method.mojom_name}};
-{% endfor %}
-
 private:
 	void recvMessage(const IPCMessage &data);