Message ID | 20250806154842.597155-2-barnabas.pocze@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Quoting Barnabás Pőcze (2025-08-07 00:48:41) > Default the copy/move constructor/assignment operators so that > they are available if possible. This can allow more efficient > passing and construction of these objects. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > .../libcamera_templates/definition_functions.tmpl | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl b/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl > index 16d11c309..3a57a3c2c 100644 > --- a/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl > +++ b/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl > @@ -39,6 +39,12 @@ public: > {%- endfor %} > { > } > + > + {{struct.mojom_name}}(const {{struct.mojom_name}} &) = default; > + {{struct.mojom_name}} &operator=(const {{struct.mojom_name}} &) = default; > + {{struct.mojom_name}}({{struct.mojom_name}} &&) = default; > + {{struct.mojom_name}} &operator=({{struct.mojom_name}} &&) = default; > + ~{{struct.mojom_name}}() = default; > #endif > > {% for field in struct.fields %} > -- > 2.50.1 >
diff --git a/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl b/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl index 16d11c309..3a57a3c2c 100644 --- a/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl +++ b/utils/codegen/ipc/generators/libcamera_templates/definition_functions.tmpl @@ -39,6 +39,12 @@ public: {%- endfor %} { } + + {{struct.mojom_name}}(const {{struct.mojom_name}} &) = default; + {{struct.mojom_name}} &operator=(const {{struct.mojom_name}} &) = default; + {{struct.mojom_name}}({{struct.mojom_name}} &&) = default; + {{struct.mojom_name}} &operator=({{struct.mojom_name}} &&) = default; + ~{{struct.mojom_name}}() = default; #endif {% for field in struct.fields %}
Default the copy/move constructor/assignment operators so that they are available if possible. This can allow more efficient passing and construction of these objects. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- .../libcamera_templates/definition_functions.tmpl | 6 ++++++ 1 file changed, 6 insertions(+)