libcamera/utils/ipc/generators/libcamera_templates/definition_functions.tmpl
Umang Jain ff9276cc62 ipa: Move core IPA interface documentation to a .cpp file
Moving the core.mojom documentation to its corresponding .cpp file
(core_ipa_interface.cpp). This will allow Doxygen to generate the
documentation for IPABuffer, IPASettings and IPAStream structures.
Since the .mojom files are placed in include/ directory, the .cpp file
will live in $sourcedir/src/libcamera/ipa/ - which can also contain
documentation for other mojom generated IPA interfaces in subsequent
commit.

Also hide the constructors in generated IPA interface from doxygen,
via  #ifndef __DOXYGEN__. These constructors provide no major value in
documenting them, instead will spew out doxygen warnings during the
build.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-05-24 14:13:01 +03:00

56 lines
1.3 KiB
Cheetah

{#-
# SPDX-License-Identifier: LGPL-2.1-or-later
# Copyright (C) 2020, Google Inc.
-#}
{#
# \brief Generate enum definition
#
# \param enum Enum object whose definition is to be generated
#}
{%- macro define_enum(enum) -%}
enum {{enum.mojom_name}} {
{%- for field in enum.fields %}
{{field.mojom_name}} = {{field.numeric_value}},
{%- endfor %}
};
{%- endmacro -%}
{#
# \brief Generate struct definition
#
# \param struct Struct object whose definition is to be generated
#}
{%- macro define_struct(struct) -%}
struct {{struct.mojom_name}}
{
public:
#ifndef __DOXYGEN__
{{struct.mojom_name}}() {%- if struct|has_default_fields %}
:{% endif %}
{%- for field in struct.fields|with_default_values -%}
{{" " if loop.first}}{{field.mojom_name}}({{field|default_value}}){{", " if not loop.last}}
{%- endfor %}
{
}
{{struct.mojom_name}}(
{%- for field in struct.fields -%}
{{"const " if not field|is_pod}}{{field|name}} {{"&" if not field|is_pod}}_{{field.mojom_name}}{{", " if not loop.last}}
{%- endfor -%}
)
:
{%- for field in struct.fields -%}
{{" " if loop.first}}{{field.mojom_name}}(_{{field.mojom_name}}){{", " if not loop.last}}
{%- endfor %}
{
}
#endif
{% for field in struct.fields %}
{{field|name}} {{field.mojom_name}};
{%- endfor %}
};
{%- endmacro -%}