// generated from rosidl_generator_c/resource/idl__functions.c.em
// with input from cpp_prococol:action/MoveTo.idl
// generated code does not contain a copyright notice
#include "cpp_prococol/action/detail/move_to__functions.h"

#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

#include "rcutils/allocator.h"


bool
cpp_prococol__action__MoveTo_Goal__init(cpp_prococol__action__MoveTo_Goal * msg)
{
  if (!msg) {
    return false;
  }
  // target_x
  // target_y
  return true;
}

void
cpp_prococol__action__MoveTo_Goal__fini(cpp_prococol__action__MoveTo_Goal * msg)
{
  if (!msg) {
    return;
  }
  // target_x
  // target_y
}

bool
cpp_prococol__action__MoveTo_Goal__are_equal(const cpp_prococol__action__MoveTo_Goal * lhs, const cpp_prococol__action__MoveTo_Goal * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // target_x
  if (lhs->target_x != rhs->target_x) {
    return false;
  }
  // target_y
  if (lhs->target_y != rhs->target_y) {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_Goal__copy(
  const cpp_prococol__action__MoveTo_Goal * input,
  cpp_prococol__action__MoveTo_Goal * output)
{
  if (!input || !output) {
    return false;
  }
  // target_x
  output->target_x = input->target_x;
  // target_y
  output->target_y = input->target_y;
  return true;
}

cpp_prococol__action__MoveTo_Goal *
cpp_prococol__action__MoveTo_Goal__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Goal * msg = (cpp_prococol__action__MoveTo_Goal *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_Goal), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_Goal));
  bool success = cpp_prococol__action__MoveTo_Goal__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_Goal__destroy(cpp_prococol__action__MoveTo_Goal * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_Goal__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_Goal__Sequence__init(cpp_prococol__action__MoveTo_Goal__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Goal * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_Goal *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_Goal), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_Goal__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_Goal__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_Goal__Sequence__fini(cpp_prococol__action__MoveTo_Goal__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_Goal__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_Goal__Sequence *
cpp_prococol__action__MoveTo_Goal__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Goal__Sequence * array = (cpp_prococol__action__MoveTo_Goal__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_Goal__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_Goal__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_Goal__Sequence__destroy(cpp_prococol__action__MoveTo_Goal__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_Goal__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_Goal__Sequence__are_equal(const cpp_prococol__action__MoveTo_Goal__Sequence * lhs, const cpp_prococol__action__MoveTo_Goal__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_Goal__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_Goal__Sequence__copy(
  const cpp_prococol__action__MoveTo_Goal__Sequence * input,
  cpp_prococol__action__MoveTo_Goal__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_Goal);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_Goal * data =
      (cpp_prococol__action__MoveTo_Goal *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_Goal__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_Goal__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_Goal__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


// Include directives for member types
// Member `message`
#include "rosidl_runtime_c/string_functions.h"

bool
cpp_prococol__action__MoveTo_Result__init(cpp_prococol__action__MoveTo_Result * msg)
{
  if (!msg) {
    return false;
  }
  // success
  // message
  if (!rosidl_runtime_c__String__init(&msg->message)) {
    cpp_prococol__action__MoveTo_Result__fini(msg);
    return false;
  }
  // status
  return true;
}

void
cpp_prococol__action__MoveTo_Result__fini(cpp_prococol__action__MoveTo_Result * msg)
{
  if (!msg) {
    return;
  }
  // success
  // message
  rosidl_runtime_c__String__fini(&msg->message);
  // status
}

bool
cpp_prococol__action__MoveTo_Result__are_equal(const cpp_prococol__action__MoveTo_Result * lhs, const cpp_prococol__action__MoveTo_Result * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // success
  if (lhs->success != rhs->success) {
    return false;
  }
  // message
  if (!rosidl_runtime_c__String__are_equal(
      &(lhs->message), &(rhs->message)))
  {
    return false;
  }
  // status
  if (lhs->status != rhs->status) {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_Result__copy(
  const cpp_prococol__action__MoveTo_Result * input,
  cpp_prococol__action__MoveTo_Result * output)
{
  if (!input || !output) {
    return false;
  }
  // success
  output->success = input->success;
  // message
  if (!rosidl_runtime_c__String__copy(
      &(input->message), &(output->message)))
  {
    return false;
  }
  // status
  output->status = input->status;
  return true;
}

cpp_prococol__action__MoveTo_Result *
cpp_prococol__action__MoveTo_Result__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Result * msg = (cpp_prococol__action__MoveTo_Result *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_Result), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_Result));
  bool success = cpp_prococol__action__MoveTo_Result__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_Result__destroy(cpp_prococol__action__MoveTo_Result * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_Result__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_Result__Sequence__init(cpp_prococol__action__MoveTo_Result__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Result * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_Result *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_Result), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_Result__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_Result__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_Result__Sequence__fini(cpp_prococol__action__MoveTo_Result__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_Result__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_Result__Sequence *
cpp_prococol__action__MoveTo_Result__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Result__Sequence * array = (cpp_prococol__action__MoveTo_Result__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_Result__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_Result__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_Result__Sequence__destroy(cpp_prococol__action__MoveTo_Result__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_Result__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_Result__Sequence__are_equal(const cpp_prococol__action__MoveTo_Result__Sequence * lhs, const cpp_prococol__action__MoveTo_Result__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_Result__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_Result__Sequence__copy(
  const cpp_prococol__action__MoveTo_Result__Sequence * input,
  cpp_prococol__action__MoveTo_Result__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_Result);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_Result * data =
      (cpp_prococol__action__MoveTo_Result *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_Result__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_Result__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_Result__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


bool
cpp_prococol__action__MoveTo_Feedback__init(cpp_prococol__action__MoveTo_Feedback * msg)
{
  if (!msg) {
    return false;
  }
  // progress
  return true;
}

void
cpp_prococol__action__MoveTo_Feedback__fini(cpp_prococol__action__MoveTo_Feedback * msg)
{
  if (!msg) {
    return;
  }
  // progress
}

bool
cpp_prococol__action__MoveTo_Feedback__are_equal(const cpp_prococol__action__MoveTo_Feedback * lhs, const cpp_prococol__action__MoveTo_Feedback * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // progress
  if (lhs->progress != rhs->progress) {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_Feedback__copy(
  const cpp_prococol__action__MoveTo_Feedback * input,
  cpp_prococol__action__MoveTo_Feedback * output)
{
  if (!input || !output) {
    return false;
  }
  // progress
  output->progress = input->progress;
  return true;
}

cpp_prococol__action__MoveTo_Feedback *
cpp_prococol__action__MoveTo_Feedback__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Feedback * msg = (cpp_prococol__action__MoveTo_Feedback *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_Feedback), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_Feedback));
  bool success = cpp_prococol__action__MoveTo_Feedback__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_Feedback__destroy(cpp_prococol__action__MoveTo_Feedback * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_Feedback__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_Feedback__Sequence__init(cpp_prococol__action__MoveTo_Feedback__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Feedback * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_Feedback *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_Feedback), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_Feedback__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_Feedback__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_Feedback__Sequence__fini(cpp_prococol__action__MoveTo_Feedback__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_Feedback__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_Feedback__Sequence *
cpp_prococol__action__MoveTo_Feedback__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_Feedback__Sequence * array = (cpp_prococol__action__MoveTo_Feedback__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_Feedback__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_Feedback__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_Feedback__Sequence__destroy(cpp_prococol__action__MoveTo_Feedback__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_Feedback__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_Feedback__Sequence__are_equal(const cpp_prococol__action__MoveTo_Feedback__Sequence * lhs, const cpp_prococol__action__MoveTo_Feedback__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_Feedback__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_Feedback__Sequence__copy(
  const cpp_prococol__action__MoveTo_Feedback__Sequence * input,
  cpp_prococol__action__MoveTo_Feedback__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_Feedback);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_Feedback * data =
      (cpp_prococol__action__MoveTo_Feedback *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_Feedback__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_Feedback__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_Feedback__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


// Include directives for member types
// Member `goal_id`
#include "unique_identifier_msgs/msg/detail/uuid__functions.h"
// Member `goal`
// already included above
// #include "cpp_prococol/action/detail/move_to__functions.h"

bool
cpp_prococol__action__MoveTo_SendGoal_Request__init(cpp_prococol__action__MoveTo_SendGoal_Request * msg)
{
  if (!msg) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__init(&msg->goal_id)) {
    cpp_prococol__action__MoveTo_SendGoal_Request__fini(msg);
    return false;
  }
  // goal
  if (!cpp_prococol__action__MoveTo_Goal__init(&msg->goal)) {
    cpp_prococol__action__MoveTo_SendGoal_Request__fini(msg);
    return false;
  }
  return true;
}

void
cpp_prococol__action__MoveTo_SendGoal_Request__fini(cpp_prococol__action__MoveTo_SendGoal_Request * msg)
{
  if (!msg) {
    return;
  }
  // goal_id
  unique_identifier_msgs__msg__UUID__fini(&msg->goal_id);
  // goal
  cpp_prococol__action__MoveTo_Goal__fini(&msg->goal);
}

bool
cpp_prococol__action__MoveTo_SendGoal_Request__are_equal(const cpp_prococol__action__MoveTo_SendGoal_Request * lhs, const cpp_prococol__action__MoveTo_SendGoal_Request * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__are_equal(
      &(lhs->goal_id), &(rhs->goal_id)))
  {
    return false;
  }
  // goal
  if (!cpp_prococol__action__MoveTo_Goal__are_equal(
      &(lhs->goal), &(rhs->goal)))
  {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_SendGoal_Request__copy(
  const cpp_prococol__action__MoveTo_SendGoal_Request * input,
  cpp_prococol__action__MoveTo_SendGoal_Request * output)
{
  if (!input || !output) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__copy(
      &(input->goal_id), &(output->goal_id)))
  {
    return false;
  }
  // goal
  if (!cpp_prococol__action__MoveTo_Goal__copy(
      &(input->goal), &(output->goal)))
  {
    return false;
  }
  return true;
}

cpp_prococol__action__MoveTo_SendGoal_Request *
cpp_prococol__action__MoveTo_SendGoal_Request__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_SendGoal_Request * msg = (cpp_prococol__action__MoveTo_SendGoal_Request *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_SendGoal_Request), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_SendGoal_Request));
  bool success = cpp_prococol__action__MoveTo_SendGoal_Request__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_SendGoal_Request__destroy(cpp_prococol__action__MoveTo_SendGoal_Request * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_SendGoal_Request__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__init(cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_SendGoal_Request * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_SendGoal_Request *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_SendGoal_Request), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_SendGoal_Request__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_SendGoal_Request__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__fini(cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_SendGoal_Request__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_SendGoal_Request__Sequence *
cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * array = (cpp_prococol__action__MoveTo_SendGoal_Request__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_SendGoal_Request__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__destroy(cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__are_equal(const cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * lhs, const cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_SendGoal_Request__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_SendGoal_Request__Sequence__copy(
  const cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * input,
  cpp_prococol__action__MoveTo_SendGoal_Request__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_SendGoal_Request);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_SendGoal_Request * data =
      (cpp_prococol__action__MoveTo_SendGoal_Request *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_SendGoal_Request__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_SendGoal_Request__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_SendGoal_Request__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


// Include directives for member types
// Member `stamp`
#include "builtin_interfaces/msg/detail/time__functions.h"

bool
cpp_prococol__action__MoveTo_SendGoal_Response__init(cpp_prococol__action__MoveTo_SendGoal_Response * msg)
{
  if (!msg) {
    return false;
  }
  // accepted
  // stamp
  if (!builtin_interfaces__msg__Time__init(&msg->stamp)) {
    cpp_prococol__action__MoveTo_SendGoal_Response__fini(msg);
    return false;
  }
  return true;
}

void
cpp_prococol__action__MoveTo_SendGoal_Response__fini(cpp_prococol__action__MoveTo_SendGoal_Response * msg)
{
  if (!msg) {
    return;
  }
  // accepted
  // stamp
  builtin_interfaces__msg__Time__fini(&msg->stamp);
}

bool
cpp_prococol__action__MoveTo_SendGoal_Response__are_equal(const cpp_prococol__action__MoveTo_SendGoal_Response * lhs, const cpp_prococol__action__MoveTo_SendGoal_Response * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // accepted
  if (lhs->accepted != rhs->accepted) {
    return false;
  }
  // stamp
  if (!builtin_interfaces__msg__Time__are_equal(
      &(lhs->stamp), &(rhs->stamp)))
  {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_SendGoal_Response__copy(
  const cpp_prococol__action__MoveTo_SendGoal_Response * input,
  cpp_prococol__action__MoveTo_SendGoal_Response * output)
{
  if (!input || !output) {
    return false;
  }
  // accepted
  output->accepted = input->accepted;
  // stamp
  if (!builtin_interfaces__msg__Time__copy(
      &(input->stamp), &(output->stamp)))
  {
    return false;
  }
  return true;
}

cpp_prococol__action__MoveTo_SendGoal_Response *
cpp_prococol__action__MoveTo_SendGoal_Response__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_SendGoal_Response * msg = (cpp_prococol__action__MoveTo_SendGoal_Response *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_SendGoal_Response), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_SendGoal_Response));
  bool success = cpp_prococol__action__MoveTo_SendGoal_Response__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_SendGoal_Response__destroy(cpp_prococol__action__MoveTo_SendGoal_Response * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_SendGoal_Response__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__init(cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_SendGoal_Response * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_SendGoal_Response *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_SendGoal_Response), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_SendGoal_Response__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_SendGoal_Response__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__fini(cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_SendGoal_Response__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_SendGoal_Response__Sequence *
cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * array = (cpp_prococol__action__MoveTo_SendGoal_Response__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_SendGoal_Response__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__destroy(cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__are_equal(const cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * lhs, const cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_SendGoal_Response__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_SendGoal_Response__Sequence__copy(
  const cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * input,
  cpp_prococol__action__MoveTo_SendGoal_Response__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_SendGoal_Response);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_SendGoal_Response * data =
      (cpp_prococol__action__MoveTo_SendGoal_Response *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_SendGoal_Response__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_SendGoal_Response__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_SendGoal_Response__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


// Include directives for member types
// Member `goal_id`
// already included above
// #include "unique_identifier_msgs/msg/detail/uuid__functions.h"

bool
cpp_prococol__action__MoveTo_GetResult_Request__init(cpp_prococol__action__MoveTo_GetResult_Request * msg)
{
  if (!msg) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__init(&msg->goal_id)) {
    cpp_prococol__action__MoveTo_GetResult_Request__fini(msg);
    return false;
  }
  return true;
}

void
cpp_prococol__action__MoveTo_GetResult_Request__fini(cpp_prococol__action__MoveTo_GetResult_Request * msg)
{
  if (!msg) {
    return;
  }
  // goal_id
  unique_identifier_msgs__msg__UUID__fini(&msg->goal_id);
}

bool
cpp_prococol__action__MoveTo_GetResult_Request__are_equal(const cpp_prococol__action__MoveTo_GetResult_Request * lhs, const cpp_prococol__action__MoveTo_GetResult_Request * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__are_equal(
      &(lhs->goal_id), &(rhs->goal_id)))
  {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_GetResult_Request__copy(
  const cpp_prococol__action__MoveTo_GetResult_Request * input,
  cpp_prococol__action__MoveTo_GetResult_Request * output)
{
  if (!input || !output) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__copy(
      &(input->goal_id), &(output->goal_id)))
  {
    return false;
  }
  return true;
}

cpp_prococol__action__MoveTo_GetResult_Request *
cpp_prococol__action__MoveTo_GetResult_Request__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_GetResult_Request * msg = (cpp_prococol__action__MoveTo_GetResult_Request *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_GetResult_Request), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_GetResult_Request));
  bool success = cpp_prococol__action__MoveTo_GetResult_Request__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_GetResult_Request__destroy(cpp_prococol__action__MoveTo_GetResult_Request * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_GetResult_Request__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_GetResult_Request__Sequence__init(cpp_prococol__action__MoveTo_GetResult_Request__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_GetResult_Request * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_GetResult_Request *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_GetResult_Request), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_GetResult_Request__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_GetResult_Request__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_GetResult_Request__Sequence__fini(cpp_prococol__action__MoveTo_GetResult_Request__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_GetResult_Request__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_GetResult_Request__Sequence *
cpp_prococol__action__MoveTo_GetResult_Request__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_GetResult_Request__Sequence * array = (cpp_prococol__action__MoveTo_GetResult_Request__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_GetResult_Request__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_GetResult_Request__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_GetResult_Request__Sequence__destroy(cpp_prococol__action__MoveTo_GetResult_Request__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_GetResult_Request__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_GetResult_Request__Sequence__are_equal(const cpp_prococol__action__MoveTo_GetResult_Request__Sequence * lhs, const cpp_prococol__action__MoveTo_GetResult_Request__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_GetResult_Request__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_GetResult_Request__Sequence__copy(
  const cpp_prococol__action__MoveTo_GetResult_Request__Sequence * input,
  cpp_prococol__action__MoveTo_GetResult_Request__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_GetResult_Request);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_GetResult_Request * data =
      (cpp_prococol__action__MoveTo_GetResult_Request *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_GetResult_Request__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_GetResult_Request__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_GetResult_Request__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


// Include directives for member types
// Member `result`
// already included above
// #include "cpp_prococol/action/detail/move_to__functions.h"

bool
cpp_prococol__action__MoveTo_GetResult_Response__init(cpp_prococol__action__MoveTo_GetResult_Response * msg)
{
  if (!msg) {
    return false;
  }
  // status
  // result
  if (!cpp_prococol__action__MoveTo_Result__init(&msg->result)) {
    cpp_prococol__action__MoveTo_GetResult_Response__fini(msg);
    return false;
  }
  return true;
}

void
cpp_prococol__action__MoveTo_GetResult_Response__fini(cpp_prococol__action__MoveTo_GetResult_Response * msg)
{
  if (!msg) {
    return;
  }
  // status
  // result
  cpp_prococol__action__MoveTo_Result__fini(&msg->result);
}

bool
cpp_prococol__action__MoveTo_GetResult_Response__are_equal(const cpp_prococol__action__MoveTo_GetResult_Response * lhs, const cpp_prococol__action__MoveTo_GetResult_Response * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // status
  if (lhs->status != rhs->status) {
    return false;
  }
  // result
  if (!cpp_prococol__action__MoveTo_Result__are_equal(
      &(lhs->result), &(rhs->result)))
  {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_GetResult_Response__copy(
  const cpp_prococol__action__MoveTo_GetResult_Response * input,
  cpp_prococol__action__MoveTo_GetResult_Response * output)
{
  if (!input || !output) {
    return false;
  }
  // status
  output->status = input->status;
  // result
  if (!cpp_prococol__action__MoveTo_Result__copy(
      &(input->result), &(output->result)))
  {
    return false;
  }
  return true;
}

cpp_prococol__action__MoveTo_GetResult_Response *
cpp_prococol__action__MoveTo_GetResult_Response__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_GetResult_Response * msg = (cpp_prococol__action__MoveTo_GetResult_Response *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_GetResult_Response), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_GetResult_Response));
  bool success = cpp_prococol__action__MoveTo_GetResult_Response__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_GetResult_Response__destroy(cpp_prococol__action__MoveTo_GetResult_Response * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_GetResult_Response__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_GetResult_Response__Sequence__init(cpp_prococol__action__MoveTo_GetResult_Response__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_GetResult_Response * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_GetResult_Response *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_GetResult_Response), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_GetResult_Response__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_GetResult_Response__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_GetResult_Response__Sequence__fini(cpp_prococol__action__MoveTo_GetResult_Response__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_GetResult_Response__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_GetResult_Response__Sequence *
cpp_prococol__action__MoveTo_GetResult_Response__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_GetResult_Response__Sequence * array = (cpp_prococol__action__MoveTo_GetResult_Response__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_GetResult_Response__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_GetResult_Response__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_GetResult_Response__Sequence__destroy(cpp_prococol__action__MoveTo_GetResult_Response__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_GetResult_Response__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_GetResult_Response__Sequence__are_equal(const cpp_prococol__action__MoveTo_GetResult_Response__Sequence * lhs, const cpp_prococol__action__MoveTo_GetResult_Response__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_GetResult_Response__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_GetResult_Response__Sequence__copy(
  const cpp_prococol__action__MoveTo_GetResult_Response__Sequence * input,
  cpp_prococol__action__MoveTo_GetResult_Response__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_GetResult_Response);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_GetResult_Response * data =
      (cpp_prococol__action__MoveTo_GetResult_Response *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_GetResult_Response__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_GetResult_Response__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_GetResult_Response__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}


// Include directives for member types
// Member `goal_id`
// already included above
// #include "unique_identifier_msgs/msg/detail/uuid__functions.h"
// Member `feedback`
// already included above
// #include "cpp_prococol/action/detail/move_to__functions.h"

bool
cpp_prococol__action__MoveTo_FeedbackMessage__init(cpp_prococol__action__MoveTo_FeedbackMessage * msg)
{
  if (!msg) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__init(&msg->goal_id)) {
    cpp_prococol__action__MoveTo_FeedbackMessage__fini(msg);
    return false;
  }
  // feedback
  if (!cpp_prococol__action__MoveTo_Feedback__init(&msg->feedback)) {
    cpp_prococol__action__MoveTo_FeedbackMessage__fini(msg);
    return false;
  }
  return true;
}

void
cpp_prococol__action__MoveTo_FeedbackMessage__fini(cpp_prococol__action__MoveTo_FeedbackMessage * msg)
{
  if (!msg) {
    return;
  }
  // goal_id
  unique_identifier_msgs__msg__UUID__fini(&msg->goal_id);
  // feedback
  cpp_prococol__action__MoveTo_Feedback__fini(&msg->feedback);
}

bool
cpp_prococol__action__MoveTo_FeedbackMessage__are_equal(const cpp_prococol__action__MoveTo_FeedbackMessage * lhs, const cpp_prococol__action__MoveTo_FeedbackMessage * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__are_equal(
      &(lhs->goal_id), &(rhs->goal_id)))
  {
    return false;
  }
  // feedback
  if (!cpp_prococol__action__MoveTo_Feedback__are_equal(
      &(lhs->feedback), &(rhs->feedback)))
  {
    return false;
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_FeedbackMessage__copy(
  const cpp_prococol__action__MoveTo_FeedbackMessage * input,
  cpp_prococol__action__MoveTo_FeedbackMessage * output)
{
  if (!input || !output) {
    return false;
  }
  // goal_id
  if (!unique_identifier_msgs__msg__UUID__copy(
      &(input->goal_id), &(output->goal_id)))
  {
    return false;
  }
  // feedback
  if (!cpp_prococol__action__MoveTo_Feedback__copy(
      &(input->feedback), &(output->feedback)))
  {
    return false;
  }
  return true;
}

cpp_prococol__action__MoveTo_FeedbackMessage *
cpp_prococol__action__MoveTo_FeedbackMessage__create()
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_FeedbackMessage * msg = (cpp_prococol__action__MoveTo_FeedbackMessage *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_FeedbackMessage), allocator.state);
  if (!msg) {
    return NULL;
  }
  memset(msg, 0, sizeof(cpp_prococol__action__MoveTo_FeedbackMessage));
  bool success = cpp_prococol__action__MoveTo_FeedbackMessage__init(msg);
  if (!success) {
    allocator.deallocate(msg, allocator.state);
    return NULL;
  }
  return msg;
}

void
cpp_prococol__action__MoveTo_FeedbackMessage__destroy(cpp_prococol__action__MoveTo_FeedbackMessage * msg)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (msg) {
    cpp_prococol__action__MoveTo_FeedbackMessage__fini(msg);
  }
  allocator.deallocate(msg, allocator.state);
}


bool
cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__init(cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * array, size_t size)
{
  if (!array) {
    return false;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_FeedbackMessage * data = NULL;

  if (size) {
    data = (cpp_prococol__action__MoveTo_FeedbackMessage *)allocator.zero_allocate(size, sizeof(cpp_prococol__action__MoveTo_FeedbackMessage), allocator.state);
    if (!data) {
      return false;
    }
    // initialize all array elements
    size_t i;
    for (i = 0; i < size; ++i) {
      bool success = cpp_prococol__action__MoveTo_FeedbackMessage__init(&data[i]);
      if (!success) {
        break;
      }
    }
    if (i < size) {
      // if initialization failed finalize the already initialized array elements
      for (; i > 0; --i) {
        cpp_prococol__action__MoveTo_FeedbackMessage__fini(&data[i - 1]);
      }
      allocator.deallocate(data, allocator.state);
      return false;
    }
  }
  array->data = data;
  array->size = size;
  array->capacity = size;
  return true;
}

void
cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__fini(cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * array)
{
  if (!array) {
    return;
  }
  rcutils_allocator_t allocator = rcutils_get_default_allocator();

  if (array->data) {
    // ensure that data and capacity values are consistent
    assert(array->capacity > 0);
    // finalize all array elements
    for (size_t i = 0; i < array->capacity; ++i) {
      cpp_prococol__action__MoveTo_FeedbackMessage__fini(&array->data[i]);
    }
    allocator.deallocate(array->data, allocator.state);
    array->data = NULL;
    array->size = 0;
    array->capacity = 0;
  } else {
    // ensure that data, size, and capacity values are consistent
    assert(0 == array->size);
    assert(0 == array->capacity);
  }
}

cpp_prococol__action__MoveTo_FeedbackMessage__Sequence *
cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__create(size_t size)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * array = (cpp_prococol__action__MoveTo_FeedbackMessage__Sequence *)allocator.allocate(sizeof(cpp_prococol__action__MoveTo_FeedbackMessage__Sequence), allocator.state);
  if (!array) {
    return NULL;
  }
  bool success = cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__init(array, size);
  if (!success) {
    allocator.deallocate(array, allocator.state);
    return NULL;
  }
  return array;
}

void
cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__destroy(cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * array)
{
  rcutils_allocator_t allocator = rcutils_get_default_allocator();
  if (array) {
    cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__fini(array);
  }
  allocator.deallocate(array, allocator.state);
}

bool
cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__are_equal(const cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * lhs, const cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * rhs)
{
  if (!lhs || !rhs) {
    return false;
  }
  if (lhs->size != rhs->size) {
    return false;
  }
  for (size_t i = 0; i < lhs->size; ++i) {
    if (!cpp_prococol__action__MoveTo_FeedbackMessage__are_equal(&(lhs->data[i]), &(rhs->data[i]))) {
      return false;
    }
  }
  return true;
}

bool
cpp_prococol__action__MoveTo_FeedbackMessage__Sequence__copy(
  const cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * input,
  cpp_prococol__action__MoveTo_FeedbackMessage__Sequence * output)
{
  if (!input || !output) {
    return false;
  }
  if (output->capacity < input->size) {
    const size_t allocation_size =
      input->size * sizeof(cpp_prococol__action__MoveTo_FeedbackMessage);
    rcutils_allocator_t allocator = rcutils_get_default_allocator();
    cpp_prococol__action__MoveTo_FeedbackMessage * data =
      (cpp_prococol__action__MoveTo_FeedbackMessage *)allocator.reallocate(
      output->data, allocation_size, allocator.state);
    if (!data) {
      return false;
    }
    // If reallocation succeeded, memory may or may not have been moved
    // to fulfill the allocation request, invalidating output->data.
    output->data = data;
    for (size_t i = output->capacity; i < input->size; ++i) {
      if (!cpp_prococol__action__MoveTo_FeedbackMessage__init(&output->data[i])) {
        // If initialization of any new item fails, roll back
        // all previously initialized items. Existing items
        // in output are to be left unmodified.
        for (; i-- > output->capacity; ) {
          cpp_prococol__action__MoveTo_FeedbackMessage__fini(&output->data[i]);
        }
        return false;
      }
    }
    output->capacity = input->size;
  }
  output->size = input->size;
  for (size_t i = 0; i < input->size; ++i) {
    if (!cpp_prococol__action__MoveTo_FeedbackMessage__copy(
        &(input->data[i]), &(output->data[i])))
    {
      return false;
    }
  }
  return true;
}
