From 68397c840eeb811985d222485c23f855e5f76ac7 Mon Sep 17 00:00:00 2001 From: Melky-Phoe Date: Thu, 15 Feb 2024 10:14:24 +0100 Subject: [PATCH] Added ExampleModule protobuf files (#14) * Added ExampleModule protobuf files * Rename Protobuf files --- .../protobuf_parsing_example/CMakeLists.txt | 4 +- .../include/ModuleMaintainer.hpp | 2 +- .../include/ProtocolMaintainer.hpp | 2 +- .../lib/protobuf/ProtobufModule.pb.cc | 1394 +++++++++++++++++ .../lib/protobuf/ProtobufModule.pb.h | 1330 ++++++++++++++++ examples/protobuf_parsing_example/main.cpp | 2 +- 6 files changed, 2729 insertions(+), 5 deletions(-) create mode 100644 examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.cc create mode 100644 examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.h diff --git a/examples/protobuf_parsing_example/CMakeLists.txt b/examples/protobuf_parsing_example/CMakeLists.txt index 1a580f6..d0ee08d 100644 --- a/examples/protobuf_parsing_example/CMakeLists.txt +++ b/examples/protobuf_parsing_example/CMakeLists.txt @@ -5,9 +5,9 @@ SET(CMAKE_CXX_STANDARD 20) SET(CMAKE_BUILD_RPATH_USE_ORIGIN ON) -FILE(GLOB_RECURSE source_files "source/*") +FILE(GLOB_RECURSE source_files "source/*" "lib/protobuf/*") ADD_LIBRARY(parsing_example_lib STATIC ${source_files}) -TARGET_INCLUDE_DIRECTORIES(parsing_example_lib PUBLIC "include/") +TARGET_INCLUDE_DIRECTORIES(parsing_example_lib PUBLIC "include/" "lib/protobuf/") TARGET_LINK_LIBRARIES(parsing_example_lib PUBLIC ${PROJECT_NAME}::protobuf_cpp) diff --git a/examples/protobuf_parsing_example/include/ModuleMaintainer.hpp b/examples/protobuf_parsing_example/include/ModuleMaintainer.hpp index 320c1d4..0e454ec 100644 --- a/examples/protobuf_parsing_example/include/ModuleMaintainer.hpp +++ b/examples/protobuf_parsing_example/include/ModuleMaintainer.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include diff --git a/examples/protobuf_parsing_example/include/ProtocolMaintainer.hpp b/examples/protobuf_parsing_example/include/ProtocolMaintainer.hpp index 1ef8b88..162af9e 100644 --- a/examples/protobuf_parsing_example/include/ProtocolMaintainer.hpp +++ b/examples/protobuf_parsing_example/include/ProtocolMaintainer.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include diff --git a/examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.cc b/examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.cc new file mode 100644 index 0000000..7c1ef29 --- /dev/null +++ b/examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.cc @@ -0,0 +1,1394 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: modules/ExampleModule.proto + +#include "ProtobufModule.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace ExampleModule { +PROTOBUF_CONSTEXPR BlinkerStatus::BlinkerStatus( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.isflashing_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct BlinkerStatusDefaultTypeInternal { + PROTOBUF_CONSTEXPR BlinkerStatusDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~BlinkerStatusDefaultTypeInternal() {} + union { + BlinkerStatus _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BlinkerStatusDefaultTypeInternal _BlinkerStatus_default_instance_; +PROTOBUF_CONSTEXPR LightsStatus::LightsStatus( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.ison_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct LightsStatusDefaultTypeInternal { + PROTOBUF_CONSTEXPR LightsStatusDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~LightsStatusDefaultTypeInternal() {} + union { + LightsStatus _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LightsStatusDefaultTypeInternal _LightsStatus_default_instance_; +PROTOBUF_CONSTEXPR BlinkerCommand::BlinkerCommand( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.command_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct BlinkerCommandDefaultTypeInternal { + PROTOBUF_CONSTEXPR BlinkerCommandDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~BlinkerCommandDefaultTypeInternal() {} + union { + BlinkerCommand _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BlinkerCommandDefaultTypeInternal _BlinkerCommand_default_instance_; +PROTOBUF_CONSTEXPR LightsCommand::LightsCommand( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.command_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct LightsCommandDefaultTypeInternal { + PROTOBUF_CONSTEXPR LightsCommandDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~LightsCommandDefaultTypeInternal() {} + union { + LightsCommand _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LightsCommandDefaultTypeInternal _LightsCommand_default_instance_; +PROTOBUF_CONSTEXPR BlinkerError::BlinkerError( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.errormessage_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct BlinkerErrorDefaultTypeInternal { + PROTOBUF_CONSTEXPR BlinkerErrorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~BlinkerErrorDefaultTypeInternal() {} + union { + BlinkerError _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BlinkerErrorDefaultTypeInternal _BlinkerError_default_instance_; +PROTOBUF_CONSTEXPR LightsError::LightsError( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.errormessage_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_._cached_size_)*/{}} {} +struct LightsErrorDefaultTypeInternal { + PROTOBUF_CONSTEXPR LightsErrorDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~LightsErrorDefaultTypeInternal() {} + union { + LightsError _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LightsErrorDefaultTypeInternal _LightsError_default_instance_; +} // namespace ExampleModule +static ::_pb::Metadata file_level_metadata_modules_2fExampleModule_2eproto[6]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_modules_2fExampleModule_2eproto[2]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_modules_2fExampleModule_2eproto = nullptr; + +const uint32_t TableStruct_modules_2fExampleModule_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::BlinkerStatus, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::BlinkerStatus, _impl_.isflashing_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::LightsStatus, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::LightsStatus, _impl_.ison_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::BlinkerCommand, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::BlinkerCommand, _impl_.command_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::LightsCommand, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::LightsCommand, _impl_.command_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::BlinkerError, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::BlinkerError, _impl_.errormessage_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::LightsError, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::ExampleModule::LightsError, _impl_.errormessage_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::ExampleModule::BlinkerStatus)}, + { 7, -1, -1, sizeof(::ExampleModule::LightsStatus)}, + { 14, -1, -1, sizeof(::ExampleModule::BlinkerCommand)}, + { 21, -1, -1, sizeof(::ExampleModule::LightsCommand)}, + { 28, -1, -1, sizeof(::ExampleModule::BlinkerError)}, + { 35, -1, -1, sizeof(::ExampleModule::LightsError)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::ExampleModule::_BlinkerStatus_default_instance_._instance, + &::ExampleModule::_LightsStatus_default_instance_._instance, + &::ExampleModule::_BlinkerCommand_default_instance_._instance, + &::ExampleModule::_LightsCommand_default_instance_._instance, + &::ExampleModule::_BlinkerError_default_instance_._instance, + &::ExampleModule::_LightsError_default_instance_._instance, +}; + +const char descriptor_table_protodef_modules_2fExampleModule_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\033modules/ExampleModule.proto\022\rExampleMo" + "dule\"#\n\rBlinkerStatus\022\022\n\nisFlashing\030\001 \001(" + "\010\"\034\n\014LightsStatus\022\014\n\004isOn\030\001 \001(\010\"n\n\016Blink" + "erCommand\0226\n\007command\030\001 \001(\0162%.ExampleModu" + "le.BlinkerCommand.Command\"$\n\007Command\022\013\n\007" + "TURN_ON\020\000\022\014\n\010TURN_OFF\020\001\"\\\n\rLightsCommand" + "\0225\n\007command\030\001 \001(\0162$.ExampleModule.Lights" + "Command.Command\"\024\n\007Command\022\t\n\005PRESS\020\000\"$\n" + "\014BlinkerError\022\024\n\014errorMessage\030\001 \001(\t\"#\n\013L" + "ightsError\022\024\n\014errorMessage\030\001 \001(\tB>Z!../i" + "nternal/pkg/ba_proto;ba_proto\252\002\030Google.P" + "rotobuf.ba_protob\006proto3" + ; +static ::_pbi::once_flag descriptor_table_modules_2fExampleModule_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_modules_2fExampleModule_2eproto = { + false, false, 464, descriptor_table_protodef_modules_2fExampleModule_2eproto, + "modules/ExampleModule.proto", + &descriptor_table_modules_2fExampleModule_2eproto_once, nullptr, 0, 6, + schemas, file_default_instances, TableStruct_modules_2fExampleModule_2eproto::offsets, + file_level_metadata_modules_2fExampleModule_2eproto, file_level_enum_descriptors_modules_2fExampleModule_2eproto, + file_level_service_descriptors_modules_2fExampleModule_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_modules_2fExampleModule_2eproto_getter() { + return &descriptor_table_modules_2fExampleModule_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_modules_2fExampleModule_2eproto(&descriptor_table_modules_2fExampleModule_2eproto); +namespace ExampleModule { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* BlinkerCommand_Command_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_modules_2fExampleModule_2eproto); + return file_level_enum_descriptors_modules_2fExampleModule_2eproto[0]; +} +bool BlinkerCommand_Command_IsValid(int value) { + switch (value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +constexpr BlinkerCommand_Command BlinkerCommand::TURN_ON; +constexpr BlinkerCommand_Command BlinkerCommand::TURN_OFF; +constexpr BlinkerCommand_Command BlinkerCommand::Command_MIN; +constexpr BlinkerCommand_Command BlinkerCommand::Command_MAX; +constexpr int BlinkerCommand::Command_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LightsCommand_Command_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_modules_2fExampleModule_2eproto); + return file_level_enum_descriptors_modules_2fExampleModule_2eproto[1]; +} +bool LightsCommand_Command_IsValid(int value) { + switch (value) { + case 0: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +constexpr LightsCommand_Command LightsCommand::PRESS; +constexpr LightsCommand_Command LightsCommand::Command_MIN; +constexpr LightsCommand_Command LightsCommand::Command_MAX; +constexpr int LightsCommand::Command_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) + +// =================================================================== + +class BlinkerStatus::_Internal { + public: +}; + +BlinkerStatus::BlinkerStatus(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:ExampleModule.BlinkerStatus) +} +BlinkerStatus::BlinkerStatus(const BlinkerStatus& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + BlinkerStatus* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.isflashing_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.isflashing_ = from._impl_.isflashing_; + // @@protoc_insertion_point(copy_constructor:ExampleModule.BlinkerStatus) +} + +inline void BlinkerStatus::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.isflashing_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +BlinkerStatus::~BlinkerStatus() { + // @@protoc_insertion_point(destructor:ExampleModule.BlinkerStatus) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void BlinkerStatus::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void BlinkerStatus::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void BlinkerStatus::Clear() { +// @@protoc_insertion_point(message_clear_start:ExampleModule.BlinkerStatus) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.isflashing_ = false; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* BlinkerStatus::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool isFlashing = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.isflashing_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* BlinkerStatus::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ExampleModule.BlinkerStatus) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool isFlashing = 1; + if (this->_internal_isflashing() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_isflashing(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ExampleModule.BlinkerStatus) + return target; +} + +size_t BlinkerStatus::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ExampleModule.BlinkerStatus) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool isFlashing = 1; + if (this->_internal_isflashing() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BlinkerStatus::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + BlinkerStatus::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BlinkerStatus::GetClassData() const { return &_class_data_; } + + +void BlinkerStatus::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:ExampleModule.BlinkerStatus) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_isflashing() != 0) { + _this->_internal_set_isflashing(from._internal_isflashing()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void BlinkerStatus::CopyFrom(const BlinkerStatus& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ExampleModule.BlinkerStatus) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlinkerStatus::IsInitialized() const { + return true; +} + +void BlinkerStatus::InternalSwap(BlinkerStatus* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.isflashing_, other->_impl_.isflashing_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata BlinkerStatus::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_modules_2fExampleModule_2eproto_getter, &descriptor_table_modules_2fExampleModule_2eproto_once, + file_level_metadata_modules_2fExampleModule_2eproto[0]); +} + +// =================================================================== + +class LightsStatus::_Internal { + public: +}; + +LightsStatus::LightsStatus(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:ExampleModule.LightsStatus) +} +LightsStatus::LightsStatus(const LightsStatus& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + LightsStatus* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.ison_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.ison_ = from._impl_.ison_; + // @@protoc_insertion_point(copy_constructor:ExampleModule.LightsStatus) +} + +inline void LightsStatus::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.ison_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +LightsStatus::~LightsStatus() { + // @@protoc_insertion_point(destructor:ExampleModule.LightsStatus) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void LightsStatus::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void LightsStatus::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void LightsStatus::Clear() { +// @@protoc_insertion_point(message_clear_start:ExampleModule.LightsStatus) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.ison_ = false; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* LightsStatus::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool isOn = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.ison_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* LightsStatus::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ExampleModule.LightsStatus) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool isOn = 1; + if (this->_internal_ison() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_ison(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ExampleModule.LightsStatus) + return target; +} + +size_t LightsStatus::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ExampleModule.LightsStatus) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool isOn = 1; + if (this->_internal_ison() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LightsStatus::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + LightsStatus::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LightsStatus::GetClassData() const { return &_class_data_; } + + +void LightsStatus::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:ExampleModule.LightsStatus) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_ison() != 0) { + _this->_internal_set_ison(from._internal_ison()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void LightsStatus::CopyFrom(const LightsStatus& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ExampleModule.LightsStatus) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LightsStatus::IsInitialized() const { + return true; +} + +void LightsStatus::InternalSwap(LightsStatus* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.ison_, other->_impl_.ison_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata LightsStatus::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_modules_2fExampleModule_2eproto_getter, &descriptor_table_modules_2fExampleModule_2eproto_once, + file_level_metadata_modules_2fExampleModule_2eproto[1]); +} + +// =================================================================== + +class BlinkerCommand::_Internal { + public: +}; + +BlinkerCommand::BlinkerCommand(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:ExampleModule.BlinkerCommand) +} +BlinkerCommand::BlinkerCommand(const BlinkerCommand& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + BlinkerCommand* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.command_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.command_ = from._impl_.command_; + // @@protoc_insertion_point(copy_constructor:ExampleModule.BlinkerCommand) +} + +inline void BlinkerCommand::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.command_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +BlinkerCommand::~BlinkerCommand() { + // @@protoc_insertion_point(destructor:ExampleModule.BlinkerCommand) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void BlinkerCommand::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void BlinkerCommand::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void BlinkerCommand::Clear() { +// @@protoc_insertion_point(message_clear_start:ExampleModule.BlinkerCommand) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.command_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* BlinkerCommand::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .ExampleModule.BlinkerCommand.Command command = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_command(static_cast<::ExampleModule::BlinkerCommand_Command>(val)); + } 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* BlinkerCommand::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ExampleModule.BlinkerCommand) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .ExampleModule.BlinkerCommand.Command command = 1; + if (this->_internal_command() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_command(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ExampleModule.BlinkerCommand) + return target; +} + +size_t BlinkerCommand::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ExampleModule.BlinkerCommand) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .ExampleModule.BlinkerCommand.Command command = 1; + if (this->_internal_command() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_command()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BlinkerCommand::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + BlinkerCommand::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BlinkerCommand::GetClassData() const { return &_class_data_; } + + +void BlinkerCommand::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:ExampleModule.BlinkerCommand) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_command() != 0) { + _this->_internal_set_command(from._internal_command()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void BlinkerCommand::CopyFrom(const BlinkerCommand& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ExampleModule.BlinkerCommand) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlinkerCommand::IsInitialized() const { + return true; +} + +void BlinkerCommand::InternalSwap(BlinkerCommand* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.command_, other->_impl_.command_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata BlinkerCommand::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_modules_2fExampleModule_2eproto_getter, &descriptor_table_modules_2fExampleModule_2eproto_once, + file_level_metadata_modules_2fExampleModule_2eproto[2]); +} + +// =================================================================== + +class LightsCommand::_Internal { + public: +}; + +LightsCommand::LightsCommand(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:ExampleModule.LightsCommand) +} +LightsCommand::LightsCommand(const LightsCommand& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + LightsCommand* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.command_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _this->_impl_.command_ = from._impl_.command_; + // @@protoc_insertion_point(copy_constructor:ExampleModule.LightsCommand) +} + +inline void LightsCommand::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.command_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +LightsCommand::~LightsCommand() { + // @@protoc_insertion_point(destructor:ExampleModule.LightsCommand) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void LightsCommand::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void LightsCommand::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void LightsCommand::Clear() { +// @@protoc_insertion_point(message_clear_start:ExampleModule.LightsCommand) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.command_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* LightsCommand::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .ExampleModule.LightsCommand.Command command = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_command(static_cast<::ExampleModule::LightsCommand_Command>(val)); + } 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* LightsCommand::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ExampleModule.LightsCommand) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .ExampleModule.LightsCommand.Command command = 1; + if (this->_internal_command() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_command(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ExampleModule.LightsCommand) + return target; +} + +size_t LightsCommand::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ExampleModule.LightsCommand) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .ExampleModule.LightsCommand.Command command = 1; + if (this->_internal_command() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_command()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LightsCommand::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + LightsCommand::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LightsCommand::GetClassData() const { return &_class_data_; } + + +void LightsCommand::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:ExampleModule.LightsCommand) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_command() != 0) { + _this->_internal_set_command(from._internal_command()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void LightsCommand::CopyFrom(const LightsCommand& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ExampleModule.LightsCommand) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LightsCommand::IsInitialized() const { + return true; +} + +void LightsCommand::InternalSwap(LightsCommand* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.command_, other->_impl_.command_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata LightsCommand::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_modules_2fExampleModule_2eproto_getter, &descriptor_table_modules_2fExampleModule_2eproto_once, + file_level_metadata_modules_2fExampleModule_2eproto[3]); +} + +// =================================================================== + +class BlinkerError::_Internal { + public: +}; + +BlinkerError::BlinkerError(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:ExampleModule.BlinkerError) +} +BlinkerError::BlinkerError(const BlinkerError& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + BlinkerError* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.errormessage_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.errormessage_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.errormessage_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_errormessage().empty()) { + _this->_impl_.errormessage_.Set(from._internal_errormessage(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:ExampleModule.BlinkerError) +} + +inline void BlinkerError::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.errormessage_){} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.errormessage_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.errormessage_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +BlinkerError::~BlinkerError() { + // @@protoc_insertion_point(destructor:ExampleModule.BlinkerError) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void BlinkerError::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.errormessage_.Destroy(); +} + +void BlinkerError::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void BlinkerError::Clear() { +// @@protoc_insertion_point(message_clear_start:ExampleModule.BlinkerError) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.errormessage_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* BlinkerError::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string errorMessage = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_errormessage(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "ExampleModule.BlinkerError.errorMessage")); + } 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* BlinkerError::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ExampleModule.BlinkerError) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string errorMessage = 1; + if (!this->_internal_errormessage().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_errormessage().data(), static_cast(this->_internal_errormessage().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "ExampleModule.BlinkerError.errorMessage"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_errormessage(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ExampleModule.BlinkerError) + return target; +} + +size_t BlinkerError::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ExampleModule.BlinkerError) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string errorMessage = 1; + if (!this->_internal_errormessage().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_errormessage()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BlinkerError::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + BlinkerError::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BlinkerError::GetClassData() const { return &_class_data_; } + + +void BlinkerError::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:ExampleModule.BlinkerError) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_errormessage().empty()) { + _this->_internal_set_errormessage(from._internal_errormessage()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void BlinkerError::CopyFrom(const BlinkerError& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ExampleModule.BlinkerError) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool BlinkerError::IsInitialized() const { + return true; +} + +void BlinkerError::InternalSwap(BlinkerError* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.errormessage_, lhs_arena, + &other->_impl_.errormessage_, rhs_arena + ); +} + +::PROTOBUF_NAMESPACE_ID::Metadata BlinkerError::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_modules_2fExampleModule_2eproto_getter, &descriptor_table_modules_2fExampleModule_2eproto_once, + file_level_metadata_modules_2fExampleModule_2eproto[4]); +} + +// =================================================================== + +class LightsError::_Internal { + public: +}; + +LightsError::LightsError(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:ExampleModule.LightsError) +} +LightsError::LightsError(const LightsError& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + LightsError* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.errormessage_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.errormessage_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.errormessage_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_errormessage().empty()) { + _this->_impl_.errormessage_.Set(from._internal_errormessage(), + _this->GetArenaForAllocation()); + } + // @@protoc_insertion_point(copy_constructor:ExampleModule.LightsError) +} + +inline void LightsError::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.errormessage_){} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.errormessage_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.errormessage_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +LightsError::~LightsError() { + // @@protoc_insertion_point(destructor:ExampleModule.LightsError) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void LightsError::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.errormessage_.Destroy(); +} + +void LightsError::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void LightsError::Clear() { +// @@protoc_insertion_point(message_clear_start:ExampleModule.LightsError) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.errormessage_.ClearToEmpty(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* LightsError::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string errorMessage = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_errormessage(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "ExampleModule.LightsError.errorMessage")); + } 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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* LightsError::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:ExampleModule.LightsError) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string errorMessage = 1; + if (!this->_internal_errormessage().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_errormessage().data(), static_cast(this->_internal_errormessage().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "ExampleModule.LightsError.errorMessage"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_errormessage(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:ExampleModule.LightsError) + return target; +} + +size_t LightsError::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:ExampleModule.LightsError) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string errorMessage = 1; + if (!this->_internal_errormessage().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_errormessage()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData LightsError::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + LightsError::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*LightsError::GetClassData() const { return &_class_data_; } + + +void LightsError::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:ExampleModule.LightsError) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_errormessage().empty()) { + _this->_internal_set_errormessage(from._internal_errormessage()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void LightsError::CopyFrom(const LightsError& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:ExampleModule.LightsError) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool LightsError::IsInitialized() const { + return true; +} + +void LightsError::InternalSwap(LightsError* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.errormessage_, lhs_arena, + &other->_impl_.errormessage_, rhs_arena + ); +} + +::PROTOBUF_NAMESPACE_ID::Metadata LightsError::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_modules_2fExampleModule_2eproto_getter, &descriptor_table_modules_2fExampleModule_2eproto_once, + file_level_metadata_modules_2fExampleModule_2eproto[5]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace ExampleModule +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::ExampleModule::BlinkerStatus* +Arena::CreateMaybeMessage< ::ExampleModule::BlinkerStatus >(Arena* arena) { + return Arena::CreateMessageInternal< ::ExampleModule::BlinkerStatus >(arena); +} +template<> PROTOBUF_NOINLINE ::ExampleModule::LightsStatus* +Arena::CreateMaybeMessage< ::ExampleModule::LightsStatus >(Arena* arena) { + return Arena::CreateMessageInternal< ::ExampleModule::LightsStatus >(arena); +} +template<> PROTOBUF_NOINLINE ::ExampleModule::BlinkerCommand* +Arena::CreateMaybeMessage< ::ExampleModule::BlinkerCommand >(Arena* arena) { + return Arena::CreateMessageInternal< ::ExampleModule::BlinkerCommand >(arena); +} +template<> PROTOBUF_NOINLINE ::ExampleModule::LightsCommand* +Arena::CreateMaybeMessage< ::ExampleModule::LightsCommand >(Arena* arena) { + return Arena::CreateMessageInternal< ::ExampleModule::LightsCommand >(arena); +} +template<> PROTOBUF_NOINLINE ::ExampleModule::BlinkerError* +Arena::CreateMaybeMessage< ::ExampleModule::BlinkerError >(Arena* arena) { + return Arena::CreateMessageInternal< ::ExampleModule::BlinkerError >(arena); +} +template<> PROTOBUF_NOINLINE ::ExampleModule::LightsError* +Arena::CreateMaybeMessage< ::ExampleModule::LightsError >(Arena* arena) { + return Arena::CreateMessageInternal< ::ExampleModule::LightsError >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.h b/examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.h new file mode 100644 index 0000000..7d6ac6a --- /dev/null +++ b/examples/protobuf_parsing_example/lib/protobuf/ProtobufModule.pb.h @@ -0,0 +1,1330 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: modules/ExampleModule.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_modules_2fExampleModule_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_modules_2fExampleModule_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_modules_2fExampleModule_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_modules_2fExampleModule_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_modules_2fExampleModule_2eproto; +namespace ExampleModule { +class BlinkerCommand; +struct BlinkerCommandDefaultTypeInternal; +extern BlinkerCommandDefaultTypeInternal _BlinkerCommand_default_instance_; +class BlinkerError; +struct BlinkerErrorDefaultTypeInternal; +extern BlinkerErrorDefaultTypeInternal _BlinkerError_default_instance_; +class BlinkerStatus; +struct BlinkerStatusDefaultTypeInternal; +extern BlinkerStatusDefaultTypeInternal _BlinkerStatus_default_instance_; +class LightsCommand; +struct LightsCommandDefaultTypeInternal; +extern LightsCommandDefaultTypeInternal _LightsCommand_default_instance_; +class LightsError; +struct LightsErrorDefaultTypeInternal; +extern LightsErrorDefaultTypeInternal _LightsError_default_instance_; +class LightsStatus; +struct LightsStatusDefaultTypeInternal; +extern LightsStatusDefaultTypeInternal _LightsStatus_default_instance_; +} // namespace ExampleModule +PROTOBUF_NAMESPACE_OPEN +template<> ::ExampleModule::BlinkerCommand* Arena::CreateMaybeMessage<::ExampleModule::BlinkerCommand>(Arena*); +template<> ::ExampleModule::BlinkerError* Arena::CreateMaybeMessage<::ExampleModule::BlinkerError>(Arena*); +template<> ::ExampleModule::BlinkerStatus* Arena::CreateMaybeMessage<::ExampleModule::BlinkerStatus>(Arena*); +template<> ::ExampleModule::LightsCommand* Arena::CreateMaybeMessage<::ExampleModule::LightsCommand>(Arena*); +template<> ::ExampleModule::LightsError* Arena::CreateMaybeMessage<::ExampleModule::LightsError>(Arena*); +template<> ::ExampleModule::LightsStatus* Arena::CreateMaybeMessage<::ExampleModule::LightsStatus>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace ExampleModule { + +enum BlinkerCommand_Command : int { + BlinkerCommand_Command_TURN_ON = 0, + BlinkerCommand_Command_TURN_OFF = 1, + BlinkerCommand_Command_BlinkerCommand_Command_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + BlinkerCommand_Command_BlinkerCommand_Command_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool BlinkerCommand_Command_IsValid(int value); +constexpr BlinkerCommand_Command BlinkerCommand_Command_Command_MIN = BlinkerCommand_Command_TURN_ON; +constexpr BlinkerCommand_Command BlinkerCommand_Command_Command_MAX = BlinkerCommand_Command_TURN_OFF; +constexpr int BlinkerCommand_Command_Command_ARRAYSIZE = BlinkerCommand_Command_Command_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* BlinkerCommand_Command_descriptor(); +template +inline const std::string& BlinkerCommand_Command_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function BlinkerCommand_Command_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + BlinkerCommand_Command_descriptor(), enum_t_value); +} +inline bool BlinkerCommand_Command_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, BlinkerCommand_Command* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + BlinkerCommand_Command_descriptor(), name, value); +} +enum LightsCommand_Command : int { + LightsCommand_Command_PRESS = 0, + LightsCommand_Command_LightsCommand_Command_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + LightsCommand_Command_LightsCommand_Command_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool LightsCommand_Command_IsValid(int value); +constexpr LightsCommand_Command LightsCommand_Command_Command_MIN = LightsCommand_Command_PRESS; +constexpr LightsCommand_Command LightsCommand_Command_Command_MAX = LightsCommand_Command_PRESS; +constexpr int LightsCommand_Command_Command_ARRAYSIZE = LightsCommand_Command_Command_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LightsCommand_Command_descriptor(); +template +inline const std::string& LightsCommand_Command_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function LightsCommand_Command_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + LightsCommand_Command_descriptor(), enum_t_value); +} +inline bool LightsCommand_Command_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, LightsCommand_Command* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + LightsCommand_Command_descriptor(), name, value); +} +// =================================================================== + +class BlinkerStatus final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ExampleModule.BlinkerStatus) */ { + public: + inline BlinkerStatus() : BlinkerStatus(nullptr) {} + ~BlinkerStatus() override; + explicit PROTOBUF_CONSTEXPR BlinkerStatus(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + BlinkerStatus(const BlinkerStatus& from); + BlinkerStatus(BlinkerStatus&& from) noexcept + : BlinkerStatus() { + *this = ::std::move(from); + } + + inline BlinkerStatus& operator=(const BlinkerStatus& from) { + CopyFrom(from); + return *this; + } + inline BlinkerStatus& operator=(BlinkerStatus&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const BlinkerStatus& default_instance() { + return *internal_default_instance(); + } + static inline const BlinkerStatus* internal_default_instance() { + return reinterpret_cast( + &_BlinkerStatus_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(BlinkerStatus& a, BlinkerStatus& b) { + a.Swap(&b); + } + inline void Swap(BlinkerStatus* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(BlinkerStatus* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + BlinkerStatus* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const BlinkerStatus& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const BlinkerStatus& from) { + BlinkerStatus::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BlinkerStatus* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ExampleModule.BlinkerStatus"; + } + protected: + explicit BlinkerStatus(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kIsFlashingFieldNumber = 1, + }; + // bool isFlashing = 1; + void clear_isflashing(); + bool isflashing() const; + void set_isflashing(bool value); + private: + bool _internal_isflashing() const; + void _internal_set_isflashing(bool value); + public: + + // @@protoc_insertion_point(class_scope:ExampleModule.BlinkerStatus) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool isflashing_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_modules_2fExampleModule_2eproto; +}; +// ------------------------------------------------------------------- + +class LightsStatus final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ExampleModule.LightsStatus) */ { + public: + inline LightsStatus() : LightsStatus(nullptr) {} + ~LightsStatus() override; + explicit PROTOBUF_CONSTEXPR LightsStatus(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + LightsStatus(const LightsStatus& from); + LightsStatus(LightsStatus&& from) noexcept + : LightsStatus() { + *this = ::std::move(from); + } + + inline LightsStatus& operator=(const LightsStatus& from) { + CopyFrom(from); + return *this; + } + inline LightsStatus& operator=(LightsStatus&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const LightsStatus& default_instance() { + return *internal_default_instance(); + } + static inline const LightsStatus* internal_default_instance() { + return reinterpret_cast( + &_LightsStatus_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(LightsStatus& a, LightsStatus& b) { + a.Swap(&b); + } + inline void Swap(LightsStatus* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(LightsStatus* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + LightsStatus* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const LightsStatus& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const LightsStatus& from) { + LightsStatus::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LightsStatus* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ExampleModule.LightsStatus"; + } + protected: + explicit LightsStatus(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kIsOnFieldNumber = 1, + }; + // bool isOn = 1; + void clear_ison(); + bool ison() const; + void set_ison(bool value); + private: + bool _internal_ison() const; + void _internal_set_ison(bool value); + public: + + // @@protoc_insertion_point(class_scope:ExampleModule.LightsStatus) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool ison_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_modules_2fExampleModule_2eproto; +}; +// ------------------------------------------------------------------- + +class BlinkerCommand final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ExampleModule.BlinkerCommand) */ { + public: + inline BlinkerCommand() : BlinkerCommand(nullptr) {} + ~BlinkerCommand() override; + explicit PROTOBUF_CONSTEXPR BlinkerCommand(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + BlinkerCommand(const BlinkerCommand& from); + BlinkerCommand(BlinkerCommand&& from) noexcept + : BlinkerCommand() { + *this = ::std::move(from); + } + + inline BlinkerCommand& operator=(const BlinkerCommand& from) { + CopyFrom(from); + return *this; + } + inline BlinkerCommand& operator=(BlinkerCommand&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const BlinkerCommand& default_instance() { + return *internal_default_instance(); + } + static inline const BlinkerCommand* internal_default_instance() { + return reinterpret_cast( + &_BlinkerCommand_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(BlinkerCommand& a, BlinkerCommand& b) { + a.Swap(&b); + } + inline void Swap(BlinkerCommand* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(BlinkerCommand* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + BlinkerCommand* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const BlinkerCommand& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const BlinkerCommand& from) { + BlinkerCommand::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BlinkerCommand* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ExampleModule.BlinkerCommand"; + } + protected: + explicit BlinkerCommand(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef BlinkerCommand_Command Command; + static constexpr Command TURN_ON = + BlinkerCommand_Command_TURN_ON; + static constexpr Command TURN_OFF = + BlinkerCommand_Command_TURN_OFF; + static inline bool Command_IsValid(int value) { + return BlinkerCommand_Command_IsValid(value); + } + static constexpr Command Command_MIN = + BlinkerCommand_Command_Command_MIN; + static constexpr Command Command_MAX = + BlinkerCommand_Command_Command_MAX; + static constexpr int Command_ARRAYSIZE = + BlinkerCommand_Command_Command_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Command_descriptor() { + return BlinkerCommand_Command_descriptor(); + } + template + static inline const std::string& Command_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Command_Name."); + return BlinkerCommand_Command_Name(enum_t_value); + } + static inline bool Command_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Command* value) { + return BlinkerCommand_Command_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kCommandFieldNumber = 1, + }; + // .ExampleModule.BlinkerCommand.Command command = 1; + void clear_command(); + ::ExampleModule::BlinkerCommand_Command command() const; + void set_command(::ExampleModule::BlinkerCommand_Command value); + private: + ::ExampleModule::BlinkerCommand_Command _internal_command() const; + void _internal_set_command(::ExampleModule::BlinkerCommand_Command value); + public: + + // @@protoc_insertion_point(class_scope:ExampleModule.BlinkerCommand) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int command_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_modules_2fExampleModule_2eproto; +}; +// ------------------------------------------------------------------- + +class LightsCommand final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ExampleModule.LightsCommand) */ { + public: + inline LightsCommand() : LightsCommand(nullptr) {} + ~LightsCommand() override; + explicit PROTOBUF_CONSTEXPR LightsCommand(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + LightsCommand(const LightsCommand& from); + LightsCommand(LightsCommand&& from) noexcept + : LightsCommand() { + *this = ::std::move(from); + } + + inline LightsCommand& operator=(const LightsCommand& from) { + CopyFrom(from); + return *this; + } + inline LightsCommand& operator=(LightsCommand&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const LightsCommand& default_instance() { + return *internal_default_instance(); + } + static inline const LightsCommand* internal_default_instance() { + return reinterpret_cast( + &_LightsCommand_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(LightsCommand& a, LightsCommand& b) { + a.Swap(&b); + } + inline void Swap(LightsCommand* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(LightsCommand* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + LightsCommand* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const LightsCommand& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const LightsCommand& from) { + LightsCommand::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LightsCommand* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ExampleModule.LightsCommand"; + } + protected: + explicit LightsCommand(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef LightsCommand_Command Command; + static constexpr Command PRESS = + LightsCommand_Command_PRESS; + static inline bool Command_IsValid(int value) { + return LightsCommand_Command_IsValid(value); + } + static constexpr Command Command_MIN = + LightsCommand_Command_Command_MIN; + static constexpr Command Command_MAX = + LightsCommand_Command_Command_MAX; + static constexpr int Command_ARRAYSIZE = + LightsCommand_Command_Command_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Command_descriptor() { + return LightsCommand_Command_descriptor(); + } + template + static inline const std::string& Command_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Command_Name."); + return LightsCommand_Command_Name(enum_t_value); + } + static inline bool Command_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + Command* value) { + return LightsCommand_Command_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kCommandFieldNumber = 1, + }; + // .ExampleModule.LightsCommand.Command command = 1; + void clear_command(); + ::ExampleModule::LightsCommand_Command command() const; + void set_command(::ExampleModule::LightsCommand_Command value); + private: + ::ExampleModule::LightsCommand_Command _internal_command() const; + void _internal_set_command(::ExampleModule::LightsCommand_Command value); + public: + + // @@protoc_insertion_point(class_scope:ExampleModule.LightsCommand) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int command_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_modules_2fExampleModule_2eproto; +}; +// ------------------------------------------------------------------- + +class BlinkerError final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ExampleModule.BlinkerError) */ { + public: + inline BlinkerError() : BlinkerError(nullptr) {} + ~BlinkerError() override; + explicit PROTOBUF_CONSTEXPR BlinkerError(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + BlinkerError(const BlinkerError& from); + BlinkerError(BlinkerError&& from) noexcept + : BlinkerError() { + *this = ::std::move(from); + } + + inline BlinkerError& operator=(const BlinkerError& from) { + CopyFrom(from); + return *this; + } + inline BlinkerError& operator=(BlinkerError&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const BlinkerError& default_instance() { + return *internal_default_instance(); + } + static inline const BlinkerError* internal_default_instance() { + return reinterpret_cast( + &_BlinkerError_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(BlinkerError& a, BlinkerError& b) { + a.Swap(&b); + } + inline void Swap(BlinkerError* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(BlinkerError* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + BlinkerError* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const BlinkerError& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const BlinkerError& from) { + BlinkerError::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BlinkerError* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ExampleModule.BlinkerError"; + } + protected: + explicit BlinkerError(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kErrorMessageFieldNumber = 1, + }; + // string errorMessage = 1; + void clear_errormessage(); + const std::string& errormessage() const; + template + void set_errormessage(ArgT0&& arg0, ArgT... args); + std::string* mutable_errormessage(); + PROTOBUF_NODISCARD std::string* release_errormessage(); + void set_allocated_errormessage(std::string* errormessage); + private: + const std::string& _internal_errormessage() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_errormessage(const std::string& value); + std::string* _internal_mutable_errormessage(); + public: + + // @@protoc_insertion_point(class_scope:ExampleModule.BlinkerError) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr errormessage_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_modules_2fExampleModule_2eproto; +}; +// ------------------------------------------------------------------- + +class LightsError final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ExampleModule.LightsError) */ { + public: + inline LightsError() : LightsError(nullptr) {} + ~LightsError() override; + explicit PROTOBUF_CONSTEXPR LightsError(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + LightsError(const LightsError& from); + LightsError(LightsError&& from) noexcept + : LightsError() { + *this = ::std::move(from); + } + + inline LightsError& operator=(const LightsError& from) { + CopyFrom(from); + return *this; + } + inline LightsError& operator=(LightsError&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const LightsError& default_instance() { + return *internal_default_instance(); + } + static inline const LightsError* internal_default_instance() { + return reinterpret_cast( + &_LightsError_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(LightsError& a, LightsError& b) { + a.Swap(&b); + } + inline void Swap(LightsError* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(LightsError* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + LightsError* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const LightsError& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const LightsError& from) { + LightsError::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(LightsError* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "ExampleModule.LightsError"; + } + protected: + explicit LightsError(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kErrorMessageFieldNumber = 1, + }; + // string errorMessage = 1; + void clear_errormessage(); + const std::string& errormessage() const; + template + void set_errormessage(ArgT0&& arg0, ArgT... args); + std::string* mutable_errormessage(); + PROTOBUF_NODISCARD std::string* release_errormessage(); + void set_allocated_errormessage(std::string* errormessage); + private: + const std::string& _internal_errormessage() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_errormessage(const std::string& value); + std::string* _internal_mutable_errormessage(); + public: + + // @@protoc_insertion_point(class_scope:ExampleModule.LightsError) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr errormessage_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_modules_2fExampleModule_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// BlinkerStatus + +// bool isFlashing = 1; +inline void BlinkerStatus::clear_isflashing() { + _impl_.isflashing_ = false; +} +inline bool BlinkerStatus::_internal_isflashing() const { + return _impl_.isflashing_; +} +inline bool BlinkerStatus::isflashing() const { + // @@protoc_insertion_point(field_get:ExampleModule.BlinkerStatus.isFlashing) + return _internal_isflashing(); +} +inline void BlinkerStatus::_internal_set_isflashing(bool value) { + + _impl_.isflashing_ = value; +} +inline void BlinkerStatus::set_isflashing(bool value) { + _internal_set_isflashing(value); + // @@protoc_insertion_point(field_set:ExampleModule.BlinkerStatus.isFlashing) +} + +// ------------------------------------------------------------------- + +// LightsStatus + +// bool isOn = 1; +inline void LightsStatus::clear_ison() { + _impl_.ison_ = false; +} +inline bool LightsStatus::_internal_ison() const { + return _impl_.ison_; +} +inline bool LightsStatus::ison() const { + // @@protoc_insertion_point(field_get:ExampleModule.LightsStatus.isOn) + return _internal_ison(); +} +inline void LightsStatus::_internal_set_ison(bool value) { + + _impl_.ison_ = value; +} +inline void LightsStatus::set_ison(bool value) { + _internal_set_ison(value); + // @@protoc_insertion_point(field_set:ExampleModule.LightsStatus.isOn) +} + +// ------------------------------------------------------------------- + +// BlinkerCommand + +// .ExampleModule.BlinkerCommand.Command command = 1; +inline void BlinkerCommand::clear_command() { + _impl_.command_ = 0; +} +inline ::ExampleModule::BlinkerCommand_Command BlinkerCommand::_internal_command() const { + return static_cast< ::ExampleModule::BlinkerCommand_Command >(_impl_.command_); +} +inline ::ExampleModule::BlinkerCommand_Command BlinkerCommand::command() const { + // @@protoc_insertion_point(field_get:ExampleModule.BlinkerCommand.command) + return _internal_command(); +} +inline void BlinkerCommand::_internal_set_command(::ExampleModule::BlinkerCommand_Command value) { + + _impl_.command_ = value; +} +inline void BlinkerCommand::set_command(::ExampleModule::BlinkerCommand_Command value) { + _internal_set_command(value); + // @@protoc_insertion_point(field_set:ExampleModule.BlinkerCommand.command) +} + +// ------------------------------------------------------------------- + +// LightsCommand + +// .ExampleModule.LightsCommand.Command command = 1; +inline void LightsCommand::clear_command() { + _impl_.command_ = 0; +} +inline ::ExampleModule::LightsCommand_Command LightsCommand::_internal_command() const { + return static_cast< ::ExampleModule::LightsCommand_Command >(_impl_.command_); +} +inline ::ExampleModule::LightsCommand_Command LightsCommand::command() const { + // @@protoc_insertion_point(field_get:ExampleModule.LightsCommand.command) + return _internal_command(); +} +inline void LightsCommand::_internal_set_command(::ExampleModule::LightsCommand_Command value) { + + _impl_.command_ = value; +} +inline void LightsCommand::set_command(::ExampleModule::LightsCommand_Command value) { + _internal_set_command(value); + // @@protoc_insertion_point(field_set:ExampleModule.LightsCommand.command) +} + +// ------------------------------------------------------------------- + +// BlinkerError + +// string errorMessage = 1; +inline void BlinkerError::clear_errormessage() { + _impl_.errormessage_.ClearToEmpty(); +} +inline const std::string& BlinkerError::errormessage() const { + // @@protoc_insertion_point(field_get:ExampleModule.BlinkerError.errorMessage) + return _internal_errormessage(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void BlinkerError::set_errormessage(ArgT0&& arg0, ArgT... args) { + + _impl_.errormessage_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:ExampleModule.BlinkerError.errorMessage) +} +inline std::string* BlinkerError::mutable_errormessage() { + std::string* _s = _internal_mutable_errormessage(); + // @@protoc_insertion_point(field_mutable:ExampleModule.BlinkerError.errorMessage) + return _s; +} +inline const std::string& BlinkerError::_internal_errormessage() const { + return _impl_.errormessage_.Get(); +} +inline void BlinkerError::_internal_set_errormessage(const std::string& value) { + + _impl_.errormessage_.Set(value, GetArenaForAllocation()); +} +inline std::string* BlinkerError::_internal_mutable_errormessage() { + + return _impl_.errormessage_.Mutable(GetArenaForAllocation()); +} +inline std::string* BlinkerError::release_errormessage() { + // @@protoc_insertion_point(field_release:ExampleModule.BlinkerError.errorMessage) + return _impl_.errormessage_.Release(); +} +inline void BlinkerError::set_allocated_errormessage(std::string* errormessage) { + if (errormessage != nullptr) { + + } else { + + } + _impl_.errormessage_.SetAllocated(errormessage, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.errormessage_.IsDefault()) { + _impl_.errormessage_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:ExampleModule.BlinkerError.errorMessage) +} + +// ------------------------------------------------------------------- + +// LightsError + +// string errorMessage = 1; +inline void LightsError::clear_errormessage() { + _impl_.errormessage_.ClearToEmpty(); +} +inline const std::string& LightsError::errormessage() const { + // @@protoc_insertion_point(field_get:ExampleModule.LightsError.errorMessage) + return _internal_errormessage(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void LightsError::set_errormessage(ArgT0&& arg0, ArgT... args) { + + _impl_.errormessage_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:ExampleModule.LightsError.errorMessage) +} +inline std::string* LightsError::mutable_errormessage() { + std::string* _s = _internal_mutable_errormessage(); + // @@protoc_insertion_point(field_mutable:ExampleModule.LightsError.errorMessage) + return _s; +} +inline const std::string& LightsError::_internal_errormessage() const { + return _impl_.errormessage_.Get(); +} +inline void LightsError::_internal_set_errormessage(const std::string& value) { + + _impl_.errormessage_.Set(value, GetArenaForAllocation()); +} +inline std::string* LightsError::_internal_mutable_errormessage() { + + return _impl_.errormessage_.Mutable(GetArenaForAllocation()); +} +inline std::string* LightsError::release_errormessage() { + // @@protoc_insertion_point(field_release:ExampleModule.LightsError.errorMessage) + return _impl_.errormessage_.Release(); +} +inline void LightsError::set_allocated_errormessage(std::string* errormessage) { + if (errormessage != nullptr) { + + } else { + + } + _impl_.errormessage_.SetAllocated(errormessage, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.errormessage_.IsDefault()) { + _impl_.errormessage_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:ExampleModule.LightsError.errorMessage) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace ExampleModule + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::ExampleModule::BlinkerCommand_Command> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ExampleModule::BlinkerCommand_Command>() { + return ::ExampleModule::BlinkerCommand_Command_descriptor(); +} +template <> struct is_proto_enum< ::ExampleModule::LightsCommand_Command> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::ExampleModule::LightsCommand_Command>() { + return ::ExampleModule::LightsCommand_Command_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_modules_2fExampleModule_2eproto diff --git a/examples/protobuf_parsing_example/main.cpp b/examples/protobuf_parsing_example/main.cpp index 1062cee..cbf18fe 100644 --- a/examples/protobuf_parsing_example/main.cpp +++ b/examples/protobuf_parsing_example/main.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include