// generated from rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em
// with input from g29_msg:msg/G29Msg.idl
// generated code does not contain a copyright notice
#include "g29_msg/msg/detail/g29_msg__rosidl_typesupport_fastrtps_cpp.hpp"
#include "g29_msg/msg/detail/g29_msg__struct.hpp"

#include <limits>
#include <stdexcept>
#include <string>
#include "rosidl_typesupport_cpp/message_type_support.hpp"
#include "rosidl_typesupport_fastrtps_cpp/identifier.hpp"
#include "rosidl_typesupport_fastrtps_cpp/message_type_support.h"
#include "rosidl_typesupport_fastrtps_cpp/message_type_support_decl.hpp"
#include "rosidl_typesupport_fastrtps_cpp/wstring_conversion.hpp"
#include "fastcdr/Cdr.h"


// forward declaration of message dependencies and their conversion functions

namespace g29_msg
{

namespace msg
{

namespace typesupport_fastrtps_cpp
{

bool
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_g29_msg
cdr_serialize(
  const g29_msg::msg::G29Msg & ros_message,
  eprosima::fastcdr::Cdr & cdr)
{
  // Member: heartbeat
  cdr << ros_message.heartbeat;
  // Member: axis0
  cdr << ros_message.axis0;
  // Member: axis1
  cdr << ros_message.axis1;
  // Member: axis2
  cdr << ros_message.axis2;
  // Member: axis3
  cdr << ros_message.axis3;
  // Member: axis4
  cdr << ros_message.axis4;
  // Member: axis5
  cdr << ros_message.axis5;
  // Member: button0
  cdr << (ros_message.button0 ? true : false);
  // Member: button1
  cdr << (ros_message.button1 ? true : false);
  // Member: button2
  cdr << (ros_message.button2 ? true : false);
  // Member: button3
  cdr << (ros_message.button3 ? true : false);
  // Member: button4
  cdr << (ros_message.button4 ? true : false);
  // Member: button5
  cdr << (ros_message.button5 ? true : false);
  // Member: button6
  cdr << (ros_message.button6 ? true : false);
  // Member: button7
  cdr << (ros_message.button7 ? true : false);
  // Member: button8
  cdr << (ros_message.button8 ? true : false);
  // Member: button9
  cdr << (ros_message.button9 ? true : false);
  // Member: button10
  cdr << (ros_message.button10 ? true : false);
  // Member: button11
  cdr << (ros_message.button11 ? true : false);
  // Member: button12
  cdr << (ros_message.button12 ? true : false);
  // Member: button13
  cdr << (ros_message.button13 ? true : false);
  // Member: button14
  cdr << (ros_message.button14 ? true : false);
  // Member: button15
  cdr << (ros_message.button15 ? true : false);
  // Member: button16
  cdr << (ros_message.button16 ? true : false);
  // Member: button17
  cdr << (ros_message.button17 ? true : false);
  // Member: button18
  cdr << (ros_message.button18 ? true : false);
  // Member: button19
  cdr << (ros_message.button19 ? true : false);
  // Member: button20
  cdr << (ros_message.button20 ? true : false);
  // Member: button21
  cdr << (ros_message.button21 ? true : false);
  // Member: button22
  cdr << (ros_message.button22 ? true : false);
  // Member: button23
  cdr << (ros_message.button23 ? true : false);
  // Member: button24
  cdr << (ros_message.button24 ? true : false);
  return true;
}

bool
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_g29_msg
cdr_deserialize(
  eprosima::fastcdr::Cdr & cdr,
  g29_msg::msg::G29Msg & ros_message)
{
  // Member: heartbeat
  cdr >> ros_message.heartbeat;

  // Member: axis0
  cdr >> ros_message.axis0;

  // Member: axis1
  cdr >> ros_message.axis1;

  // Member: axis2
  cdr >> ros_message.axis2;

  // Member: axis3
  cdr >> ros_message.axis3;

  // Member: axis4
  cdr >> ros_message.axis4;

  // Member: axis5
  cdr >> ros_message.axis5;

  // Member: button0
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button0 = tmp ? true : false;
  }

  // Member: button1
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button1 = tmp ? true : false;
  }

  // Member: button2
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button2 = tmp ? true : false;
  }

