mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
359 lines
11 KiB
C++
359 lines
11 KiB
C++
|
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||
|
|
// source: msgs/joystick.proto
|
||
|
|
|
||
|
|
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
|
||
|
|
#include "simulation/msgs/joystick.pb.h"
|
||
|
|
|
||
|
|
#include <algorithm>
|
||
|
|
|
||
|
|
#include <google/protobuf/stubs/common.h>
|
||
|
|
#include <google/protobuf/stubs/once.h>
|
||
|
|
#include <google/protobuf/io/coded_stream.h>
|
||
|
|
#include <google/protobuf/wire_format_lite_inl.h>
|
||
|
|
#include <google/protobuf/descriptor.h>
|
||
|
|
#include <google/protobuf/generated_message_reflection.h>
|
||
|
|
#include <google/protobuf/reflection_ops.h>
|
||
|
|
#include <google/protobuf/wire_format.h>
|
||
|
|
// @@protoc_insertion_point(includes)
|
||
|
|
|
||
|
|
namespace gazebo {
|
||
|
|
namespace msgs {
|
||
|
|
|
||
|
|
namespace {
|
||
|
|
|
||
|
|
const ::google::protobuf::Descriptor* Joystick_descriptor_ = NULL;
|
||
|
|
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||
|
|
Joystick_reflection_ = NULL;
|
||
|
|
|
||
|
|
} // namespace
|
||
|
|
|
||
|
|
|
||
|
|
void protobuf_AssignDesc_msgs_2fjoystick_2eproto() {
|
||
|
|
protobuf_AddDesc_msgs_2fjoystick_2eproto();
|
||
|
|
const ::google::protobuf::FileDescriptor* file =
|
||
|
|
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
||
|
|
"msgs/joystick.proto");
|
||
|
|
GOOGLE_CHECK(file != NULL);
|
||
|
|
Joystick_descriptor_ = file->message_type(0);
|
||
|
|
static const int Joystick_offsets_[2] = {
|
||
|
|
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, axes_),
|
||
|
|
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, buttons_),
|
||
|
|
};
|
||
|
|
Joystick_reflection_ =
|
||
|
|
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||
|
|
Joystick_descriptor_,
|
||
|
|
Joystick::default_instance_,
|
||
|
|
Joystick_offsets_,
|
||
|
|
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, _has_bits_[0]),
|
||
|
|
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Joystick, _unknown_fields_),
|
||
|
|
-1,
|
||
|
|
::google::protobuf::DescriptorPool::generated_pool(),
|
||
|
|
::google::protobuf::MessageFactory::generated_factory(),
|
||
|
|
sizeof(Joystick));
|
||
|
|
}
|
||
|
|
|
||
|
|
namespace {
|
||
|
|
|
||
|
|
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
|
||
|
|
inline void protobuf_AssignDescriptorsOnce() {
|
||
|
|
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
|
||
|
|
&protobuf_AssignDesc_msgs_2fjoystick_2eproto);
|
||
|
|
}
|
||
|
|
|
||
|
|
void protobuf_RegisterTypes(const ::std::string&) {
|
||
|
|
protobuf_AssignDescriptorsOnce();
|
||
|
|
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||
|
|
Joystick_descriptor_, &Joystick::default_instance());
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace
|
||
|
|
|
||
|
|
void protobuf_ShutdownFile_msgs_2fjoystick_2eproto() {
|
||
|
|
delete Joystick::default_instance_;
|
||
|
|
delete Joystick_reflection_;
|
||
|
|
}
|
||
|
|
|
||
|
|
void protobuf_AddDesc_msgs_2fjoystick_2eproto() {
|
||
|
|
static bool already_here = false;
|
||
|
|
if (already_here) return;
|
||
|
|
already_here = true;
|
||
|
|
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||
|
|
|
||
|
|
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||
|
|
"\n\023msgs/joystick.proto\022\013gazebo.msgs\")\n\010Jo"
|
||
|
|
"ystick\022\014\n\004axes\030\001 \003(\001\022\017\n\007buttons\030\002 \003(\010B\014B"
|
||
|
|
"\nGzJoystick", 91);
|
||
|
|
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||
|
|
"msgs/joystick.proto", &protobuf_RegisterTypes);
|
||
|
|
Joystick::default_instance_ = new Joystick();
|
||
|
|
Joystick::default_instance_->InitAsDefaultInstance();
|
||
|
|
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_msgs_2fjoystick_2eproto);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Force AddDescriptors() to be called at static initialization time.
|
||
|
|
struct StaticDescriptorInitializer_msgs_2fjoystick_2eproto {
|
||
|
|
StaticDescriptorInitializer_msgs_2fjoystick_2eproto() {
|
||
|
|
protobuf_AddDesc_msgs_2fjoystick_2eproto();
|
||
|
|
}
|
||
|
|
} static_descriptor_initializer_msgs_2fjoystick_2eproto_;
|
||
|
|
|
||
|
|
// ===================================================================
|
||
|
|
|
||
|
|
#ifndef _MSC_VER
|
||
|
|
const int Joystick::kAxesFieldNumber;
|
||
|
|
const int Joystick::kButtonsFieldNumber;
|
||
|
|
#endif // !_MSC_VER
|
||
|
|
|
||
|
|
Joystick::Joystick()
|
||
|
|
: ::google::protobuf::Message() {
|
||
|
|
SharedCtor();
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::InitAsDefaultInstance() {
|
||
|
|
}
|
||
|
|
|
||
|
|
Joystick::Joystick(const Joystick& from)
|
||
|
|
: ::google::protobuf::Message() {
|
||
|
|
SharedCtor();
|
||
|
|
MergeFrom(from);
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::SharedCtor() {
|
||
|
|
_cached_size_ = 0;
|
||
|
|
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||
|
|
}
|
||
|
|
|
||
|
|
Joystick::~Joystick() {
|
||
|
|
SharedDtor();
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::SharedDtor() {
|
||
|
|
if (this != default_instance_) {
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::SetCachedSize(int size) const {
|
||
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||
|
|
_cached_size_ = size;
|
||
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||
|
|
}
|
||
|
|
const ::google::protobuf::Descriptor* Joystick::descriptor() {
|
||
|
|
protobuf_AssignDescriptorsOnce();
|
||
|
|
return Joystick_descriptor_;
|
||
|
|
}
|
||
|
|
|
||
|
|
const Joystick& Joystick::default_instance() {
|
||
|
|
if (default_instance_ == NULL) protobuf_AddDesc_msgs_2fjoystick_2eproto();
|
||
|
|
return *default_instance_;
|
||
|
|
}
|
||
|
|
|
||
|
|
Joystick* Joystick::default_instance_ = NULL;
|
||
|
|
|
||
|
|
Joystick* Joystick::New() const {
|
||
|
|
return new Joystick;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::Clear() {
|
||
|
|
axes_.Clear();
|
||
|
|
buttons_.Clear();
|
||
|
|
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||
|
|
mutable_unknown_fields()->Clear();
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Joystick::MergePartialFromCodedStream(
|
||
|
|
::google::protobuf::io::CodedInputStream* input) {
|
||
|
|
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
|
||
|
|
::google::protobuf::uint32 tag;
|
||
|
|
while ((tag = input->ReadTag()) != 0) {
|
||
|
|
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||
|
|
// repeated double axes = 1;
|
||
|
|
case 1: {
|
||
|
|
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||
|
|
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
|
||
|
|
parse_axes:
|
||
|
|
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
|
||
|
|
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
|
||
|
|
1, 9, input, this->mutable_axes())));
|
||
|
|
} else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
|
||
|
|
== ::google::protobuf::internal::WireFormatLite::
|
||
|
|
WIRETYPE_LENGTH_DELIMITED) {
|
||
|
|
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
|
||
|
|
double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
|
||
|
|
input, this->mutable_axes())));
|
||
|
|
} else {
|
||
|
|
goto handle_uninterpreted;
|
||
|
|
}
|
||
|
|
if (input->ExpectTag(9)) goto parse_axes;
|
||
|
|
if (input->ExpectTag(16)) goto parse_buttons;
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
// repeated bool buttons = 2;
|
||
|
|
case 2: {
|
||
|
|
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||
|
|
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||
|
|
parse_buttons:
|
||
|
|
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
|
||
|
|
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
|
||
|
|
1, 16, input, this->mutable_buttons())));
|
||
|
|
} else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
|
||
|
|
== ::google::protobuf::internal::WireFormatLite::
|
||
|
|
WIRETYPE_LENGTH_DELIMITED) {
|
||
|
|
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
|
||
|
|
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
|
||
|
|
input, this->mutable_buttons())));
|
||
|
|
} else {
|
||
|
|
goto handle_uninterpreted;
|
||
|
|
}
|
||
|
|
if (input->ExpectTag(16)) goto parse_buttons;
|
||
|
|
if (input->ExpectAtEnd()) return true;
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
default: {
|
||
|
|
handle_uninterpreted:
|
||
|
|
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||
|
|
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
DO_(::google::protobuf::internal::WireFormat::SkipField(
|
||
|
|
input, tag, mutable_unknown_fields()));
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return true;
|
||
|
|
#undef DO_
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::SerializeWithCachedSizes(
|
||
|
|
::google::protobuf::io::CodedOutputStream* output) const {
|
||
|
|
// repeated double axes = 1;
|
||
|
|
for (int i = 0; i < this->axes_size(); i++) {
|
||
|
|
::google::protobuf::internal::WireFormatLite::WriteDouble(
|
||
|
|
1, this->axes(i), output);
|
||
|
|
}
|
||
|
|
|
||
|
|
// repeated bool buttons = 2;
|
||
|
|
for (int i = 0; i < this->buttons_size(); i++) {
|
||
|
|
::google::protobuf::internal::WireFormatLite::WriteBool(
|
||
|
|
2, this->buttons(i), output);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!unknown_fields().empty()) {
|
||
|
|
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||
|
|
unknown_fields(), output);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
::google::protobuf::uint8* Joystick::SerializeWithCachedSizesToArray(
|
||
|
|
::google::protobuf::uint8* target) const {
|
||
|
|
// repeated double axes = 1;
|
||
|
|
for (int i = 0; i < this->axes_size(); i++) {
|
||
|
|
target = ::google::protobuf::internal::WireFormatLite::
|
||
|
|
WriteDoubleToArray(1, this->axes(i), target);
|
||
|
|
}
|
||
|
|
|
||
|
|
// repeated bool buttons = 2;
|
||
|
|
for (int i = 0; i < this->buttons_size(); i++) {
|
||
|
|
target = ::google::protobuf::internal::WireFormatLite::
|
||
|
|
WriteBoolToArray(2, this->buttons(i), target);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!unknown_fields().empty()) {
|
||
|
|
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||
|
|
unknown_fields(), target);
|
||
|
|
}
|
||
|
|
return target;
|
||
|
|
}
|
||
|
|
|
||
|
|
int Joystick::ByteSize() const {
|
||
|
|
int total_size = 0;
|
||
|
|
|
||
|
|
// repeated double axes = 1;
|
||
|
|
{
|
||
|
|
int data_size = 0;
|
||
|
|
data_size = 8 * this->axes_size();
|
||
|
|
total_size += 1 * this->axes_size() + data_size;
|
||
|
|
}
|
||
|
|
|
||
|
|
// repeated bool buttons = 2;
|
||
|
|
{
|
||
|
|
int data_size = 0;
|
||
|
|
data_size = 1 * this->buttons_size();
|
||
|
|
total_size += 1 * this->buttons_size() + data_size;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!unknown_fields().empty()) {
|
||
|
|
total_size +=
|
||
|
|
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
|
||
|
|
unknown_fields());
|
||
|
|
}
|
||
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||
|
|
_cached_size_ = total_size;
|
||
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||
|
|
return total_size;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::MergeFrom(const ::google::protobuf::Message& from) {
|
||
|
|
GOOGLE_CHECK_NE(&from, this);
|
||
|
|
const Joystick* source =
|
||
|
|
::google::protobuf::internal::dynamic_cast_if_available<const Joystick*>(
|
||
|
|
&from);
|
||
|
|
if (source == NULL) {
|
||
|
|
::google::protobuf::internal::ReflectionOps::Merge(from, this);
|
||
|
|
} else {
|
||
|
|
MergeFrom(*source);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::MergeFrom(const Joystick& from) {
|
||
|
|
GOOGLE_CHECK_NE(&from, this);
|
||
|
|
axes_.MergeFrom(from.axes_);
|
||
|
|
buttons_.MergeFrom(from.buttons_);
|
||
|
|
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::CopyFrom(const ::google::protobuf::Message& from) {
|
||
|
|
if (&from == this) return;
|
||
|
|
Clear();
|
||
|
|
MergeFrom(from);
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::CopyFrom(const Joystick& from) {
|
||
|
|
if (&from == this) return;
|
||
|
|
Clear();
|
||
|
|
MergeFrom(from);
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Joystick::IsInitialized() const {
|
||
|
|
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
void Joystick::Swap(Joystick* other) {
|
||
|
|
if (other != this) {
|
||
|
|
axes_.Swap(&other->axes_);
|
||
|
|
buttons_.Swap(&other->buttons_);
|
||
|
|
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||
|
|
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||
|
|
std::swap(_cached_size_, other->_cached_size_);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
::google::protobuf::Metadata Joystick::GetMetadata() const {
|
||
|
|
protobuf_AssignDescriptorsOnce();
|
||
|
|
::google::protobuf::Metadata metadata;
|
||
|
|
metadata.descriptor = Joystick_descriptor_;
|
||
|
|
metadata.reflection = Joystick_reflection_;
|
||
|
|
return metadata;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// @@protoc_insertion_point(namespace_scope)
|
||
|
|
|
||
|
|
} // namespace msgs
|
||
|
|
} // namespace gazebo
|
||
|
|
|
||
|
|
// @@protoc_insertion_point(global_scope)
|