/*
* This file was automatically generated using Avlos.
* https://github.com/tinymovr/avlos
*
* Any changes to this file will be overwritten when
* content is regenerated.
*/

#pragma once

#include <{{ helper_file | file_from_path }}>

{%- if instance.remote_attributes %}
    {%- for attr in instance.remote_attributes.values() %}
        {%- if attr.remote_attributes %}
#include <{{attr.name}}.hpp>
        {%- endif %}
    {%- endfor %}
{%- endif %}

class {{ instance.name | capitalize_first }}_ : Node
{
    public:

        {{ instance.name | capitalize_first }}_(uint8_t _can_node_id, send_callback _send_cb, recv_callback _recv_cb, delay_us_callback _delay_us_cb, uint32_t _delay_us_value):
            Node(_can_node_id, _send_cb, _recv_cb, _delay_us_cb, _delay_us_value) 
{%- if instance.remote_attributes %}
    {%- for attr in instance.remote_attributes.values() %}
        {%- if attr.remote_attributes %}
            , {{attr.name}}(_can_node_id, _send_cb, _recv_cb, _delay_us_cb, _delay_us_value)
        {%- endif %}
    {%- endfor %}
{%- endif %} {};

    {%- if instance.remote_attributes %}
        {%- for attr in instance.remote_attributes.values() %}
            {%- if attr.remote_attributes %}
        {{attr.name | capitalize_first}}_ {{attr.name}};

            {%- elif attr.getter_name %}
                    {%- if attr.dtype.c_name == "char[]" %}
        void get_{{attr.name}}(char out_value[]);
                    {%- else %}
        {{attr.dtype.c_name}} get_{{attr.name}}(void);
                    {%- endif %}
            {%- endif %}
            {%- if attr.setter_name %}
                    {%- if attr.dtype.c_name == "char[]" %}
        void set_{{attr.name}}(char value[]);
                    {%- else %}
        void set_{{attr.name}}({{attr.dtype.c_name}} value);
                    {%- endif %}
            {%- endif %}
            {%- if attr.caller_name %}
                {%- set comma = joiner(", ") %}
        {{attr.dtype.c_name}} {{attr.name}}({%- for arg in attr.arguments %}{{ comma() }}{{arg.dtype.c_name}} {{ arg.name }} {%- endfor %});
            {%- endif %}
        
        {%- endfor %}
    {%- endif %}

};