  // Member: button3
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button3 = tmp ? true : false;
  }

  // Member: button4
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button4 = tmp ? true : false;
  }

  // Member: button5
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button5 = tmp ? true : false;
  }

  // Member: button6
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button6 = tmp ? true : false;
  }

  // Member: button7
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button7 = tmp ? true : false;
  }

  // Member: button8
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button8 = tmp ? true : false;
  }

  // Member: button9
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button9 = tmp ? true : false;
  }

  // Member: button10
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button10 = tmp ? true : false;
  }

  // Member: button11
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button11 = tmp ? true : false;
  }

  // Member: button12
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button12 = tmp ? true : false;
  }

  // Member: button13
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button13 = tmp ? true : false;
  }

  // Member: button14
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button14 = tmp ? true : false;
  }

  // Member: button15
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button15 = tmp ? true : false;
  }

  // Member: button16
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button16 = tmp ? true : false;
  }

  // Member: button17
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button17 = tmp ? true : false;
  }

  // Member: button18
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button18 = tmp ? true : false;
  }

  // Member: button19
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button19 = tmp ? true : false;
  }

  // Member: button20
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button20 = tmp ? true : false;
  }

  // Member: button21
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button21 = tmp ? true : false;
  }

  // Member: button22
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button22 = tmp ? true : false;
  }

  // Member: button23
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button23 = tmp ? true : false;
  }

  // Member: button24
  {
    uint8_t tmp;
    cdr >> tmp;
    ros_message.button24 = tmp ? true : false;
  }

  return true;
}

