{#-
 # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 # Copyright (C) 2021  OpenCyphal Development Team  <opencyphal.org>
 # This software is distributed under the terms of the MIT License.
-#}
{%- extends "base.j2" %}
{%- block object -%}
namespace {{T|short_reference_name}}
{

{% set composite_type = T.request_type %}{% include '_composite_type.j2' %}

{% set composite_type = T.response_type %}{% include '_composite_type.j2' %}

}  // namespace {{T|short_reference_name}}

{% set service_name = '%s_%s_%s' | format(T|short_reference_name, T.version.major, T.version.minor) -%}
struct {{service_name}}
{
    {{service_name}}() = delete;

    using Request  = {{T|short_reference_name}}::{{ T.request_type | short_reference_name }};
    using Response = {{T|short_reference_name}}::{{ T.response_type | short_reference_name }};

    struct _traits_
    {
        _traits_() = delete;
{%- if T.has_fixed_port_id %}
        static constexpr bool HasFixedPortID = true;
        static constexpr {{ typename_unsigned_port }} FixedPortId = {{ T.fixed_port_id }}U;
{%- else %}
        static constexpr bool HasFixedPortID = false;
{%- endif %}

        static constexpr bool IsServiceType = true;
        static constexpr bool IsService = true;
        static constexpr bool IsRequest = false;
        static constexpr bool IsResponse = false;

        static constexpr const char* FullNameAndVersion() { return "{{ T }}"; }
    };
};

{%- endblock -%}
