// generated from rosidl_generator_cpp/resource/idl__struct.hpp.em
// with input from interface_protocol:msg/PowerInfo.idl
// generated code does not contain a copyright notice

#ifndef INTERFACE_PROTOCOL__MSG__DETAIL__POWER_INFO__STRUCT_HPP_
#define INTERFACE_PROTOCOL__MSG__DETAIL__POWER_INFO__STRUCT_HPP_

#include <algorithm>
#include <array>
#include <memory>
#include <string>
#include <vector>

#include "rosidl_runtime_cpp/bounded_vector.hpp"
#include "rosidl_runtime_cpp/message_initialization.hpp"


#ifndef _WIN32
# define DEPRECATED__interface_protocol__msg__PowerInfo __attribute__((deprecated))
#else
# define DEPRECATED__interface_protocol__msg__PowerInfo __declspec(deprecated)
#endif

namespace interface_protocol
{

namespace msg
{

// message struct
template<class ContainerAllocator>
struct PowerInfo_
{
  using Type = PowerInfo_<ContainerAllocator>;

  explicit PowerInfo_(rosidl_runtime_cpp::MessageInitialization _init = rosidl_runtime_cpp::MessageInitialization::ALL)
  {
    if (rosidl_runtime_cpp::MessageInitialization::ALL == _init ||
      rosidl_runtime_cpp::MessageInitialization::ZERO == _init)
    {
      this->enable = false;
      this->percentage = 0.0f;
      this->voltage = 0.0f;
      this->current = 0.0f;
      this->current_limit = 0.0f;
      this->error_code = 0l;
    }
  }

  explicit PowerInfo_(const ContainerAllocator & _alloc, rosidl_runtime_cpp::MessageInitialization _init = rosidl_runtime_cpp::MessageInitialization::ALL)
  {
    (void)_alloc;
    if (rosidl_runtime_cpp::MessageInitialization::ALL == _init ||
      rosidl_runtime_cpp::MessageInitialization::ZERO == _init)
    {
      this->enable = false;
      this->percentage = 0.0f;
      this->voltage = 0.0f;
      this->current = 0.0f;
      this->current_limit = 0.0f;
      this->error_code = 0l;
    }
  }

  // field types and members
  using _enable_type =
    bool;
  _enable_type enable;
  using _percentage_type =
    float;
  _percentage_type percentage;
  using _voltage_type =
    float;
  _voltage_type voltage;
  using _current_type =
    float;
  _current_type current;
  using _current_limit_type =
    float;
  _current_limit_type current_limit;
  using _error_code_type =
    int32_t;
  _error_code_type error_code;

  // setters for named parameter idiom
  Type & set__enable(
    const bool & _arg)
  {
    this->enable = _arg;
    return *this;
  }
  Type & set__percentage(
    const float & _arg)
  {
    this->percentage = _arg;
    return *this;
  }
  Type & set__voltage(
    const float & _arg)
  {
    this->voltage = _arg;
    return *this;
  }
  Type & set__current(
    const float & _arg)
  {
    this->current = _arg;
    return *this;
  }
  Type & set__current_limit(
    const float & _arg)
  {
    this->current_limit = _arg;
    return *this;
  }
  Type & set__error_code(
    const int32_t & _arg)
  {
    this->error_code = _arg;
    return *this;
  }

  // constant declarations

  // pointer types
  using RawPtr =
    interface_protocol::msg::PowerInfo_<ContainerAllocator> *;
  using ConstRawPtr =
    const interface_protocol::msg::PowerInfo_<ContainerAllocator> *;
  using SharedPtr =
    std::shared_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator>>;
  using ConstSharedPtr =
    std::shared_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator> const>;

  template<typename Deleter = std::default_delete<
      interface_protocol::msg::PowerInfo_<ContainerAllocator>>>
  using UniquePtrWithDeleter =
    std::unique_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator>, Deleter>;

  using UniquePtr = UniquePtrWithDeleter<>;

  template<typename Deleter = std::default_delete<
      interface_protocol::msg::PowerInfo_<ContainerAllocator>>>
  using ConstUniquePtrWithDeleter =
    std::unique_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator> const, Deleter>;
  using ConstUniquePtr = ConstUniquePtrWithDeleter<>;

  using WeakPtr =
    std::weak_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator>>;
  using ConstWeakPtr =
    std::weak_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator> const>;

  // pointer types similar to ROS 1, use SharedPtr / ConstSharedPtr instead
  // NOTE: Can't use 'using' here because GNU C++ can't parse attributes properly
  typedef DEPRECATED__interface_protocol__msg__PowerInfo
    std::shared_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator>>
    Ptr;
  typedef DEPRECATED__interface_protocol__msg__PowerInfo
    std::shared_ptr<interface_protocol::msg::PowerInfo_<ContainerAllocator> const>
    ConstPtr;

  // comparison operators
  bool operator==(const PowerInfo_ & other) const
  {
    if (this->enable != other.enable) {
      return false;
    }
    if (this->percentage != other.percentage) {
      return false;
    }
    if (this->voltage != other.voltage) {
      return false;
    }
    if (this->current != other.current) {
      return false;
    }
    if (this->current_limit != other.current_limit) {
      return false;
    }
    if (this->error_code != other.error_code) {
      return false;
    }
    return true;
  }
  bool operator!=(const PowerInfo_ & other) const
  {
    return !this->operator==(other);
  }
};  // struct PowerInfo_

// alias to use template instance with default allocator
using PowerInfo =
  interface_protocol::msg::PowerInfo_<std::allocator<void>>;

// constant definitions

}  // namespace msg

}  // namespace interface_protocol

#endif  // INTERFACE_PROTOCOL__MSG__DETAIL__POWER_INFO__STRUCT_HPP_