size_t
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_g29_msg
get_serialized_size(
  const g29_msg::msg::G29Msg & ros_message,
  size_t current_alignment)
{
  size_t initial_alignment = current_alignment;

  const size_t padding = 4;
  const size_t wchar_size = 4;
  (void)padding;
  (void)wchar_size;

  // Member: heartbeat
  {
    size_t item_size = sizeof(ros_message.heartbeat);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: axis0
  {
    size_t item_size = sizeof(ros_message.axis0);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: axis1
  {
    size_t item_size = sizeof(ros_message.axis1);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: axis2
  {
    size_t item_size = sizeof(ros_message.axis2);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: axis3
  {
    size_t item_size = sizeof(ros_message.axis3);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: axis4
  {
    size_t item_size = sizeof(ros_message.axis4);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: axis5
  {
    size_t item_size = sizeof(ros_message.axis5);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button0
  {
    size_t item_size = sizeof(ros_message.button0);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button1
  {
    size_t item_size = sizeof(ros_message.button1);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button2
  {
    size_t item_size = sizeof(ros_message.button2);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button3
  {
    size_t item_size = sizeof(ros_message.button3);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button4
  {
    size_t item_size = sizeof(ros_message.button4);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button5
  {
    size_t item_size = sizeof(ros_message.button5);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button6
  {
    size_t item_size = sizeof(ros_message.button6);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button7
  {
    size_t item_size = sizeof(ros_message.button7);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button8
  {
    size_t item_size = sizeof(ros_message.button8);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button9
  {
    size_t item_size = sizeof(ros_message.button9);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button10
  {
    size_t item_size = sizeof(ros_message.button10);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button11
  {
    size_t item_size = sizeof(ros_message.button11);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button12
  {
    size_t item_size = sizeof(ros_message.button12);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button13
  {
    size_t item_size = sizeof(ros_message.button13);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button14
  {
    size_t item_size = sizeof(ros_message.button14);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button15
  {
    size_t item_size = sizeof(ros_message.button15);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button16
  {
    size_t item_size = sizeof(ros_message.button16);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button17
  {
    size_t item_size = sizeof(ros_message.button17);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button18
  {
    size_t item_size = sizeof(ros_message.button18);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button19
  {
    size_t item_size = sizeof(ros_message.button19);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button20
  {
    size_t item_size = sizeof(ros_message.button20);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button21
  {
    size_t item_size = sizeof(ros_message.button21);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button22
  {
    size_t item_size = sizeof(ros_message.button22);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button23
  {
    size_t item_size = sizeof(ros_message.button23);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }
  // Member: button24
  {
    size_t item_size = sizeof(ros_message.button24);
    current_alignment += item_size +
      eprosima::fastcdr::Cdr::alignment(current_alignment, item_size);
  }

  return current_alignment - initial_alignment;
}

size_t
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_g29_msg
max_serialized_size_G29Msg(
  bool & full_bounded,
  bool & is_plain,
  size_t current_alignment)
{
  size_t initial_alignment = current_alignment;

  const size_t padding = 4;
  const size_t wchar_size = 4;
  size_t last_member_size = 0;
  (void)last_member_size;
  (void)padding;
  (void)wchar_size;

  full_bounded = true;
  is_plain = true;


  // Member: heartbeat
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: axis0
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: axis1
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: axis2
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: axis3
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: axis4
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: axis5
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint32_t);
    current_alignment += array_size * sizeof(uint32_t) +
      eprosima::fastcdr::Cdr::alignment(current_alignment, sizeof(uint32_t));
  }

  // Member: button0
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button1
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button2
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button3
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button4
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button5
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button6
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button7
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button8
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button9
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button10
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button11
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button12
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button13
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button14
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button15
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button16
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button17
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button18
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button19
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button20
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button21
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button22
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button23
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  // Member: button24
  {
    size_t array_size = 1;

    last_member_size = array_size * sizeof(uint8_t);
    current_alignment += array_size * sizeof(uint8_t);
  }

  size_t ret_val = current_alignment - initial_alignment;
  if (is_plain) {
    // All members are plain, and type is not empty.
    // We still need to check that the in-memory alignment
    // is the same as the CDR mandated alignment.
    using DataType = g29_msg::msg::G29Msg;
    is_plain =
      (
      offsetof(DataType, button24) +
      last_member_size
      ) == ret_val;
  }

  return ret_val;
}

static bool _G29Msg__cdr_serialize(
  const void * untyped_ros_message,
  eprosima::fastcdr::Cdr & cdr)
{
  auto typed_message =
    static_cast<const g29_msg::msg::G29Msg *>(
    untyped_ros_message);
  return cdr_serialize(*typed_message, cdr);
}

static bool _G29Msg__cdr_deserialize(
  eprosima::fastcdr::Cdr & cdr,
  void * untyped_ros_message)
{
  auto typed_message =
    static_cast<g29_msg::msg::G29Msg *>(
    untyped_ros_message);
  return cdr_deserialize(cdr, *typed_message);
}

static uint32_t _G29Msg__get_serialized_size(
  const void * untyped_ros_message)
{
  auto typed_message =
    static_cast<const g29_msg::msg::G29Msg *>(
    untyped_ros_message);
  return static_cast<uint32_t>(get_serialized_size(*typed_message, 0));
}

static size_t _G29Msg__max_serialized_size(char & bounds_info)
{
  bool full_bounded;
  bool is_plain;
  size_t ret_val;

  ret_val = max_serialized_size_G29Msg(full_bounded, is_plain, 0);

  bounds_info =
    is_plain ? ROSIDL_TYPESUPPORT_FASTRTPS_PLAIN_TYPE :
    full_bounded ? ROSIDL_TYPESUPPORT_FASTRTPS_BOUNDED_TYPE : ROSIDL_TYPESUPPORT_FASTRTPS_UNBOUNDED_TYPE;
  return ret_val;
}

static message_type_support_callbacks_t _G29Msg__callbacks = {
  "g29_msg::msg",
  "G29Msg",
  _G29Msg__cdr_serialize,
  _G29Msg__cdr_deserialize,
  _G29Msg__get_serialized_size,
  _G29Msg__max_serialized_size
};

static rosidl_message_type_support_t _G29Msg__handle = {
  rosidl_typesupport_fastrtps_cpp::typesupport_identifier,
  &_G29Msg__callbacks,
  get_message_typesupport_handle_function,
};

}  // namespace typesupport_fastrtps_cpp

}  // namespace msg

}  // namespace g29_msg

namespace rosidl_typesupport_fastrtps_cpp
{

template<>
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_EXPORT_g29_msg
const rosidl_message_type_support_t *
get_message_type_support_handle<g29_msg::msg::G29Msg>()
{
  return &g29_msg::msg::typesupport_fastrtps_cpp::_G29Msg__handle;
}

}  // namespace rosidl_typesupport_fastrtps_cpp

#ifdef __cplusplus
extern "C"
{
#endif

const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_fastrtps_cpp, g29_msg, msg, G29Msg)() {
  return &g29_msg::msg::typesupport_fastrtps_cpp::_G29Msg__handle;
}

#ifdef __cplusplus
}
#endif
