blob: 55bbaca38d6b1984b9eea1ad7130c2046775685e [file] [log] [blame]
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: cardboard_device.proto
#include "cardboard_device.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
namespace cardboard {
constexpr DeviceParams::DeviceParams(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: left_eye_field_of_view_angles_()
, distortion_coefficients_()
, vendor_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
, model_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
, screen_to_lens_distance_(0)
, inter_lens_distance_(0)
, tray_to_lens_distance_(0)
, vertical_alignment_(0)
, primary_button_(1)
{}
struct DeviceParamsDefaultTypeInternal {
constexpr DeviceParamsDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~DeviceParamsDefaultTypeInternal() {}
union {
DeviceParams _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DeviceParamsDefaultTypeInternal _DeviceParams_default_instance_;
} // namespace cardboard
namespace cardboard {
bool DeviceParams_VerticalAlignmentType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
default:
return false;
}
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> DeviceParams_VerticalAlignmentType_strings[3] = {};
static const char DeviceParams_VerticalAlignmentType_names[] =
"BOTTOM"
"CENTER"
"TOP";
static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DeviceParams_VerticalAlignmentType_entries[] = {
{ {DeviceParams_VerticalAlignmentType_names + 0, 6}, 0 },
{ {DeviceParams_VerticalAlignmentType_names + 6, 6}, 1 },
{ {DeviceParams_VerticalAlignmentType_names + 12, 3}, 2 },
};
static const int DeviceParams_VerticalAlignmentType_entries_by_number[] = {
0, // 0 -> BOTTOM
1, // 1 -> CENTER
2, // 2 -> TOP
};
const std::string& DeviceParams_VerticalAlignmentType_Name(
DeviceParams_VerticalAlignmentType value) {
static const bool dummy =
::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
DeviceParams_VerticalAlignmentType_entries,
DeviceParams_VerticalAlignmentType_entries_by_number,
3, DeviceParams_VerticalAlignmentType_strings);
(void) dummy;
int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
DeviceParams_VerticalAlignmentType_entries,
DeviceParams_VerticalAlignmentType_entries_by_number,
3, value);
return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
DeviceParams_VerticalAlignmentType_strings[idx].get();
}
bool DeviceParams_VerticalAlignmentType_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DeviceParams_VerticalAlignmentType* value) {
int int_value;
bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
DeviceParams_VerticalAlignmentType_entries, 3, name, &int_value);
if (success) {
*value = static_cast<DeviceParams_VerticalAlignmentType>(int_value);
}
return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr DeviceParams_VerticalAlignmentType DeviceParams::BOTTOM;
constexpr DeviceParams_VerticalAlignmentType DeviceParams::CENTER;
constexpr DeviceParams_VerticalAlignmentType DeviceParams::TOP;
constexpr DeviceParams_VerticalAlignmentType DeviceParams::VerticalAlignmentType_MIN;
constexpr DeviceParams_VerticalAlignmentType DeviceParams::VerticalAlignmentType_MAX;
constexpr int DeviceParams::VerticalAlignmentType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
bool DeviceParams_ButtonType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> DeviceParams_ButtonType_strings[4] = {};
static const char DeviceParams_ButtonType_names[] =
"INDIRECT_TOUCH"
"MAGNET"
"NONE"
"TOUCH";
static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry DeviceParams_ButtonType_entries[] = {
{ {DeviceParams_ButtonType_names + 0, 14}, 3 },
{ {DeviceParams_ButtonType_names + 14, 6}, 1 },
{ {DeviceParams_ButtonType_names + 20, 4}, 0 },
{ {DeviceParams_ButtonType_names + 24, 5}, 2 },
};
static const int DeviceParams_ButtonType_entries_by_number[] = {
2, // 0 -> NONE
1, // 1 -> MAGNET
3, // 2 -> TOUCH
0, // 3 -> INDIRECT_TOUCH
};
const std::string& DeviceParams_ButtonType_Name(
DeviceParams_ButtonType value) {
static const bool dummy =
::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
DeviceParams_ButtonType_entries,
DeviceParams_ButtonType_entries_by_number,
4, DeviceParams_ButtonType_strings);
(void) dummy;
int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
DeviceParams_ButtonType_entries,
DeviceParams_ButtonType_entries_by_number,
4, value);
return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
DeviceParams_ButtonType_strings[idx].get();
}
bool DeviceParams_ButtonType_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DeviceParams_ButtonType* value) {
int int_value;
bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
DeviceParams_ButtonType_entries, 4, name, &int_value);
if (success) {
*value = static_cast<DeviceParams_ButtonType>(int_value);
}
return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr DeviceParams_ButtonType DeviceParams::NONE;
constexpr DeviceParams_ButtonType DeviceParams::MAGNET;
constexpr DeviceParams_ButtonType DeviceParams::TOUCH;
constexpr DeviceParams_ButtonType DeviceParams::INDIRECT_TOUCH;
constexpr DeviceParams_ButtonType DeviceParams::ButtonType_MIN;
constexpr DeviceParams_ButtonType DeviceParams::ButtonType_MAX;
constexpr int DeviceParams::ButtonType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
// ===================================================================
class DeviceParams::_Internal {
public:
using HasBits = decltype(std::declval<DeviceParams>()._has_bits_);
static void set_has_vendor(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_model(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
static void set_has_screen_to_lens_distance(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_inter_lens_distance(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_vertical_alignment(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
static void set_has_tray_to_lens_distance(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_primary_button(HasBits* has_bits) {
(*has_bits)[0] |= 64u;
}
};
DeviceParams::DeviceParams(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
left_eye_field_of_view_angles_(arena),
distortion_coefficients_(arena) {
SharedCtor();
if (!is_message_owned) {
RegisterArenaDtor(arena);
}
// @@protoc_insertion_point(arena_constructor:cardboard.DeviceParams)
}
DeviceParams::DeviceParams(const DeviceParams& from)
: ::PROTOBUF_NAMESPACE_ID::MessageLite(),
_has_bits_(from._has_bits_),
left_eye_field_of_view_angles_(from.left_eye_field_of_view_angles_),
distortion_coefficients_(from.distortion_coefficients_) {
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
vendor_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from._internal_has_vendor()) {
vendor_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_vendor(),
GetArenaForAllocation());
}
model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (from._internal_has_model()) {
model_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_model(),
GetArenaForAllocation());
}
::memcpy(&screen_to_lens_distance_, &from.screen_to_lens_distance_,
static_cast<size_t>(reinterpret_cast<char*>(&primary_button_) -
reinterpret_cast<char*>(&screen_to_lens_distance_)) + sizeof(primary_button_));
// @@protoc_insertion_point(copy_constructor:cardboard.DeviceParams)
}
void DeviceParams::SharedCtor() {
vendor_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
model_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
reinterpret_cast<char*>(&screen_to_lens_distance_) - reinterpret_cast<char*>(this)),
0, static_cast<size_t>(reinterpret_cast<char*>(&vertical_alignment_) -
reinterpret_cast<char*>(&screen_to_lens_distance_)) + sizeof(vertical_alignment_));
primary_button_ = 1;
}
DeviceParams::~DeviceParams() {
// @@protoc_insertion_point(destructor:cardboard.DeviceParams)
if (GetArenaForAllocation() != nullptr) return;
SharedDtor();
_internal_metadata_.Delete<std::string>();
}
inline void DeviceParams::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
vendor_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
model_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void DeviceParams::ArenaDtor(void* object) {
DeviceParams* _this = reinterpret_cast< DeviceParams* >(object);
(void)_this;
}
void DeviceParams::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void DeviceParams::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void DeviceParams::Clear() {
// @@protoc_insertion_point(message_clear_start:cardboard.DeviceParams)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
left_eye_field_of_view_angles_.Clear();
distortion_coefficients_.Clear();
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000003u) {
if (cached_has_bits & 0x00000001u) {
vendor_.ClearNonDefaultToEmpty();
}
if (cached_has_bits & 0x00000002u) {
model_.ClearNonDefaultToEmpty();
}
}
if (cached_has_bits & 0x0000007cu) {
::memset(&screen_to_lens_distance_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&vertical_alignment_) -
reinterpret_cast<char*>(&screen_to_lens_distance_)) + sizeof(vertical_alignment_));
primary_button_ = 1;
}
_has_bits_.Clear();
_internal_metadata_.Clear<std::string>();
}
const char* DeviceParams::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
_Internal::HasBits has_bits{};
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
switch (tag >> 3) {
// optional string vendor = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
auto str = _internal_mutable_vendor();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional string model = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_model();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional float screen_to_lens_distance = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
_Internal::set_has_screen_to_lens_distance(&has_bits);
screen_to_lens_distance_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else
goto handle_unusual;
continue;
// optional float inter_lens_distance = 4;
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 37)) {
_Internal::set_has_inter_lens_distance(&has_bits);
inter_lens_distance_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else
goto handle_unusual;
continue;
// repeated float left_eye_field_of_view_angles = 5 [packed = true];
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_left_eye_field_of_view_angles(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 45) {
_internal_add_left_eye_field_of_view_angles(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
ptr += sizeof(float);
} else
goto handle_unusual;
continue;
// optional float tray_to_lens_distance = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 53)) {
_Internal::set_has_tray_to_lens_distance(&has_bits);
tray_to_lens_distance_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else
goto handle_unusual;
continue;
// repeated float distortion_coefficients = 7 [packed = true];
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_distortion_coefficients(), ptr, ctx);
CHK_(ptr);
} else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 61) {
_internal_add_distortion_coefficients(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
ptr += sizeof(float);
} else
goto handle_unusual;
continue;
// optional .cardboard.DeviceParams.VerticalAlignmentType vertical_alignment = 11 [default = BOTTOM];
case 11:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::cardboard::DeviceParams_VerticalAlignmentType_IsValid(val))) {
_internal_set_vertical_alignment(static_cast<::cardboard::DeviceParams_VerticalAlignmentType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
}
} else
goto handle_unusual;
continue;
// optional .cardboard.DeviceParams.ButtonType primary_button = 12 [default = MAGNET];
case 12:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::cardboard::DeviceParams_ButtonType_IsValid(val))) {
_internal_set_primary_button(static_cast<::cardboard::DeviceParams_ButtonType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(12, val, mutable_unknown_fields());
}
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<std::string>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
_has_bits_.Or(has_bits);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* DeviceParams::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:cardboard.DeviceParams)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional string vendor = 1;
if (cached_has_bits & 0x00000001u) {
target = stream->WriteStringMaybeAliased(
1, this->_internal_vendor(), target);
}
// optional string model = 2;
if (cached_has_bits & 0x00000002u) {
target = stream->WriteStringMaybeAliased(
2, this->_internal_model(), target);
}
// optional float screen_to_lens_distance = 3;
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_screen_to_lens_distance(), target);
}
// optional float inter_lens_distance = 4;
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(4, this->_internal_inter_lens_distance(), target);
}
// repeated float left_eye_field_of_view_angles = 5 [packed = true];
if (this->_internal_left_eye_field_of_view_angles_size() > 0) {
target = stream->WriteFixedPacked(5, _internal_left_eye_field_of_view_angles(), target);
}
// optional float tray_to_lens_distance = 6;
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->_internal_tray_to_lens_distance(), target);
}
// repeated float distortion_coefficients = 7 [packed = true];
if (this->_internal_distortion_coefficients_size() > 0) {
target = stream->WriteFixedPacked(7, _internal_distortion_coefficients(), target);
}
// optional .cardboard.DeviceParams.VerticalAlignmentType vertical_alignment = 11 [default = BOTTOM];
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
11, this->_internal_vertical_alignment(), target);
}
// optional .cardboard.DeviceParams.ButtonType primary_button = 12 [default = MAGNET];
if (cached_has_bits & 0x00000040u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
12, this->_internal_primary_button(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:cardboard.DeviceParams)
return target;
}
size_t DeviceParams::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:cardboard.DeviceParams)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// repeated float left_eye_field_of_view_angles = 5 [packed = true];
{
unsigned int count = static_cast<unsigned int>(this->_internal_left_eye_field_of_view_angles_size());
size_t data_size = 4UL * count;
if (data_size > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
}
total_size += data_size;
}
// repeated float distortion_coefficients = 7 [packed = true];
{
unsigned int count = static_cast<unsigned int>(this->_internal_distortion_coefficients_size());
size_t data_size = 4UL * count;
if (data_size > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
}
total_size += data_size;
}
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
// optional string vendor = 1;
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_vendor());
}
// optional string model = 2;
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_model());
}
// optional float screen_to_lens_distance = 3;
if (cached_has_bits & 0x00000004u) {
total_size += 1 + 4;
}
// optional float inter_lens_distance = 4;
if (cached_has_bits & 0x00000008u) {
total_size += 1 + 4;
}
// optional float tray_to_lens_distance = 6;
if (cached_has_bits & 0x00000010u) {
total_size += 1 + 4;
}
// optional .cardboard.DeviceParams.VerticalAlignmentType vertical_alignment = 11 [default = BOTTOM];
if (cached_has_bits & 0x00000020u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertical_alignment());
}
// optional .cardboard.DeviceParams.ButtonType primary_button = 12 [default = MAGNET];
if (cached_has_bits & 0x00000040u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_primary_button());
}
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void DeviceParams::CheckTypeAndMergeFrom(
const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const DeviceParams*>(
&from));
}
void DeviceParams::MergeFrom(const DeviceParams& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:cardboard.DeviceParams)
GOOGLE_DCHECK_NE(&from, this);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
left_eye_field_of_view_angles_.MergeFrom(from.left_eye_field_of_view_angles_);
distortion_coefficients_.MergeFrom(from.distortion_coefficients_);
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 0x0000007fu) {
if (cached_has_bits & 0x00000001u) {
_internal_set_vendor(from._internal_vendor());
}
if (cached_has_bits & 0x00000002u) {
_internal_set_model(from._internal_model());
}
if (cached_has_bits & 0x00000004u) {
screen_to_lens_distance_ = from.screen_to_lens_distance_;
}
if (cached_has_bits & 0x00000008u) {
inter_lens_distance_ = from.inter_lens_distance_;
}
if (cached_has_bits & 0x00000010u) {
tray_to_lens_distance_ = from.tray_to_lens_distance_;
}
if (cached_has_bits & 0x00000020u) {
vertical_alignment_ = from.vertical_alignment_;
}
if (cached_has_bits & 0x00000040u) {
primary_button_ = from.primary_button_;
}
_has_bits_[0] |= cached_has_bits;
}
_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}
void DeviceParams::CopyFrom(const DeviceParams& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:cardboard.DeviceParams)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool DeviceParams::IsInitialized() const {
return true;
}
void DeviceParams::InternalSwap(DeviceParams* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
left_eye_field_of_view_angles_.InternalSwap(&other->left_eye_field_of_view_angles_);
distortion_coefficients_.InternalSwap(&other->distortion_coefficients_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
&vendor_, lhs_arena,
&other->vendor_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
&model_, lhs_arena,
&other->model_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(DeviceParams, vertical_alignment_)
+ sizeof(DeviceParams::vertical_alignment_)
- PROTOBUF_FIELD_OFFSET(DeviceParams, screen_to_lens_distance_)>(
reinterpret_cast<char*>(&screen_to_lens_distance_),
reinterpret_cast<char*>(&other->screen_to_lens_distance_));
swap(primary_button_, other->primary_button_);
}
std::string DeviceParams::GetTypeName() const {
return "cardboard.DeviceParams";
}
// @@protoc_insertion_point(namespace_scope)
} // namespace cardboard
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::cardboard::DeviceParams* Arena::CreateMaybeMessage< ::cardboard::DeviceParams >(Arena* arena) {
return Arena::CreateMessageInternal< ::cardboard::DeviceParams >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>