diff --git a/README.md b/README.md index 54075d42..05b61aa3 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,20 @@ Following Instructions are based on Boost [getting started](https://www.boost.or 2. Navigate to the extracted directory. 3. Run `sudo cp -r include/rapidjson /usr/local/include/` +#### Install Protocol buffers +Instructions are based on [this](https://github.com/protocolbuffers/protobuf/tree/master/src). + +1. Download and extract Protobuf 3.10.0 from [here](https://github.com/protocolbuffers/protobuf/releases/tag/v3.10.0). +2. Navigate to the extracted Protobuf directory in a terminal. +3. Run `./configure` +4. Run `make && make check` +5. Run `sudo make install` + +#### Compile Protocol buffers +1. Run `protoc -I=./src/p2p --cpp_out=./src/p2p ./src/p2p/message.proto` + Ex - For message protobuf + `protoc -I=./src/p2p --cpp_out=./src/p2p ./src/p2p/message.proto` + #### Run ldconfig 1. Run `sudo ldconfig` diff --git a/makefile b/makefile index 77a96895..17b74e6d 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ all: mkdir -p build - g++ src/*.cpp -lsodium -lboost_system -lboost_filesystem -std=c++17 -o build/hpcore + g++ src/*.cpp src/*.cc -lsodium -lboost_system -lboost_filesystem -pthread -lprotobuf -std=c++17 -o build/hpcore echo 'build successful, binary in '`pwd`'/build/hpcore' diff --git a/src/p2p/message.pb.cc b/src/p2p/message.pb.cc new file mode 100644 index 00000000..9df6020e --- /dev/null +++ b/src/p2p/message.pb.cc @@ -0,0 +1,4139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: message.proto + +#include "message.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_State_message_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_State_PatchEntry_DoNotUse_message_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_StateDifference_message_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateDifference_CreatedEntry_DoNotUse_message_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateDifference_DeletedEntry_DoNotUse_message_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_message_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateDifference_UpdatedEntry_DoNotUse_message_2eproto; +namespace p2p { +class MessageDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Message_default_instance_; +class StateDifference_CreatedEntry_DoNotUseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StateDifference_CreatedEntry_DoNotUse_default_instance_; +class StateDifference_UpdatedEntry_DoNotUseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StateDifference_UpdatedEntry_DoNotUse_default_instance_; +class StateDifference_DeletedEntry_DoNotUseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StateDifference_DeletedEntry_DoNotUse_default_instance_; +class StateDifferenceDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StateDifference_default_instance_; +class State_PatchEntry_DoNotUseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _State_PatchEntry_DoNotUse_default_instance_; +class StateDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _State_default_instance_; +class ProposalDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Proposal_default_instance_; +class NPLDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _NPL_default_instance_; +class StateRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StateRequest_default_instance_; +class StateResponseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _StateResponse_default_instance_; +class HistoryRequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _HistoryRequest_default_instance_; +class HistoryResponseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _HistoryResponse_default_instance_; +} // namespace p2p +static void InitDefaultsscc_info_HistoryRequest_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_HistoryRequest_default_instance_; + new (ptr) ::p2p::HistoryRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::HistoryRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HistoryRequest_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_HistoryRequest_message_2eproto}, {}}; + +static void InitDefaultsscc_info_HistoryResponse_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_HistoryResponse_default_instance_; + new (ptr) ::p2p::HistoryResponse(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::HistoryResponse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HistoryResponse_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_HistoryResponse_message_2eproto}, {}}; + +static void InitDefaultsscc_info_Message_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_Message_default_instance_; + new (ptr) ::p2p::Message(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::Message::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Message_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Message_message_2eproto}, {}}; + +static void InitDefaultsscc_info_NPL_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_NPL_default_instance_; + new (ptr) ::p2p::NPL(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::NPL::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NPL_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_NPL_message_2eproto}, {}}; + +static void InitDefaultsscc_info_Proposal_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_Proposal_default_instance_; + new (ptr) ::p2p::Proposal(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::Proposal::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Proposal_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Proposal_message_2eproto}, { + &scc_info_State_message_2eproto.base,}}; + +static void InitDefaultsscc_info_State_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_State_default_instance_; + new (ptr) ::p2p::State(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::State::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_State_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_State_message_2eproto}, { + &scc_info_StateDifference_message_2eproto.base, + &scc_info_State_PatchEntry_DoNotUse_message_2eproto.base,}}; + +static void InitDefaultsscc_info_State_PatchEntry_DoNotUse_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_State_PatchEntry_DoNotUse_default_instance_; + new (ptr) ::p2p::State_PatchEntry_DoNotUse(); + } + ::p2p::State_PatchEntry_DoNotUse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_State_PatchEntry_DoNotUse_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_State_PatchEntry_DoNotUse_message_2eproto}, {}}; + +static void InitDefaultsscc_info_StateDifference_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_StateDifference_default_instance_; + new (ptr) ::p2p::StateDifference(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::StateDifference::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_StateDifference_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_StateDifference_message_2eproto}, { + &scc_info_StateDifference_CreatedEntry_DoNotUse_message_2eproto.base, + &scc_info_StateDifference_UpdatedEntry_DoNotUse_message_2eproto.base, + &scc_info_StateDifference_DeletedEntry_DoNotUse_message_2eproto.base,}}; + +static void InitDefaultsscc_info_StateDifference_CreatedEntry_DoNotUse_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_StateDifference_CreatedEntry_DoNotUse_default_instance_; + new (ptr) ::p2p::StateDifference_CreatedEntry_DoNotUse(); + } + ::p2p::StateDifference_CreatedEntry_DoNotUse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateDifference_CreatedEntry_DoNotUse_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_StateDifference_CreatedEntry_DoNotUse_message_2eproto}, {}}; + +static void InitDefaultsscc_info_StateDifference_DeletedEntry_DoNotUse_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_StateDifference_DeletedEntry_DoNotUse_default_instance_; + new (ptr) ::p2p::StateDifference_DeletedEntry_DoNotUse(); + } + ::p2p::StateDifference_DeletedEntry_DoNotUse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateDifference_DeletedEntry_DoNotUse_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_StateDifference_DeletedEntry_DoNotUse_message_2eproto}, {}}; + +static void InitDefaultsscc_info_StateDifference_UpdatedEntry_DoNotUse_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_StateDifference_UpdatedEntry_DoNotUse_default_instance_; + new (ptr) ::p2p::StateDifference_UpdatedEntry_DoNotUse(); + } + ::p2p::StateDifference_UpdatedEntry_DoNotUse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateDifference_UpdatedEntry_DoNotUse_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_StateDifference_UpdatedEntry_DoNotUse_message_2eproto}, {}}; + +static void InitDefaultsscc_info_StateRequest_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_StateRequest_default_instance_; + new (ptr) ::p2p::StateRequest(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::StateRequest::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateRequest_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_StateRequest_message_2eproto}, {}}; + +static void InitDefaultsscc_info_StateResponse_message_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::p2p::_StateResponse_default_instance_; + new (ptr) ::p2p::StateResponse(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::p2p::StateResponse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StateResponse_message_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_StateResponse_message_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_message_2eproto[13]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_message_2eproto[1]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_message_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_message_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::p2p::Message, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::Message, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::Message, version_), + PROTOBUF_FIELD_OFFSET(::p2p::Message, publickey_), + PROTOBUF_FIELD_OFFSET(::p2p::Message, timestamp_), + PROTOBUF_FIELD_OFFSET(::p2p::Message, signature_), + PROTOBUF_FIELD_OFFSET(::p2p::Message, type_), + PROTOBUF_FIELD_OFFSET(::p2p::Message, content_), + 0, + 1, + 4, + 2, + 5, + 3, + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_CreatedEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_CreatedEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_CreatedEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_CreatedEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_UpdatedEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_UpdatedEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_UpdatedEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_UpdatedEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_DeletedEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_DeletedEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_DeletedEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference_DeletedEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference, created_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference, updated_), + PROTOBUF_FIELD_OFFSET(::p2p::StateDifference, deleted_), + ~0u, + ~0u, + ~0u, + PROTOBUF_FIELD_OFFSET(::p2p::State_PatchEntry_DoNotUse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::State_PatchEntry_DoNotUse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::State_PatchEntry_DoNotUse, key_), + PROTOBUF_FIELD_OFFSET(::p2p::State_PatchEntry_DoNotUse, value_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::p2p::State, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::State, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::State, previous_), + PROTOBUF_FIELD_OFFSET(::p2p::State, current_), + PROTOBUF_FIELD_OFFSET(::p2p::State, difference_), + PROTOBUF_FIELD_OFFSET(::p2p::State, patch_), + 0, + 1, + 2, + ~0u, + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, connections_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, inputs_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, outputs_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, stage_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, time_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, state_), + PROTOBUF_FIELD_OFFSET(::p2p::Proposal, lcl_), + ~0u, + ~0u, + ~0u, + 2, + 3, + 1, + 0, + PROTOBUF_FIELD_OFFSET(::p2p::NPL, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::NPL, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::NPL, data_), + PROTOBUF_FIELD_OFFSET(::p2p::NPL, lcl_), + 0, + 1, + PROTOBUF_FIELD_OFFSET(::p2p::StateRequest, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::StateRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::StateResponse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::StateResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::HistoryRequest, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::HistoryRequest, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::p2p::HistoryResponse, _has_bits_), + PROTOBUF_FIELD_OFFSET(::p2p::HistoryResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 11, sizeof(::p2p::Message)}, + { 17, 24, sizeof(::p2p::StateDifference_CreatedEntry_DoNotUse)}, + { 26, 33, sizeof(::p2p::StateDifference_UpdatedEntry_DoNotUse)}, + { 35, 42, sizeof(::p2p::StateDifference_DeletedEntry_DoNotUse)}, + { 44, 52, sizeof(::p2p::StateDifference)}, + { 55, 62, sizeof(::p2p::State_PatchEntry_DoNotUse)}, + { 64, 73, sizeof(::p2p::State)}, + { 77, 89, sizeof(::p2p::Proposal)}, + { 96, 103, sizeof(::p2p::NPL)}, + { 105, 110, sizeof(::p2p::StateRequest)}, + { 110, 115, sizeof(::p2p::StateResponse)}, + { 115, 120, sizeof(::p2p::HistoryRequest)}, + { 120, 125, sizeof(::p2p::HistoryResponse)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::p2p::_Message_default_instance_), + reinterpret_cast(&::p2p::_StateDifference_CreatedEntry_DoNotUse_default_instance_), + reinterpret_cast(&::p2p::_StateDifference_UpdatedEntry_DoNotUse_default_instance_), + reinterpret_cast(&::p2p::_StateDifference_DeletedEntry_DoNotUse_default_instance_), + reinterpret_cast(&::p2p::_StateDifference_default_instance_), + reinterpret_cast(&::p2p::_State_PatchEntry_DoNotUse_default_instance_), + reinterpret_cast(&::p2p::_State_default_instance_), + reinterpret_cast(&::p2p::_Proposal_default_instance_), + reinterpret_cast(&::p2p::_NPL_default_instance_), + reinterpret_cast(&::p2p::_StateRequest_default_instance_), + reinterpret_cast(&::p2p::_StateResponse_default_instance_), + reinterpret_cast(&::p2p::_HistoryRequest_default_instance_), + reinterpret_cast(&::p2p::_HistoryResponse_default_instance_), +}; + +const char descriptor_table_protodef_message_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\rmessage.proto\022\003p2p\"\204\002\n\007Message\022\017\n\007vers" + "ion\030\001 \001(\t\022\021\n\tpublicKey\030\002 \001(\014\022\021\n\ttimestam" + "p\030\003 \001(\005\022\021\n\tsignature\030\004 \001(\014\022&\n\004type\030\005 \001(\016" + "2\030.p2p.Message.Messagetype\022\017\n\007content\030\006 " + "\001(\014\"v\n\013Messagetype\022\014\n\010PROPOSAL\020\000\022\007\n\003NPL\020" + "\001\022\021\n\rSTATE_REQUEST\020\002\022\022\n\016STATE_RESPONSE\020\003" + "\022\023\n\017HISTORY_REQUEST\020\004\022\024\n\020HISTORY_RESPONS" + "E\020\005\"\275\002\n\017StateDifference\0222\n\007created\030\001 \003(\013" + "2!.p2p.StateDifference.CreatedEntry\0222\n\007u" + "pdated\030\002 \003(\0132!.p2p.StateDifference.Updat" + "edEntry\0222\n\007deleted\030\003 \003(\0132!.p2p.StateDiff" + "erence.DeletedEntry\032.\n\014CreatedEntry\022\013\n\003k" + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032.\n\014UpdatedEn" + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032.\n\014D" + "eletedEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + "\0028\001\"\250\001\n\005State\022\020\n\010previous\030\001 \001(\014\022\017\n\007curre" + "nt\030\002 \001(\014\022(\n\ndifference\030\003 \001(\0132\024.p2p.State" + "Difference\022$\n\005patch\030\004 \003(\0132\025.p2p.State.Pa" + "tchEntry\032,\n\nPatchEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + "alue\030\002 \001(\t:\0028\001\"\205\001\n\010Proposal\022\023\n\013connectio" + "ns\030\001 \003(\t\022\016\n\006inputs\030\002 \003(\t\022\017\n\007outputs\030\003 \003(" + "\t\022\r\n\005stage\030\004 \001(\005\022\014\n\004time\030\005 \001(\005\022\031\n\005state\030" + "\006 \001(\0132\n.p2p.State\022\013\n\003lcl\030\007 \001(\014\" \n\003NPL\022\014\n" + "\004data\030\001 \001(\014\022\013\n\003lcl\030\002 \001(\014\"\016\n\014StateRequest" + "\"\017\n\rStateResponse\"\020\n\016HistoryRequest\"\021\n\017H" + "istoryResponse" + ; +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_message_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_message_2eproto_sccs[13] = { + &scc_info_HistoryRequest_message_2eproto.base, + &scc_info_HistoryResponse_message_2eproto.base, + &scc_info_Message_message_2eproto.base, + &scc_info_NPL_message_2eproto.base, + &scc_info_Proposal_message_2eproto.base, + &scc_info_State_message_2eproto.base, + &scc_info_State_PatchEntry_DoNotUse_message_2eproto.base, + &scc_info_StateDifference_message_2eproto.base, + &scc_info_StateDifference_CreatedEntry_DoNotUse_message_2eproto.base, + &scc_info_StateDifference_DeletedEntry_DoNotUse_message_2eproto.base, + &scc_info_StateDifference_UpdatedEntry_DoNotUse_message_2eproto.base, + &scc_info_StateRequest_message_2eproto.base, + &scc_info_StateResponse_message_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_message_2eproto_once; +static bool descriptor_table_message_2eproto_initialized = false; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_message_2eproto = { + &descriptor_table_message_2eproto_initialized, descriptor_table_protodef_message_2eproto, "message.proto", 1014, + &descriptor_table_message_2eproto_once, descriptor_table_message_2eproto_sccs, descriptor_table_message_2eproto_deps, 13, 0, + schemas, file_default_instances, TableStruct_message_2eproto::offsets, + file_level_metadata_message_2eproto, 13, file_level_enum_descriptors_message_2eproto, file_level_service_descriptors_message_2eproto, +}; + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_message_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_message_2eproto), true); +namespace p2p { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Message_Messagetype_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_message_2eproto); + return file_level_enum_descriptors_message_2eproto[0]; +} +bool Message_Messagetype_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +constexpr Message_Messagetype Message::PROPOSAL; +constexpr Message_Messagetype Message::NPL; +constexpr Message_Messagetype Message::STATE_REQUEST; +constexpr Message_Messagetype Message::STATE_RESPONSE; +constexpr Message_Messagetype Message::HISTORY_REQUEST; +constexpr Message_Messagetype Message::HISTORY_RESPONSE; +constexpr Message_Messagetype Message::Messagetype_MIN; +constexpr Message_Messagetype Message::Messagetype_MAX; +constexpr int Message::Messagetype_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) + +// =================================================================== + +void Message::InitAsDefaultInstance() { +} +class Message::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_version(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_publickey(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_timestamp(HasBits* has_bits) { + (*has_bits)[0] |= 16u; + } + static void set_has_signature(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_type(HasBits* has_bits) { + (*has_bits)[0] |= 32u; + } + static void set_has_content(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } +}; + +Message::Message() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.Message) +} +Message::Message(const Message& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_version()) { + version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_); + } + publickey_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_publickey()) { + publickey_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.publickey_); + } + signature_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_signature()) { + signature_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.signature_); + } + content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_content()) { + content_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.content_); + } + ::memcpy(×tamp_, &from.timestamp_, + static_cast(reinterpret_cast(&type_) - + reinterpret_cast(×tamp_)) + sizeof(type_)); + // @@protoc_insertion_point(copy_constructor:p2p.Message) +} + +void Message::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Message_message_2eproto.base); + version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + publickey_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + signature_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(×tamp_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(×tamp_)) + sizeof(type_)); +} + +Message::~Message() { + // @@protoc_insertion_point(destructor:p2p.Message) + SharedDtor(); +} + +void Message::SharedDtor() { + version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + publickey_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + signature_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void Message::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Message& Message::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Message_message_2eproto.base); + return *internal_default_instance(); +} + + +void Message::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.Message) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000001u) { + version_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + publickey_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000004u) { + signature_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000008u) { + content_.ClearNonDefaultToEmptyNoArena(); + } + } + if (cached_has_bits & 0x00000030u) { + ::memset(×tamp_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(×tamp_)) + sizeof(type_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Message::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // optional string version = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_version(), ptr, ctx, "p2p.Message.version"); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional bytes publicKey = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_publickey(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional int32 timestamp = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + _Internal::set_has_timestamp(&has_bits); + timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional bytes signature = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_signature(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional .p2p.Message.Messagetype type = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + if (PROTOBUF_PREDICT_TRUE(::p2p::Message_Messagetype_IsValid(val))) { + set_type(static_cast<::p2p::Message_Messagetype>(val)); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields()); + } + } else goto handle_unusual; + continue; + // optional bytes content = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_content(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Message::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.Message) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string version = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->mutable_version())); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->version().data(), static_cast(this->version().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.Message.version"); + } else { + goto handle_unusual; + } + break; + } + + // optional bytes publicKey = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_publickey())); + } else { + goto handle_unusual; + } + break; + } + + // optional int32 timestamp = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + _Internal::set_has_timestamp(&_has_bits_); + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( + input, ×tamp_))); + } else { + goto handle_unusual; + } + break; + } + + // optional bytes signature = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_signature())); + } else { + goto handle_unusual; + } + break; + } + + // optional .p2p.Message.Messagetype type = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::p2p::Message_Messagetype_IsValid(value)) { + set_type(static_cast< ::p2p::Message_Messagetype >(value)); + } else { + mutable_unknown_fields()->AddVarint( + 5, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value)); + } + } else { + goto handle_unusual; + } + break; + } + + // optional bytes content = 6; + case 6: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_content())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:p2p.Message) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.Message) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Message::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.Message) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional string version = 1; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->version().data(), static_cast(this->version().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Message.version"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->version(), output); + } + + // optional bytes publicKey = 2; + if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->publickey(), output); + } + + // optional int32 timestamp = 3; + if (cached_has_bits & 0x00000010u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(3, this->timestamp(), output); + } + + // optional bytes signature = 4; + if (cached_has_bits & 0x00000004u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->signature(), output); + } + + // optional .p2p.Message.Messagetype type = 5; + if (cached_has_bits & 0x00000020u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // optional bytes content = 6; + if (cached_has_bits & 0x00000008u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 6, this->content(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.Message) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Message::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.Message) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional string version = 1; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->version().data(), static_cast(this->version().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Message.version"); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 1, this->version(), target); + } + + // optional bytes publicKey = 2; + if (cached_has_bits & 0x00000002u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 2, this->publickey(), target); + } + + // optional int32 timestamp = 3; + if (cached_has_bits & 0x00000010u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->timestamp(), target); + } + + // optional bytes signature = 4; + if (cached_has_bits & 0x00000004u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 4, this->signature(), target); + } + + // optional .p2p.Message.Messagetype type = 5; + if (cached_has_bits & 0x00000020u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 5, this->type(), target); + } + + // optional bytes content = 6; + if (cached_has_bits & 0x00000008u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 6, this->content(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.Message) + return target; +} + +size_t Message::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.Message) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + // optional string version = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->version()); + } + + // optional bytes publicKey = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->publickey()); + } + + // optional bytes signature = 4; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->signature()); + } + + // optional bytes content = 6; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->content()); + } + + // optional int32 timestamp = 3; + if (cached_has_bits & 0x00000010u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->timestamp()); + } + + // optional .p2p.Message.Messagetype type = 5; + if (cached_has_bits & 0x00000020u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); + } + + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Message::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.Message) + GOOGLE_DCHECK_NE(&from, this); + const Message* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.Message) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.Message) + MergeFrom(*source); + } +} + +void Message::MergeFrom(const Message& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.Message) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 0x0000003fu) { + if (cached_has_bits & 0x00000001u) { + _has_bits_[0] |= 0x00000001u; + version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_); + } + if (cached_has_bits & 0x00000002u) { + _has_bits_[0] |= 0x00000002u; + publickey_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.publickey_); + } + if (cached_has_bits & 0x00000004u) { + _has_bits_[0] |= 0x00000004u; + signature_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.signature_); + } + if (cached_has_bits & 0x00000008u) { + _has_bits_[0] |= 0x00000008u; + content_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.content_); + } + if (cached_has_bits & 0x00000010u) { + timestamp_ = from.timestamp_; + } + if (cached_has_bits & 0x00000020u) { + type_ = from.type_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Message::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.Message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Message::CopyFrom(const Message& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.Message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Message::IsInitialized() const { + return true; +} + +void Message::InternalSwap(Message* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + version_.Swap(&other->version_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + publickey_.Swap(&other->publickey_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + signature_.Swap(&other->signature_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + content_.Swap(&other->content_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(timestamp_, other->timestamp_); + swap(type_, other->type_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Message::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +StateDifference_CreatedEntry_DoNotUse::StateDifference_CreatedEntry_DoNotUse() {} +StateDifference_CreatedEntry_DoNotUse::StateDifference_CreatedEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void StateDifference_CreatedEntry_DoNotUse::MergeFrom(const StateDifference_CreatedEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata StateDifference_CreatedEntry_DoNotUse::GetMetadata() const { + return GetMetadataStatic(); +} +void StateDifference_CreatedEntry_DoNotUse::MergeFrom( + const ::PROTOBUF_NAMESPACE_ID::Message& other) { + ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other); +} + + +// =================================================================== + +StateDifference_UpdatedEntry_DoNotUse::StateDifference_UpdatedEntry_DoNotUse() {} +StateDifference_UpdatedEntry_DoNotUse::StateDifference_UpdatedEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void StateDifference_UpdatedEntry_DoNotUse::MergeFrom(const StateDifference_UpdatedEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata StateDifference_UpdatedEntry_DoNotUse::GetMetadata() const { + return GetMetadataStatic(); +} +void StateDifference_UpdatedEntry_DoNotUse::MergeFrom( + const ::PROTOBUF_NAMESPACE_ID::Message& other) { + ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other); +} + + +// =================================================================== + +StateDifference_DeletedEntry_DoNotUse::StateDifference_DeletedEntry_DoNotUse() {} +StateDifference_DeletedEntry_DoNotUse::StateDifference_DeletedEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void StateDifference_DeletedEntry_DoNotUse::MergeFrom(const StateDifference_DeletedEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata StateDifference_DeletedEntry_DoNotUse::GetMetadata() const { + return GetMetadataStatic(); +} +void StateDifference_DeletedEntry_DoNotUse::MergeFrom( + const ::PROTOBUF_NAMESPACE_ID::Message& other) { + ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other); +} + + +// =================================================================== + +void StateDifference::InitAsDefaultInstance() { +} +class StateDifference::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); +}; + +StateDifference::StateDifference() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.StateDifference) +} +StateDifference::StateDifference(const StateDifference& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + created_.MergeFrom(from.created_); + updated_.MergeFrom(from.updated_); + deleted_.MergeFrom(from.deleted_); + // @@protoc_insertion_point(copy_constructor:p2p.StateDifference) +} + +void StateDifference::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StateDifference_message_2eproto.base); +} + +StateDifference::~StateDifference() { + // @@protoc_insertion_point(destructor:p2p.StateDifference) + SharedDtor(); +} + +void StateDifference::SharedDtor() { +} + +void StateDifference::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StateDifference& StateDifference::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StateDifference_message_2eproto.base); + return *internal_default_instance(); +} + + +void StateDifference::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.StateDifference) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + created_.Clear(); + updated_.Clear(); + deleted_.Clear(); + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* StateDifference::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // map created = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&created_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); + } else goto handle_unusual; + continue; + // map updated = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&updated_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); + } else goto handle_unusual; + continue; + // map deleted = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&deleted_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool StateDifference::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.StateDifference) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // map created = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + StateDifference_CreatedEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StateDifference_CreatedEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string > > parser(&created_); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.key().data(), static_cast(parser.key().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.StateDifference.CreatedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.value().data(), static_cast(parser.value().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.StateDifference.CreatedEntry.value"); + } else { + goto handle_unusual; + } + break; + } + + // map updated = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + StateDifference_UpdatedEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StateDifference_UpdatedEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string > > parser(&updated_); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.key().data(), static_cast(parser.key().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.StateDifference.UpdatedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.value().data(), static_cast(parser.value().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.StateDifference.UpdatedEntry.value"); + } else { + goto handle_unusual; + } + break; + } + + // map deleted = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + StateDifference_DeletedEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StateDifference_DeletedEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string > > parser(&deleted_); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.key().data(), static_cast(parser.key().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.StateDifference.DeletedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.value().data(), static_cast(parser.value().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.StateDifference.DeletedEntry.value"); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:p2p.StateDifference) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.StateDifference) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void StateDifference::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.StateDifference) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map created = 1; + if (!this->created().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.CreatedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.CreatedEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->created().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->created().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->created().begin(); + it != this->created().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + StateDifference_CreatedEntry_DoNotUse::Funcs::SerializeToCodedStream(1, items[static_cast(i)]->first, items[static_cast(i)]->second, output); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->created().begin(); + it != this->created().end(); ++it) { + StateDifference_CreatedEntry_DoNotUse::Funcs::SerializeToCodedStream(1, it->first, it->second, output); + Utf8Check::Check(&(*it)); + } + } + } + + // map updated = 2; + if (!this->updated().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.UpdatedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.UpdatedEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->updated().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->updated().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->updated().begin(); + it != this->updated().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + StateDifference_UpdatedEntry_DoNotUse::Funcs::SerializeToCodedStream(2, items[static_cast(i)]->first, items[static_cast(i)]->second, output); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->updated().begin(); + it != this->updated().end(); ++it) { + StateDifference_UpdatedEntry_DoNotUse::Funcs::SerializeToCodedStream(2, it->first, it->second, output); + Utf8Check::Check(&(*it)); + } + } + } + + // map deleted = 3; + if (!this->deleted().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.DeletedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.DeletedEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->deleted().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->deleted().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->deleted().begin(); + it != this->deleted().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + StateDifference_DeletedEntry_DoNotUse::Funcs::SerializeToCodedStream(3, items[static_cast(i)]->first, items[static_cast(i)]->second, output); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->deleted().begin(); + it != this->deleted().end(); ++it) { + StateDifference_DeletedEntry_DoNotUse::Funcs::SerializeToCodedStream(3, it->first, it->second, output); + Utf8Check::Check(&(*it)); + } + } + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.StateDifference) +} + +::PROTOBUF_NAMESPACE_ID::uint8* StateDifference::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.StateDifference) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // map created = 1; + if (!this->created().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.CreatedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.CreatedEntry.value"); + } + }; + + if (false && + this->created().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->created().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->created().begin(); + it != this->created().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + target = StateDifference_CreatedEntry_DoNotUse::Funcs::SerializeToArray(1, items[static_cast(i)]->first, items[static_cast(i)]->second, target); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->created().begin(); + it != this->created().end(); ++it) { + target = StateDifference_CreatedEntry_DoNotUse::Funcs::SerializeToArray(1, it->first, it->second, target); + Utf8Check::Check(&(*it)); + } + } + } + + // map updated = 2; + if (!this->updated().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.UpdatedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.UpdatedEntry.value"); + } + }; + + if (false && + this->updated().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->updated().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->updated().begin(); + it != this->updated().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + target = StateDifference_UpdatedEntry_DoNotUse::Funcs::SerializeToArray(2, items[static_cast(i)]->first, items[static_cast(i)]->second, target); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->updated().begin(); + it != this->updated().end(); ++it) { + target = StateDifference_UpdatedEntry_DoNotUse::Funcs::SerializeToArray(2, it->first, it->second, target); + Utf8Check::Check(&(*it)); + } + } + } + + // map deleted = 3; + if (!this->deleted().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.DeletedEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.StateDifference.DeletedEntry.value"); + } + }; + + if (false && + this->deleted().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->deleted().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->deleted().begin(); + it != this->deleted().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + target = StateDifference_DeletedEntry_DoNotUse::Funcs::SerializeToArray(3, items[static_cast(i)]->first, items[static_cast(i)]->second, target); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->deleted().begin(); + it != this->deleted().end(); ++it) { + target = StateDifference_DeletedEntry_DoNotUse::Funcs::SerializeToArray(3, it->first, it->second, target); + Utf8Check::Check(&(*it)); + } + } + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.StateDifference) + return target; +} + +size_t StateDifference::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.StateDifference) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map created = 1; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->created_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->created().begin(); + it != this->created().end(); ++it) { + total_size += StateDifference_CreatedEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + // map updated = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->updated_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->updated().begin(); + it != this->updated().end(); ++it) { + total_size += StateDifference_UpdatedEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + // map deleted = 3; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->deleted_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->deleted().begin(); + it != this->deleted().end(); ++it) { + total_size += StateDifference_DeletedEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StateDifference::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.StateDifference) + GOOGLE_DCHECK_NE(&from, this); + const StateDifference* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.StateDifference) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.StateDifference) + MergeFrom(*source); + } +} + +void StateDifference::MergeFrom(const StateDifference& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.StateDifference) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + created_.MergeFrom(from.created_); + updated_.MergeFrom(from.updated_); + deleted_.MergeFrom(from.deleted_); +} + +void StateDifference::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.StateDifference) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StateDifference::CopyFrom(const StateDifference& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.StateDifference) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StateDifference::IsInitialized() const { + return true; +} + +void StateDifference::InternalSwap(StateDifference* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + created_.Swap(&other->created_); + updated_.Swap(&other->updated_); + deleted_.Swap(&other->deleted_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StateDifference::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +State_PatchEntry_DoNotUse::State_PatchEntry_DoNotUse() {} +State_PatchEntry_DoNotUse::State_PatchEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : SuperType(arena) {} +void State_PatchEntry_DoNotUse::MergeFrom(const State_PatchEntry_DoNotUse& other) { + MergeFromInternal(other); +} +::PROTOBUF_NAMESPACE_ID::Metadata State_PatchEntry_DoNotUse::GetMetadata() const { + return GetMetadataStatic(); +} +void State_PatchEntry_DoNotUse::MergeFrom( + const ::PROTOBUF_NAMESPACE_ID::Message& other) { + ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other); +} + + +// =================================================================== + +void State::InitAsDefaultInstance() { + ::p2p::_State_default_instance_._instance.get_mutable()->difference_ = const_cast< ::p2p::StateDifference*>( + ::p2p::StateDifference::internal_default_instance()); +} +class State::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_previous(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_current(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::p2p::StateDifference& difference(const State* msg); + static void set_has_difference(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } +}; + +const ::p2p::StateDifference& +State::_Internal::difference(const State* msg) { + return *msg->difference_; +} +State::State() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.State) +} +State::State(const State& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + patch_.MergeFrom(from.patch_); + previous_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_previous()) { + previous_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.previous_); + } + current_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_current()) { + current_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.current_); + } + if (from.has_difference()) { + difference_ = new ::p2p::StateDifference(*from.difference_); + } else { + difference_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:p2p.State) +} + +void State::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_State_message_2eproto.base); + previous_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + current_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + difference_ = nullptr; +} + +State::~State() { + // @@protoc_insertion_point(destructor:p2p.State) + SharedDtor(); +} + +void State::SharedDtor() { + previous_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + current_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete difference_; +} + +void State::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const State& State::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_State_message_2eproto.base); + return *internal_default_instance(); +} + + +void State::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.State) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + patch_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + previous_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + current_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(difference_ != nullptr); + difference_->Clear(); + } + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* State::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // optional bytes previous = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_previous(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional bytes current = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_current(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional .p2p.StateDifference difference = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ctx->ParseMessage(mutable_difference(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // map patch = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(&patch_, ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool State::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.State) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes previous = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_previous())); + } else { + goto handle_unusual; + } + break; + } + + // optional bytes current = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_current())); + } else { + goto handle_unusual; + } + break; + } + + // optional .p2p.StateDifference difference = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_difference())); + } else { + goto handle_unusual; + } + break; + } + + // map patch = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { + State_PatchEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField< + State_PatchEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 >, + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string > > parser(&patch_); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual( + input, &parser)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.key().data(), static_cast(parser.key().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.State.PatchEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + parser.value().data(), static_cast(parser.value().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.State.PatchEntry.value"); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:p2p.State) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.State) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void State::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.State) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional bytes previous = 1; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->previous(), output); + } + + // optional bytes current = 2; + if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->current(), output); + } + + // optional .p2p.StateDifference difference = 3; + if (cached_has_bits & 0x00000004u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, _Internal::difference(this), output); + } + + // map patch = 4; + if (!this->patch().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.State.PatchEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.State.PatchEntry.value"); + } + }; + + if (output->IsSerializationDeterministic() && + this->patch().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->patch().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->patch().begin(); + it != this->patch().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + State_PatchEntry_DoNotUse::Funcs::SerializeToCodedStream(4, items[static_cast(i)]->first, items[static_cast(i)]->second, output); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->patch().begin(); + it != this->patch().end(); ++it) { + State_PatchEntry_DoNotUse::Funcs::SerializeToCodedStream(4, it->first, it->second, output); + Utf8Check::Check(&(*it)); + } + } + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.State) +} + +::PROTOBUF_NAMESPACE_ID::uint8* State::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.State) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional bytes previous = 1; + if (cached_has_bits & 0x00000001u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 1, this->previous(), target); + } + + // optional bytes current = 2; + if (cached_has_bits & 0x00000002u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 2, this->current(), target); + } + + // optional .p2p.StateDifference difference = 3; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 3, _Internal::difference(this), target); + } + + // map patch = 4; + if (!this->patch().empty()) { + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer + ConstPtr; + typedef ConstPtr SortItem; + typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst Less; + struct Utf8Check { + static void Check(ConstPtr p) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->first.data(), static_cast(p->first.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.State.PatchEntry.key"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + p->second.data(), static_cast(p->second.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.State.PatchEntry.value"); + } + }; + + if (false && + this->patch().size() > 1) { + ::std::unique_ptr items( + new SortItem[this->patch().size()]); + typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type; + size_type n = 0; + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->patch().begin(); + it != this->patch().end(); ++it, ++n) { + items[static_cast(n)] = SortItem(&*it); + } + ::std::sort(&items[0], &items[static_cast(n)], Less()); + for (size_type i = 0; i < n; i++) { + target = State_PatchEntry_DoNotUse::Funcs::SerializeToArray(4, items[static_cast(i)]->first, items[static_cast(i)]->second, target); + Utf8Check::Check(&(*items[static_cast(i)])); + } + } else { + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->patch().begin(); + it != this->patch().end(); ++it) { + target = State_PatchEntry_DoNotUse::Funcs::SerializeToArray(4, it->first, it->second, target); + Utf8Check::Check(&(*it)); + } + } + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.State) + return target; +} + +size_t State::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.State) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // map patch = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->patch_size()); + for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator + it = this->patch().begin(); + it != this->patch().end(); ++it) { + total_size += State_PatchEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second); + } + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + // optional bytes previous = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->previous()); + } + + // optional bytes current = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->current()); + } + + // optional .p2p.StateDifference difference = 3; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *difference_); + } + + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void State::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.State) + GOOGLE_DCHECK_NE(&from, this); + const State* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.State) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.State) + MergeFrom(*source); + } +} + +void State::MergeFrom(const State& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.State) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + patch_.MergeFrom(from.patch_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 0x00000007u) { + if (cached_has_bits & 0x00000001u) { + _has_bits_[0] |= 0x00000001u; + previous_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.previous_); + } + if (cached_has_bits & 0x00000002u) { + _has_bits_[0] |= 0x00000002u; + current_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.current_); + } + if (cached_has_bits & 0x00000004u) { + mutable_difference()->::p2p::StateDifference::MergeFrom(from.difference()); + } + } +} + +void State::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.State) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void State::CopyFrom(const State& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.State) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool State::IsInitialized() const { + return true; +} + +void State::InternalSwap(State* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + patch_.Swap(&other->patch_); + previous_.Swap(&other->previous_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + current_.Swap(&other->current_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(difference_, other->difference_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata State::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void Proposal::InitAsDefaultInstance() { + ::p2p::_Proposal_default_instance_._instance.get_mutable()->state_ = const_cast< ::p2p::State*>( + ::p2p::State::internal_default_instance()); +} +class Proposal::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_stage(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static void set_has_time(HasBits* has_bits) { + (*has_bits)[0] |= 8u; + } + static const ::p2p::State& state(const Proposal* msg); + static void set_has_state(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_lcl(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } +}; + +const ::p2p::State& +Proposal::_Internal::state(const Proposal* msg) { + return *msg->state_; +} +Proposal::Proposal() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.Proposal) +} +Proposal::Proposal(const Proposal& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_), + connections_(from.connections_), + inputs_(from.inputs_), + outputs_(from.outputs_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + lcl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_lcl()) { + lcl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.lcl_); + } + if (from.has_state()) { + state_ = new ::p2p::State(*from.state_); + } else { + state_ = nullptr; + } + ::memcpy(&stage_, &from.stage_, + static_cast(reinterpret_cast(&time_) - + reinterpret_cast(&stage_)) + sizeof(time_)); + // @@protoc_insertion_point(copy_constructor:p2p.Proposal) +} + +void Proposal::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Proposal_message_2eproto.base); + lcl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&state_, 0, static_cast( + reinterpret_cast(&time_) - + reinterpret_cast(&state_)) + sizeof(time_)); +} + +Proposal::~Proposal() { + // @@protoc_insertion_point(destructor:p2p.Proposal) + SharedDtor(); +} + +void Proposal::SharedDtor() { + lcl_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete state_; +} + +void Proposal::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Proposal& Proposal::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Proposal_message_2eproto.base); + return *internal_default_instance(); +} + + +void Proposal::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.Proposal) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + connections_.Clear(); + inputs_.Clear(); + outputs_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + lcl_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(state_ != nullptr); + state_->Clear(); + } + } + if (cached_has_bits & 0x0000000cu) { + ::memset(&stage_, 0, static_cast( + reinterpret_cast(&time_) - + reinterpret_cast(&stage_)) + sizeof(time_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Proposal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // repeated string connections = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_connections(), ptr, ctx, "p2p.Proposal.connections"); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10); + } else goto handle_unusual; + continue; + // repeated string inputs = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_inputs(), ptr, ctx, "p2p.Proposal.inputs"); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18); + } else goto handle_unusual; + continue; + // repeated string outputs = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_outputs(), ptr, ctx, "p2p.Proposal.outputs"); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 26); + } else goto handle_unusual; + continue; + // optional int32 stage = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + _Internal::set_has_stage(&has_bits); + stage_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional int32 time = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + _Internal::set_has_time(&has_bits); + time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional .p2p.State state = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + ptr = ctx->ParseMessage(mutable_state(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional bytes lcl = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_lcl(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Proposal::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.Proposal) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated string connections = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->add_connections())); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->connections(this->connections_size() - 1).data(), + static_cast(this->connections(this->connections_size() - 1).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.Proposal.connections"); + } else { + goto handle_unusual; + } + break; + } + + // repeated string inputs = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->add_inputs())); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->inputs(this->inputs_size() - 1).data(), + static_cast(this->inputs(this->inputs_size() - 1).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.Proposal.inputs"); + } else { + goto handle_unusual; + } + break; + } + + // repeated string outputs = 3; + case 3: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->add_outputs())); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->outputs(this->outputs_size() - 1).data(), + static_cast(this->outputs(this->outputs_size() - 1).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE, + "p2p.Proposal.outputs"); + } else { + goto handle_unusual; + } + break; + } + + // optional int32 stage = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) { + _Internal::set_has_stage(&_has_bits_); + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( + input, &stage_))); + } else { + goto handle_unusual; + } + break; + } + + // optional int32 time = 5; + case 5: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) { + _Internal::set_has_time(&_has_bits_); + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>( + input, &time_))); + } else { + goto handle_unusual; + } + break; + } + + // optional .p2p.State state = 6; + case 6: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_state())); + } else { + goto handle_unusual; + } + break; + } + + // optional bytes lcl = 7; + case 7: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_lcl())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:p2p.Proposal) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.Proposal) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Proposal::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.Proposal) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string connections = 1; + for (int i = 0, n = this->connections_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->connections(i).data(), static_cast(this->connections(i).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Proposal.connections"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( + 1, this->connections(i), output); + } + + // repeated string inputs = 2; + for (int i = 0, n = this->inputs_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->inputs(i).data(), static_cast(this->inputs(i).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Proposal.inputs"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( + 2, this->inputs(i), output); + } + + // repeated string outputs = 3; + for (int i = 0, n = this->outputs_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->outputs(i).data(), static_cast(this->outputs(i).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Proposal.outputs"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString( + 3, this->outputs(i), output); + } + + cached_has_bits = _has_bits_[0]; + // optional int32 stage = 4; + if (cached_has_bits & 0x00000004u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(4, this->stage(), output); + } + + // optional int32 time = 5; + if (cached_has_bits & 0x00000008u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(5, this->time(), output); + } + + // optional .p2p.State state = 6; + if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, _Internal::state(this), output); + } + + // optional bytes lcl = 7; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 7, this->lcl(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.Proposal) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Proposal::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.Proposal) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // repeated string connections = 1; + for (int i = 0, n = this->connections_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->connections(i).data(), static_cast(this->connections(i).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Proposal.connections"); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + WriteStringToArray(1, this->connections(i), target); + } + + // repeated string inputs = 2; + for (int i = 0, n = this->inputs_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->inputs(i).data(), static_cast(this->inputs(i).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Proposal.inputs"); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + WriteStringToArray(2, this->inputs(i), target); + } + + // repeated string outputs = 3; + for (int i = 0, n = this->outputs_size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( + this->outputs(i).data(), static_cast(this->outputs(i).length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, + "p2p.Proposal.outputs"); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + WriteStringToArray(3, this->outputs(i), target); + } + + cached_has_bits = _has_bits_[0]; + // optional int32 stage = 4; + if (cached_has_bits & 0x00000004u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->stage(), target); + } + + // optional int32 time = 5; + if (cached_has_bits & 0x00000008u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->time(), target); + } + + // optional .p2p.State state = 6; + if (cached_has_bits & 0x00000002u) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 6, _Internal::state(this), target); + } + + // optional bytes lcl = 7; + if (cached_has_bits & 0x00000001u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 7, this->lcl(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.Proposal) + return target; +} + +size_t Proposal::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.Proposal) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated string connections = 1; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->connections_size()); + for (int i = 0, n = this->connections_size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->connections(i)); + } + + // repeated string inputs = 2; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->inputs_size()); + for (int i = 0, n = this->inputs_size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->inputs(i)); + } + + // repeated string outputs = 3; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->outputs_size()); + for (int i = 0, n = this->outputs_size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->outputs(i)); + } + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + // optional bytes lcl = 7; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->lcl()); + } + + // optional .p2p.State state = 6; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *state_); + } + + // optional int32 stage = 4; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->stage()); + } + + // optional int32 time = 5; + if (cached_has_bits & 0x00000008u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->time()); + } + + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Proposal::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.Proposal) + GOOGLE_DCHECK_NE(&from, this); + const Proposal* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.Proposal) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.Proposal) + MergeFrom(*source); + } +} + +void Proposal::MergeFrom(const Proposal& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.Proposal) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + connections_.MergeFrom(from.connections_); + inputs_.MergeFrom(from.inputs_); + outputs_.MergeFrom(from.outputs_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 0x0000000fu) { + if (cached_has_bits & 0x00000001u) { + _has_bits_[0] |= 0x00000001u; + lcl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.lcl_); + } + if (cached_has_bits & 0x00000002u) { + mutable_state()->::p2p::State::MergeFrom(from.state()); + } + if (cached_has_bits & 0x00000004u) { + stage_ = from.stage_; + } + if (cached_has_bits & 0x00000008u) { + time_ = from.time_; + } + _has_bits_[0] |= cached_has_bits; + } +} + +void Proposal::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.Proposal) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Proposal::CopyFrom(const Proposal& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.Proposal) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Proposal::IsInitialized() const { + return true; +} + +void Proposal::InternalSwap(Proposal* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + connections_.InternalSwap(CastToBase(&other->connections_)); + inputs_.InternalSwap(CastToBase(&other->inputs_)); + outputs_.InternalSwap(CastToBase(&other->outputs_)); + lcl_.Swap(&other->lcl_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + swap(state_, other->state_); + swap(stage_, other->stage_); + swap(time_, other->time_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Proposal::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void NPL::InitAsDefaultInstance() { +} +class NPL::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); + static void set_has_data(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static void set_has_lcl(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } +}; + +NPL::NPL() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.NPL) +} +NPL::NPL(const NPL& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_data()) { + data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_); + } + lcl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.has_lcl()) { + lcl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.lcl_); + } + // @@protoc_insertion_point(copy_constructor:p2p.NPL) +} + +void NPL::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NPL_message_2eproto.base); + data_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + lcl_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +NPL::~NPL() { + // @@protoc_insertion_point(destructor:p2p.NPL) + SharedDtor(); +} + +void NPL::SharedDtor() { + data_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + lcl_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void NPL::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const NPL& NPL::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NPL_message_2eproto.base); + return *internal_default_instance(); +} + + +void NPL::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.NPL) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + data_.ClearNonDefaultToEmptyNoArena(); + } + if (cached_has_bits & 0x00000002u) { + lcl_.ClearNonDefaultToEmptyNoArena(); + } + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* NPL::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // optional bytes data = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_data(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + // optional bytes lcl = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_lcl(), ptr, ctx); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + _has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool NPL::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.NPL) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes data = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_data())); + } else { + goto handle_unusual; + } + break; + } + + // optional bytes lcl = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes( + input, this->mutable_lcl())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:p2p.NPL) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.NPL) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void NPL::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.NPL) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional bytes data = 1; + if (cached_has_bits & 0x00000001u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->data(), output); + } + + // optional bytes lcl = 2; + if (cached_has_bits & 0x00000002u) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->lcl(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.NPL) +} + +::PROTOBUF_NAMESPACE_ID::uint8* NPL::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.NPL) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // optional bytes data = 1; + if (cached_has_bits & 0x00000001u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 1, this->data(), target); + } + + // optional bytes lcl = 2; + if (cached_has_bits & 0x00000002u) { + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray( + 2, this->lcl(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.NPL) + return target; +} + +size_t NPL::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.NPL) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional bytes data = 1; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->data()); + } + + // optional bytes lcl = 2; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize( + this->lcl()); + } + + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NPL::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.NPL) + GOOGLE_DCHECK_NE(&from, this); + const NPL* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.NPL) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.NPL) + MergeFrom(*source); + } +} + +void NPL::MergeFrom(const NPL& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.NPL) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _has_bits_[0] |= 0x00000001u; + data_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.data_); + } + if (cached_has_bits & 0x00000002u) { + _has_bits_[0] |= 0x00000002u; + lcl_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.lcl_); + } + } +} + +void NPL::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.NPL) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NPL::CopyFrom(const NPL& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.NPL) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NPL::IsInitialized() const { + return true; +} + +void NPL::InternalSwap(NPL* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); + data_.Swap(&other->data_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); + lcl_.Swap(&other->lcl_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata NPL::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void StateRequest::InitAsDefaultInstance() { +} +class StateRequest::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); +}; + +StateRequest::StateRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.StateRequest) +} +StateRequest::StateRequest(const StateRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:p2p.StateRequest) +} + +void StateRequest::SharedCtor() { +} + +StateRequest::~StateRequest() { + // @@protoc_insertion_point(destructor:p2p.StateRequest) + SharedDtor(); +} + +void StateRequest::SharedDtor() { +} + +void StateRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StateRequest& StateRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StateRequest_message_2eproto.base); + return *internal_default_instance(); +} + + +void StateRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.StateRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* StateRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + default: { + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool StateRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.StateRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:p2p.StateRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.StateRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void StateRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.StateRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.StateRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* StateRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.StateRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.StateRequest) + return target; +} + +size_t StateRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.StateRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StateRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.StateRequest) + GOOGLE_DCHECK_NE(&from, this); + const StateRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.StateRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.StateRequest) + MergeFrom(*source); + } +} + +void StateRequest::MergeFrom(const StateRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.StateRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void StateRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.StateRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StateRequest::CopyFrom(const StateRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.StateRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StateRequest::IsInitialized() const { + return true; +} + +void StateRequest::InternalSwap(StateRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StateRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void StateResponse::InitAsDefaultInstance() { +} +class StateResponse::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); +}; + +StateResponse::StateResponse() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.StateResponse) +} +StateResponse::StateResponse(const StateResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:p2p.StateResponse) +} + +void StateResponse::SharedCtor() { +} + +StateResponse::~StateResponse() { + // @@protoc_insertion_point(destructor:p2p.StateResponse) + SharedDtor(); +} + +void StateResponse::SharedDtor() { +} + +void StateResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const StateResponse& StateResponse::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StateResponse_message_2eproto.base); + return *internal_default_instance(); +} + + +void StateResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.StateResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* StateResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + default: { + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool StateResponse::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.StateResponse) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:p2p.StateResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.StateResponse) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void StateResponse::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.StateResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.StateResponse) +} + +::PROTOBUF_NAMESPACE_ID::uint8* StateResponse::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.StateResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.StateResponse) + return target; +} + +size_t StateResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.StateResponse) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void StateResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.StateResponse) + GOOGLE_DCHECK_NE(&from, this); + const StateResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.StateResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.StateResponse) + MergeFrom(*source); + } +} + +void StateResponse::MergeFrom(const StateResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.StateResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void StateResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.StateResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StateResponse::CopyFrom(const StateResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.StateResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StateResponse::IsInitialized() const { + return true; +} + +void StateResponse::InternalSwap(StateResponse* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StateResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void HistoryRequest::InitAsDefaultInstance() { +} +class HistoryRequest::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); +}; + +HistoryRequest::HistoryRequest() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.HistoryRequest) +} +HistoryRequest::HistoryRequest(const HistoryRequest& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:p2p.HistoryRequest) +} + +void HistoryRequest::SharedCtor() { +} + +HistoryRequest::~HistoryRequest() { + // @@protoc_insertion_point(destructor:p2p.HistoryRequest) + SharedDtor(); +} + +void HistoryRequest::SharedDtor() { +} + +void HistoryRequest::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const HistoryRequest& HistoryRequest::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HistoryRequest_message_2eproto.base); + return *internal_default_instance(); +} + + +void HistoryRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.HistoryRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* HistoryRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + default: { + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool HistoryRequest::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.HistoryRequest) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:p2p.HistoryRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.HistoryRequest) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void HistoryRequest::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.HistoryRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.HistoryRequest) +} + +::PROTOBUF_NAMESPACE_ID::uint8* HistoryRequest::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.HistoryRequest) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.HistoryRequest) + return target; +} + +size_t HistoryRequest::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.HistoryRequest) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HistoryRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.HistoryRequest) + GOOGLE_DCHECK_NE(&from, this); + const HistoryRequest* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.HistoryRequest) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.HistoryRequest) + MergeFrom(*source); + } +} + +void HistoryRequest::MergeFrom(const HistoryRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.HistoryRequest) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void HistoryRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.HistoryRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HistoryRequest::CopyFrom(const HistoryRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.HistoryRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HistoryRequest::IsInitialized() const { + return true; +} + +void HistoryRequest::InternalSwap(HistoryRequest* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata HistoryRequest::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void HistoryResponse::InitAsDefaultInstance() { +} +class HistoryResponse::_Internal { + public: + using HasBits = decltype(std::declval()._has_bits_); +}; + +HistoryResponse::HistoryResponse() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:p2p.HistoryResponse) +} +HistoryResponse::HistoryResponse(const HistoryResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr), + _has_bits_(from._has_bits_) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:p2p.HistoryResponse) +} + +void HistoryResponse::SharedCtor() { +} + +HistoryResponse::~HistoryResponse() { + // @@protoc_insertion_point(destructor:p2p.HistoryResponse) + SharedDtor(); +} + +void HistoryResponse::SharedDtor() { +} + +void HistoryResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const HistoryResponse& HistoryResponse::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HistoryResponse_message_2eproto.base); + return *internal_default_instance(); +} + + +void HistoryResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:p2p.HistoryResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _has_bits_.Clear(); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* HistoryResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + default: { + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool HistoryResponse::MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + // @@protoc_insertion_point(parse_start:p2p.HistoryResponse) + for (;;) { + ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField( + input, tag, _internal_metadata_.mutable_unknown_fields())); + } +success: + // @@protoc_insertion_point(parse_success:p2p.HistoryResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:p2p.HistoryResponse) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void HistoryResponse::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:p2p.HistoryResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:p2p.HistoryResponse) +} + +::PROTOBUF_NAMESPACE_ID::uint8* HistoryResponse::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:p2p.HistoryResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (_internal_metadata_.have_unknown_fields()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:p2p.HistoryResponse) + return target; +} + +size_t HistoryResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:p2p.HistoryResponse) + size_t total_size = 0; + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize( + _internal_metadata_.unknown_fields()); + } + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void HistoryResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:p2p.HistoryResponse) + GOOGLE_DCHECK_NE(&from, this); + const HistoryResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:p2p.HistoryResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:p2p.HistoryResponse) + MergeFrom(*source); + } +} + +void HistoryResponse::MergeFrom(const HistoryResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:p2p.HistoryResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void HistoryResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:p2p.HistoryResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HistoryResponse::CopyFrom(const HistoryResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:p2p.HistoryResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HistoryResponse::IsInitialized() const { + return true; +} + +void HistoryResponse::InternalSwap(HistoryResponse* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_has_bits_[0], other->_has_bits_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata HistoryResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace p2p +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::p2p::Message* Arena::CreateMaybeMessage< ::p2p::Message >(Arena* arena) { + return Arena::CreateInternal< ::p2p::Message >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::StateDifference_CreatedEntry_DoNotUse* Arena::CreateMaybeMessage< ::p2p::StateDifference_CreatedEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::p2p::StateDifference_CreatedEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::StateDifference_UpdatedEntry_DoNotUse* Arena::CreateMaybeMessage< ::p2p::StateDifference_UpdatedEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::p2p::StateDifference_UpdatedEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::StateDifference_DeletedEntry_DoNotUse* Arena::CreateMaybeMessage< ::p2p::StateDifference_DeletedEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::p2p::StateDifference_DeletedEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::StateDifference* Arena::CreateMaybeMessage< ::p2p::StateDifference >(Arena* arena) { + return Arena::CreateInternal< ::p2p::StateDifference >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::State_PatchEntry_DoNotUse* Arena::CreateMaybeMessage< ::p2p::State_PatchEntry_DoNotUse >(Arena* arena) { + return Arena::CreateInternal< ::p2p::State_PatchEntry_DoNotUse >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::State* Arena::CreateMaybeMessage< ::p2p::State >(Arena* arena) { + return Arena::CreateInternal< ::p2p::State >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::Proposal* Arena::CreateMaybeMessage< ::p2p::Proposal >(Arena* arena) { + return Arena::CreateInternal< ::p2p::Proposal >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::NPL* Arena::CreateMaybeMessage< ::p2p::NPL >(Arena* arena) { + return Arena::CreateInternal< ::p2p::NPL >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::StateRequest* Arena::CreateMaybeMessage< ::p2p::StateRequest >(Arena* arena) { + return Arena::CreateInternal< ::p2p::StateRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::StateResponse* Arena::CreateMaybeMessage< ::p2p::StateResponse >(Arena* arena) { + return Arena::CreateInternal< ::p2p::StateResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::HistoryRequest* Arena::CreateMaybeMessage< ::p2p::HistoryRequest >(Arena* arena) { + return Arena::CreateInternal< ::p2p::HistoryRequest >(arena); +} +template<> PROTOBUF_NOINLINE ::p2p::HistoryResponse* Arena::CreateMaybeMessage< ::p2p::HistoryResponse >(Arena* arena) { + return Arena::CreateInternal< ::p2p::HistoryResponse >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/src/p2p/message.pb.h b/src/p2p/message.pb.h new file mode 100644 index 00000000..26b1afc8 --- /dev/null +++ b/src/p2p/message.pb.h @@ -0,0 +1,2885 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: message.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_message_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_message_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3009000 +#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 3009002 < 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 +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_message_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_message_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[13] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_message_2eproto; +namespace p2p { +class HistoryRequest; +class HistoryRequestDefaultTypeInternal; +extern HistoryRequestDefaultTypeInternal _HistoryRequest_default_instance_; +class HistoryResponse; +class HistoryResponseDefaultTypeInternal; +extern HistoryResponseDefaultTypeInternal _HistoryResponse_default_instance_; +class Message; +class MessageDefaultTypeInternal; +extern MessageDefaultTypeInternal _Message_default_instance_; +class NPL; +class NPLDefaultTypeInternal; +extern NPLDefaultTypeInternal _NPL_default_instance_; +class Proposal; +class ProposalDefaultTypeInternal; +extern ProposalDefaultTypeInternal _Proposal_default_instance_; +class State; +class StateDefaultTypeInternal; +extern StateDefaultTypeInternal _State_default_instance_; +class StateDifference; +class StateDifferenceDefaultTypeInternal; +extern StateDifferenceDefaultTypeInternal _StateDifference_default_instance_; +class StateDifference_CreatedEntry_DoNotUse; +class StateDifference_CreatedEntry_DoNotUseDefaultTypeInternal; +extern StateDifference_CreatedEntry_DoNotUseDefaultTypeInternal _StateDifference_CreatedEntry_DoNotUse_default_instance_; +class StateDifference_DeletedEntry_DoNotUse; +class StateDifference_DeletedEntry_DoNotUseDefaultTypeInternal; +extern StateDifference_DeletedEntry_DoNotUseDefaultTypeInternal _StateDifference_DeletedEntry_DoNotUse_default_instance_; +class StateDifference_UpdatedEntry_DoNotUse; +class StateDifference_UpdatedEntry_DoNotUseDefaultTypeInternal; +extern StateDifference_UpdatedEntry_DoNotUseDefaultTypeInternal _StateDifference_UpdatedEntry_DoNotUse_default_instance_; +class StateRequest; +class StateRequestDefaultTypeInternal; +extern StateRequestDefaultTypeInternal _StateRequest_default_instance_; +class StateResponse; +class StateResponseDefaultTypeInternal; +extern StateResponseDefaultTypeInternal _StateResponse_default_instance_; +class State_PatchEntry_DoNotUse; +class State_PatchEntry_DoNotUseDefaultTypeInternal; +extern State_PatchEntry_DoNotUseDefaultTypeInternal _State_PatchEntry_DoNotUse_default_instance_; +} // namespace p2p +PROTOBUF_NAMESPACE_OPEN +template<> ::p2p::HistoryRequest* Arena::CreateMaybeMessage<::p2p::HistoryRequest>(Arena*); +template<> ::p2p::HistoryResponse* Arena::CreateMaybeMessage<::p2p::HistoryResponse>(Arena*); +template<> ::p2p::Message* Arena::CreateMaybeMessage<::p2p::Message>(Arena*); +template<> ::p2p::NPL* Arena::CreateMaybeMessage<::p2p::NPL>(Arena*); +template<> ::p2p::Proposal* Arena::CreateMaybeMessage<::p2p::Proposal>(Arena*); +template<> ::p2p::State* Arena::CreateMaybeMessage<::p2p::State>(Arena*); +template<> ::p2p::StateDifference* Arena::CreateMaybeMessage<::p2p::StateDifference>(Arena*); +template<> ::p2p::StateDifference_CreatedEntry_DoNotUse* Arena::CreateMaybeMessage<::p2p::StateDifference_CreatedEntry_DoNotUse>(Arena*); +template<> ::p2p::StateDifference_DeletedEntry_DoNotUse* Arena::CreateMaybeMessage<::p2p::StateDifference_DeletedEntry_DoNotUse>(Arena*); +template<> ::p2p::StateDifference_UpdatedEntry_DoNotUse* Arena::CreateMaybeMessage<::p2p::StateDifference_UpdatedEntry_DoNotUse>(Arena*); +template<> ::p2p::StateRequest* Arena::CreateMaybeMessage<::p2p::StateRequest>(Arena*); +template<> ::p2p::StateResponse* Arena::CreateMaybeMessage<::p2p::StateResponse>(Arena*); +template<> ::p2p::State_PatchEntry_DoNotUse* Arena::CreateMaybeMessage<::p2p::State_PatchEntry_DoNotUse>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace p2p { + +enum Message_Messagetype : int { + Message_Messagetype_PROPOSAL = 0, + Message_Messagetype_NPL = 1, + Message_Messagetype_STATE_REQUEST = 2, + Message_Messagetype_STATE_RESPONSE = 3, + Message_Messagetype_HISTORY_REQUEST = 4, + Message_Messagetype_HISTORY_RESPONSE = 5 +}; +bool Message_Messagetype_IsValid(int value); +constexpr Message_Messagetype Message_Messagetype_Messagetype_MIN = Message_Messagetype_PROPOSAL; +constexpr Message_Messagetype Message_Messagetype_Messagetype_MAX = Message_Messagetype_HISTORY_RESPONSE; +constexpr int Message_Messagetype_Messagetype_ARRAYSIZE = Message_Messagetype_Messagetype_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Message_Messagetype_descriptor(); +template +inline const std::string& Message_Messagetype_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Message_Messagetype_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Message_Messagetype_descriptor(), enum_t_value); +} +inline bool Message_Messagetype_Parse( + const std::string& name, Message_Messagetype* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Message_Messagetype_descriptor(), name, value); +} +// =================================================================== + +class Message : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.Message) */ { + public: + Message(); + virtual ~Message(); + + Message(const Message& from); + Message(Message&& from) noexcept + : Message() { + *this = ::std::move(from); + } + + inline Message& operator=(const Message& from) { + CopyFrom(from); + return *this; + } + inline Message& operator=(Message&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const Message& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Message* internal_default_instance() { + return reinterpret_cast( + &_Message_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(Message& a, Message& b) { + a.Swap(&b); + } + inline void Swap(Message* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline Message* New() const final { + return CreateMaybeMessage(nullptr); + } + + Message* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const Message& from); + void MergeFrom(const Message& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Message* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.Message"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + typedef Message_Messagetype Messagetype; + static constexpr Messagetype PROPOSAL = + Message_Messagetype_PROPOSAL; + static constexpr Messagetype NPL = + Message_Messagetype_NPL; + static constexpr Messagetype STATE_REQUEST = + Message_Messagetype_STATE_REQUEST; + static constexpr Messagetype STATE_RESPONSE = + Message_Messagetype_STATE_RESPONSE; + static constexpr Messagetype HISTORY_REQUEST = + Message_Messagetype_HISTORY_REQUEST; + static constexpr Messagetype HISTORY_RESPONSE = + Message_Messagetype_HISTORY_RESPONSE; + static inline bool Messagetype_IsValid(int value) { + return Message_Messagetype_IsValid(value); + } + static constexpr Messagetype Messagetype_MIN = + Message_Messagetype_Messagetype_MIN; + static constexpr Messagetype Messagetype_MAX = + Message_Messagetype_Messagetype_MAX; + static constexpr int Messagetype_ARRAYSIZE = + Message_Messagetype_Messagetype_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Messagetype_descriptor() { + return Message_Messagetype_descriptor(); + } + template + static inline const std::string& Messagetype_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Messagetype_Name."); + return Message_Messagetype_Name(enum_t_value); + } + static inline bool Messagetype_Parse(const std::string& name, + Messagetype* value) { + return Message_Messagetype_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kVersionFieldNumber = 1, + kPublicKeyFieldNumber = 2, + kSignatureFieldNumber = 4, + kContentFieldNumber = 6, + kTimestampFieldNumber = 3, + kTypeFieldNumber = 5, + }; + // optional string version = 1; + bool has_version() const; + void clear_version(); + const std::string& version() const; + void set_version(const std::string& value); + void set_version(std::string&& value); + void set_version(const char* value); + void set_version(const char* value, size_t size); + std::string* mutable_version(); + std::string* release_version(); + void set_allocated_version(std::string* version); + + // optional bytes publicKey = 2; + bool has_publickey() const; + void clear_publickey(); + const std::string& publickey() const; + void set_publickey(const std::string& value); + void set_publickey(std::string&& value); + void set_publickey(const char* value); + void set_publickey(const void* value, size_t size); + std::string* mutable_publickey(); + std::string* release_publickey(); + void set_allocated_publickey(std::string* publickey); + + // optional bytes signature = 4; + bool has_signature() const; + void clear_signature(); + const std::string& signature() const; + void set_signature(const std::string& value); + void set_signature(std::string&& value); + void set_signature(const char* value); + void set_signature(const void* value, size_t size); + std::string* mutable_signature(); + std::string* release_signature(); + void set_allocated_signature(std::string* signature); + + // optional bytes content = 6; + bool has_content() const; + void clear_content(); + const std::string& content() const; + void set_content(const std::string& value); + void set_content(std::string&& value); + void set_content(const char* value); + void set_content(const void* value, size_t size); + std::string* mutable_content(); + std::string* release_content(); + void set_allocated_content(std::string* content); + + // optional int32 timestamp = 3; + bool has_timestamp() const; + void clear_timestamp(); + ::PROTOBUF_NAMESPACE_ID::int32 timestamp() const; + void set_timestamp(::PROTOBUF_NAMESPACE_ID::int32 value); + + // optional .p2p.Message.Messagetype type = 5; + bool has_type() const; + void clear_type(); + ::p2p::Message_Messagetype type() const; + void set_type(::p2p::Message_Messagetype value); + + // @@protoc_insertion_point(class_scope:p2p.Message) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr version_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr publickey_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr signature_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_; + ::PROTOBUF_NAMESPACE_ID::int32 timestamp_; + int type_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class StateDifference_CreatedEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + StateDifference_CreatedEntry_DoNotUse(); + StateDifference_CreatedEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const StateDifference_CreatedEntry_DoNotUse& other); + static const StateDifference_CreatedEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_StateDifference_CreatedEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.StateDifference.CreatedEntry.key"); +#endif + return true; + } + static bool ValidateValue(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.StateDifference.CreatedEntry.value"); +#endif + return true; + } + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& other) final; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[1]; + } + + public: +}; + +// ------------------------------------------------------------------- + +class StateDifference_UpdatedEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + StateDifference_UpdatedEntry_DoNotUse(); + StateDifference_UpdatedEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const StateDifference_UpdatedEntry_DoNotUse& other); + static const StateDifference_UpdatedEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_StateDifference_UpdatedEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.StateDifference.UpdatedEntry.key"); +#endif + return true; + } + static bool ValidateValue(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.StateDifference.UpdatedEntry.value"); +#endif + return true; + } + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& other) final; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[2]; + } + + public: +}; + +// ------------------------------------------------------------------- + +class StateDifference_DeletedEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + StateDifference_DeletedEntry_DoNotUse(); + StateDifference_DeletedEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const StateDifference_DeletedEntry_DoNotUse& other); + static const StateDifference_DeletedEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_StateDifference_DeletedEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.StateDifference.DeletedEntry.key"); +#endif + return true; + } + static bool ValidateValue(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.StateDifference.DeletedEntry.value"); +#endif + return true; + } + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& other) final; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[3]; + } + + public: +}; + +// ------------------------------------------------------------------- + +class StateDifference : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.StateDifference) */ { + public: + StateDifference(); + virtual ~StateDifference(); + + StateDifference(const StateDifference& from); + StateDifference(StateDifference&& from) noexcept + : StateDifference() { + *this = ::std::move(from); + } + + inline StateDifference& operator=(const StateDifference& from) { + CopyFrom(from); + return *this; + } + inline StateDifference& operator=(StateDifference&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const StateDifference& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StateDifference* internal_default_instance() { + return reinterpret_cast( + &_StateDifference_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(StateDifference& a, StateDifference& b) { + a.Swap(&b); + } + inline void Swap(StateDifference* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline StateDifference* New() const final { + return CreateMaybeMessage(nullptr); + } + + StateDifference* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const StateDifference& from); + void MergeFrom(const StateDifference& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StateDifference* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.StateDifference"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + enum : int { + kCreatedFieldNumber = 1, + kUpdatedFieldNumber = 2, + kDeletedFieldNumber = 3, + }; + // map created = 1; + int created_size() const; + void clear_created(); + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& + created() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* + mutable_created(); + + // map updated = 2; + int updated_size() const; + void clear_updated(); + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& + updated() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* + mutable_updated(); + + // map deleted = 3; + int deleted_size() const; + void clear_deleted(); + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& + deleted() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* + mutable_deleted(); + + // @@protoc_insertion_point(class_scope:p2p.StateDifference) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StateDifference_CreatedEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 > created_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StateDifference_UpdatedEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 > updated_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + StateDifference_DeletedEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 > deleted_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class State_PatchEntry_DoNotUse : public ::PROTOBUF_NAMESPACE_ID::internal::MapEntry { +public: + typedef ::PROTOBUF_NAMESPACE_ID::internal::MapEntry SuperType; + State_PatchEntry_DoNotUse(); + State_PatchEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + void MergeFrom(const State_PatchEntry_DoNotUse& other); + static const State_PatchEntry_DoNotUse* internal_default_instance() { return reinterpret_cast(&_State_PatchEntry_DoNotUse_default_instance_); } + static bool ValidateKey(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.State.PatchEntry.key"); +#endif + return true; + } + static bool ValidateValue(std::string* s) { +#ifndef NDEBUG + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s->data(), s->size(), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, "p2p.State.PatchEntry.value"); +#endif + return true; + } + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& other) final; + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[5]; + } + + public: +}; + +// ------------------------------------------------------------------- + +class State : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.State) */ { + public: + State(); + virtual ~State(); + + State(const State& from); + State(State&& from) noexcept + : State() { + *this = ::std::move(from); + } + + inline State& operator=(const State& from) { + CopyFrom(from); + return *this; + } + inline State& operator=(State&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const State& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const State* internal_default_instance() { + return reinterpret_cast( + &_State_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(State& a, State& b) { + a.Swap(&b); + } + inline void Swap(State* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline State* New() const final { + return CreateMaybeMessage(nullptr); + } + + State* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const State& from); + void MergeFrom(const State& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(State* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.State"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + + // accessors ------------------------------------------------------- + + enum : int { + kPatchFieldNumber = 4, + kPreviousFieldNumber = 1, + kCurrentFieldNumber = 2, + kDifferenceFieldNumber = 3, + }; + // map patch = 4; + int patch_size() const; + void clear_patch(); + const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& + patch() const; + ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* + mutable_patch(); + + // optional bytes previous = 1; + bool has_previous() const; + void clear_previous(); + const std::string& previous() const; + void set_previous(const std::string& value); + void set_previous(std::string&& value); + void set_previous(const char* value); + void set_previous(const void* value, size_t size); + std::string* mutable_previous(); + std::string* release_previous(); + void set_allocated_previous(std::string* previous); + + // optional bytes current = 2; + bool has_current() const; + void clear_current(); + const std::string& current() const; + void set_current(const std::string& value); + void set_current(std::string&& value); + void set_current(const char* value); + void set_current(const void* value, size_t size); + std::string* mutable_current(); + std::string* release_current(); + void set_allocated_current(std::string* current); + + // optional .p2p.StateDifference difference = 3; + bool has_difference() const; + void clear_difference(); + const ::p2p::StateDifference& difference() const; + ::p2p::StateDifference* release_difference(); + ::p2p::StateDifference* mutable_difference(); + void set_allocated_difference(::p2p::StateDifference* difference); + + // @@protoc_insertion_point(class_scope:p2p.State) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::MapField< + State_PatchEntry_DoNotUse, + std::string, std::string, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING, + 0 > patch_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr previous_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr current_; + ::p2p::StateDifference* difference_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class Proposal : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.Proposal) */ { + public: + Proposal(); + virtual ~Proposal(); + + Proposal(const Proposal& from); + Proposal(Proposal&& from) noexcept + : Proposal() { + *this = ::std::move(from); + } + + inline Proposal& operator=(const Proposal& from) { + CopyFrom(from); + return *this; + } + inline Proposal& operator=(Proposal&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const Proposal& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Proposal* internal_default_instance() { + return reinterpret_cast( + &_Proposal_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(Proposal& a, Proposal& b) { + a.Swap(&b); + } + inline void Swap(Proposal* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline Proposal* New() const final { + return CreateMaybeMessage(nullptr); + } + + Proposal* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const Proposal& from); + void MergeFrom(const Proposal& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Proposal* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.Proposal"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kConnectionsFieldNumber = 1, + kInputsFieldNumber = 2, + kOutputsFieldNumber = 3, + kLclFieldNumber = 7, + kStateFieldNumber = 6, + kStageFieldNumber = 4, + kTimeFieldNumber = 5, + }; + // repeated string connections = 1; + int connections_size() const; + void clear_connections(); + const std::string& connections(int index) const; + std::string* mutable_connections(int index); + void set_connections(int index, const std::string& value); + void set_connections(int index, std::string&& value); + void set_connections(int index, const char* value); + void set_connections(int index, const char* value, size_t size); + std::string* add_connections(); + void add_connections(const std::string& value); + void add_connections(std::string&& value); + void add_connections(const char* value); + void add_connections(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& connections() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_connections(); + + // repeated string inputs = 2; + int inputs_size() const; + void clear_inputs(); + const std::string& inputs(int index) const; + std::string* mutable_inputs(int index); + void set_inputs(int index, const std::string& value); + void set_inputs(int index, std::string&& value); + void set_inputs(int index, const char* value); + void set_inputs(int index, const char* value, size_t size); + std::string* add_inputs(); + void add_inputs(const std::string& value); + void add_inputs(std::string&& value); + void add_inputs(const char* value); + void add_inputs(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& inputs() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_inputs(); + + // repeated string outputs = 3; + int outputs_size() const; + void clear_outputs(); + const std::string& outputs(int index) const; + std::string* mutable_outputs(int index); + void set_outputs(int index, const std::string& value); + void set_outputs(int index, std::string&& value); + void set_outputs(int index, const char* value); + void set_outputs(int index, const char* value, size_t size); + std::string* add_outputs(); + void add_outputs(const std::string& value); + void add_outputs(std::string&& value); + void add_outputs(const char* value); + void add_outputs(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& outputs() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_outputs(); + + // optional bytes lcl = 7; + bool has_lcl() const; + void clear_lcl(); + const std::string& lcl() const; + void set_lcl(const std::string& value); + void set_lcl(std::string&& value); + void set_lcl(const char* value); + void set_lcl(const void* value, size_t size); + std::string* mutable_lcl(); + std::string* release_lcl(); + void set_allocated_lcl(std::string* lcl); + + // optional .p2p.State state = 6; + bool has_state() const; + void clear_state(); + const ::p2p::State& state() const; + ::p2p::State* release_state(); + ::p2p::State* mutable_state(); + void set_allocated_state(::p2p::State* state); + + // optional int32 stage = 4; + bool has_stage() const; + void clear_stage(); + ::PROTOBUF_NAMESPACE_ID::int32 stage() const; + void set_stage(::PROTOBUF_NAMESPACE_ID::int32 value); + + // optional int32 time = 5; + bool has_time() const; + void clear_time(); + ::PROTOBUF_NAMESPACE_ID::int32 time() const; + void set_time(::PROTOBUF_NAMESPACE_ID::int32 value); + + // @@protoc_insertion_point(class_scope:p2p.Proposal) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField connections_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField inputs_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField outputs_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr lcl_; + ::p2p::State* state_; + ::PROTOBUF_NAMESPACE_ID::int32 stage_; + ::PROTOBUF_NAMESPACE_ID::int32 time_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class NPL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.NPL) */ { + public: + NPL(); + virtual ~NPL(); + + NPL(const NPL& from); + NPL(NPL&& from) noexcept + : NPL() { + *this = ::std::move(from); + } + + inline NPL& operator=(const NPL& from) { + CopyFrom(from); + return *this; + } + inline NPL& operator=(NPL&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const NPL& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NPL* internal_default_instance() { + return reinterpret_cast( + &_NPL_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + friend void swap(NPL& a, NPL& b) { + a.Swap(&b); + } + inline void Swap(NPL* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline NPL* New() const final { + return CreateMaybeMessage(nullptr); + } + + NPL* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const NPL& from); + void MergeFrom(const NPL& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NPL* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.NPL"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kDataFieldNumber = 1, + kLclFieldNumber = 2, + }; + // optional bytes data = 1; + bool has_data() const; + void clear_data(); + const std::string& data() const; + void set_data(const std::string& value); + void set_data(std::string&& value); + void set_data(const char* value); + void set_data(const void* value, size_t size); + std::string* mutable_data(); + std::string* release_data(); + void set_allocated_data(std::string* data); + + // optional bytes lcl = 2; + bool has_lcl() const; + void clear_lcl(); + const std::string& lcl() const; + void set_lcl(const std::string& value); + void set_lcl(std::string&& value); + void set_lcl(const char* value); + void set_lcl(const void* value, size_t size); + std::string* mutable_lcl(); + std::string* release_lcl(); + void set_allocated_lcl(std::string* lcl); + + // @@protoc_insertion_point(class_scope:p2p.NPL) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr lcl_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class StateRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.StateRequest) */ { + public: + StateRequest(); + virtual ~StateRequest(); + + StateRequest(const StateRequest& from); + StateRequest(StateRequest&& from) noexcept + : StateRequest() { + *this = ::std::move(from); + } + + inline StateRequest& operator=(const StateRequest& from) { + CopyFrom(from); + return *this; + } + inline StateRequest& operator=(StateRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const StateRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StateRequest* internal_default_instance() { + return reinterpret_cast( + &_StateRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + friend void swap(StateRequest& a, StateRequest& b) { + a.Swap(&b); + } + inline void Swap(StateRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline StateRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + StateRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const StateRequest& from); + void MergeFrom(const StateRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StateRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.StateRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:p2p.StateRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class StateResponse : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.StateResponse) */ { + public: + StateResponse(); + virtual ~StateResponse(); + + StateResponse(const StateResponse& from); + StateResponse(StateResponse&& from) noexcept + : StateResponse() { + *this = ::std::move(from); + } + + inline StateResponse& operator=(const StateResponse& from) { + CopyFrom(from); + return *this; + } + inline StateResponse& operator=(StateResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const StateResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const StateResponse* internal_default_instance() { + return reinterpret_cast( + &_StateResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + friend void swap(StateResponse& a, StateResponse& b) { + a.Swap(&b); + } + inline void Swap(StateResponse* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline StateResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + StateResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const StateResponse& from); + void MergeFrom(const StateResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StateResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.StateResponse"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:p2p.StateResponse) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class HistoryRequest : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.HistoryRequest) */ { + public: + HistoryRequest(); + virtual ~HistoryRequest(); + + HistoryRequest(const HistoryRequest& from); + HistoryRequest(HistoryRequest&& from) noexcept + : HistoryRequest() { + *this = ::std::move(from); + } + + inline HistoryRequest& operator=(const HistoryRequest& from) { + CopyFrom(from); + return *this; + } + inline HistoryRequest& operator=(HistoryRequest&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const HistoryRequest& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HistoryRequest* internal_default_instance() { + return reinterpret_cast( + &_HistoryRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = + 11; + + friend void swap(HistoryRequest& a, HistoryRequest& b) { + a.Swap(&b); + } + inline void Swap(HistoryRequest* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline HistoryRequest* New() const final { + return CreateMaybeMessage(nullptr); + } + + HistoryRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const HistoryRequest& from); + void MergeFrom(const HistoryRequest& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HistoryRequest* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.HistoryRequest"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:p2p.HistoryRequest) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_message_2eproto; +}; +// ------------------------------------------------------------------- + +class HistoryResponse : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:p2p.HistoryResponse) */ { + public: + HistoryResponse(); + virtual ~HistoryResponse(); + + HistoryResponse(const HistoryResponse& from); + HistoryResponse(HistoryResponse&& from) noexcept + : HistoryResponse() { + *this = ::std::move(from); + } + + inline HistoryResponse& operator=(const HistoryResponse& from) { + CopyFrom(from); + return *this; + } + inline HistoryResponse& operator=(HistoryResponse&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const HistoryResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const HistoryResponse* internal_default_instance() { + return reinterpret_cast( + &_HistoryResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 12; + + friend void swap(HistoryResponse& a, HistoryResponse& b) { + a.Swap(&b); + } + inline void Swap(HistoryResponse* other) { + if (other == this) return; + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline HistoryResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + HistoryResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const HistoryResponse& from); + void MergeFrom(const HistoryResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + #else + bool MergePartialFromCodedStream( + ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; + #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + void SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; + ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(HistoryResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "p2p.HistoryResponse"; + } + private: + inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { + return nullptr; + } + inline void* MaybeArenaPtr() const { + return nullptr; + } + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_message_2eproto); + return ::descriptor_table_message_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:p2p.HistoryResponse) + private: + class _Internal; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_message_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// Message + +// optional string version = 1; +inline bool Message::has_version() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Message::clear_version() { + version_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Message::version() const { + // @@protoc_insertion_point(field_get:p2p.Message.version) + return version_.GetNoArena(); +} +inline void Message::set_version(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + version_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.Message.version) +} +inline void Message::set_version(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + version_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.Message.version) +} +inline void Message::set_version(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + version_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.Message.version) +} +inline void Message::set_version(const char* value, size_t size) { + _has_bits_[0] |= 0x00000001u; + version_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.Message.version) +} +inline std::string* Message::mutable_version() { + _has_bits_[0] |= 0x00000001u; + // @@protoc_insertion_point(field_mutable:p2p.Message.version) + return version_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* Message::release_version() { + // @@protoc_insertion_point(field_release:p2p.Message.version) + if (!has_version()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return version_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void Message::set_allocated_version(std::string* version) { + if (version != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + version_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), version); + // @@protoc_insertion_point(field_set_allocated:p2p.Message.version) +} + +// optional bytes publicKey = 2; +inline bool Message::has_publickey() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Message::clear_publickey() { + publickey_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000002u; +} +inline const std::string& Message::publickey() const { + // @@protoc_insertion_point(field_get:p2p.Message.publicKey) + return publickey_.GetNoArena(); +} +inline void Message::set_publickey(const std::string& value) { + _has_bits_[0] |= 0x00000002u; + publickey_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.Message.publicKey) +} +inline void Message::set_publickey(std::string&& value) { + _has_bits_[0] |= 0x00000002u; + publickey_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.Message.publicKey) +} +inline void Message::set_publickey(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000002u; + publickey_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.Message.publicKey) +} +inline void Message::set_publickey(const void* value, size_t size) { + _has_bits_[0] |= 0x00000002u; + publickey_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.Message.publicKey) +} +inline std::string* Message::mutable_publickey() { + _has_bits_[0] |= 0x00000002u; + // @@protoc_insertion_point(field_mutable:p2p.Message.publicKey) + return publickey_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* Message::release_publickey() { + // @@protoc_insertion_point(field_release:p2p.Message.publicKey) + if (!has_publickey()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000002u; + return publickey_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void Message::set_allocated_publickey(std::string* publickey) { + if (publickey != nullptr) { + _has_bits_[0] |= 0x00000002u; + } else { + _has_bits_[0] &= ~0x00000002u; + } + publickey_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), publickey); + // @@protoc_insertion_point(field_set_allocated:p2p.Message.publicKey) +} + +// optional int32 timestamp = 3; +inline bool Message::has_timestamp() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void Message::clear_timestamp() { + timestamp_ = 0; + _has_bits_[0] &= ~0x00000010u; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 Message::timestamp() const { + // @@protoc_insertion_point(field_get:p2p.Message.timestamp) + return timestamp_; +} +inline void Message::set_timestamp(::PROTOBUF_NAMESPACE_ID::int32 value) { + _has_bits_[0] |= 0x00000010u; + timestamp_ = value; + // @@protoc_insertion_point(field_set:p2p.Message.timestamp) +} + +// optional bytes signature = 4; +inline bool Message::has_signature() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Message::clear_signature() { + signature_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000004u; +} +inline const std::string& Message::signature() const { + // @@protoc_insertion_point(field_get:p2p.Message.signature) + return signature_.GetNoArena(); +} +inline void Message::set_signature(const std::string& value) { + _has_bits_[0] |= 0x00000004u; + signature_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.Message.signature) +} +inline void Message::set_signature(std::string&& value) { + _has_bits_[0] |= 0x00000004u; + signature_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.Message.signature) +} +inline void Message::set_signature(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000004u; + signature_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.Message.signature) +} +inline void Message::set_signature(const void* value, size_t size) { + _has_bits_[0] |= 0x00000004u; + signature_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.Message.signature) +} +inline std::string* Message::mutable_signature() { + _has_bits_[0] |= 0x00000004u; + // @@protoc_insertion_point(field_mutable:p2p.Message.signature) + return signature_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* Message::release_signature() { + // @@protoc_insertion_point(field_release:p2p.Message.signature) + if (!has_signature()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000004u; + return signature_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void Message::set_allocated_signature(std::string* signature) { + if (signature != nullptr) { + _has_bits_[0] |= 0x00000004u; + } else { + _has_bits_[0] &= ~0x00000004u; + } + signature_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), signature); + // @@protoc_insertion_point(field_set_allocated:p2p.Message.signature) +} + +// optional .p2p.Message.Messagetype type = 5; +inline bool Message::has_type() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void Message::clear_type() { + type_ = 0; + _has_bits_[0] &= ~0x00000020u; +} +inline ::p2p::Message_Messagetype Message::type() const { + // @@protoc_insertion_point(field_get:p2p.Message.type) + return static_cast< ::p2p::Message_Messagetype >(type_); +} +inline void Message::set_type(::p2p::Message_Messagetype value) { + assert(::p2p::Message_Messagetype_IsValid(value)); + _has_bits_[0] |= 0x00000020u; + type_ = value; + // @@protoc_insertion_point(field_set:p2p.Message.type) +} + +// optional bytes content = 6; +inline bool Message::has_content() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Message::clear_content() { + content_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000008u; +} +inline const std::string& Message::content() const { + // @@protoc_insertion_point(field_get:p2p.Message.content) + return content_.GetNoArena(); +} +inline void Message::set_content(const std::string& value) { + _has_bits_[0] |= 0x00000008u; + content_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.Message.content) +} +inline void Message::set_content(std::string&& value) { + _has_bits_[0] |= 0x00000008u; + content_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.Message.content) +} +inline void Message::set_content(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000008u; + content_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.Message.content) +} +inline void Message::set_content(const void* value, size_t size) { + _has_bits_[0] |= 0x00000008u; + content_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.Message.content) +} +inline std::string* Message::mutable_content() { + _has_bits_[0] |= 0x00000008u; + // @@protoc_insertion_point(field_mutable:p2p.Message.content) + return content_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* Message::release_content() { + // @@protoc_insertion_point(field_release:p2p.Message.content) + if (!has_content()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000008u; + return content_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void Message::set_allocated_content(std::string* content) { + if (content != nullptr) { + _has_bits_[0] |= 0x00000008u; + } else { + _has_bits_[0] &= ~0x00000008u; + } + content_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content); + // @@protoc_insertion_point(field_set_allocated:p2p.Message.content) +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// StateDifference + +// map created = 1; +inline int StateDifference::created_size() const { + return created_.size(); +} +inline void StateDifference::clear_created() { + created_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +StateDifference::created() const { + // @@protoc_insertion_point(field_map:p2p.StateDifference.created) + return created_.GetMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +StateDifference::mutable_created() { + // @@protoc_insertion_point(field_mutable_map:p2p.StateDifference.created) + return created_.MutableMap(); +} + +// map updated = 2; +inline int StateDifference::updated_size() const { + return updated_.size(); +} +inline void StateDifference::clear_updated() { + updated_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +StateDifference::updated() const { + // @@protoc_insertion_point(field_map:p2p.StateDifference.updated) + return updated_.GetMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +StateDifference::mutable_updated() { + // @@protoc_insertion_point(field_mutable_map:p2p.StateDifference.updated) + return updated_.MutableMap(); +} + +// map deleted = 3; +inline int StateDifference::deleted_size() const { + return deleted_.size(); +} +inline void StateDifference::clear_deleted() { + deleted_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +StateDifference::deleted() const { + // @@protoc_insertion_point(field_map:p2p.StateDifference.deleted) + return deleted_.GetMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +StateDifference::mutable_deleted() { + // @@protoc_insertion_point(field_mutable_map:p2p.StateDifference.deleted) + return deleted_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// State + +// optional bytes previous = 1; +inline bool State::has_previous() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void State::clear_previous() { + previous_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& State::previous() const { + // @@protoc_insertion_point(field_get:p2p.State.previous) + return previous_.GetNoArena(); +} +inline void State::set_previous(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + previous_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.State.previous) +} +inline void State::set_previous(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + previous_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.State.previous) +} +inline void State::set_previous(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + previous_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.State.previous) +} +inline void State::set_previous(const void* value, size_t size) { + _has_bits_[0] |= 0x00000001u; + previous_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.State.previous) +} +inline std::string* State::mutable_previous() { + _has_bits_[0] |= 0x00000001u; + // @@protoc_insertion_point(field_mutable:p2p.State.previous) + return previous_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* State::release_previous() { + // @@protoc_insertion_point(field_release:p2p.State.previous) + if (!has_previous()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return previous_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void State::set_allocated_previous(std::string* previous) { + if (previous != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + previous_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), previous); + // @@protoc_insertion_point(field_set_allocated:p2p.State.previous) +} + +// optional bytes current = 2; +inline bool State::has_current() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void State::clear_current() { + current_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000002u; +} +inline const std::string& State::current() const { + // @@protoc_insertion_point(field_get:p2p.State.current) + return current_.GetNoArena(); +} +inline void State::set_current(const std::string& value) { + _has_bits_[0] |= 0x00000002u; + current_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.State.current) +} +inline void State::set_current(std::string&& value) { + _has_bits_[0] |= 0x00000002u; + current_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.State.current) +} +inline void State::set_current(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000002u; + current_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.State.current) +} +inline void State::set_current(const void* value, size_t size) { + _has_bits_[0] |= 0x00000002u; + current_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.State.current) +} +inline std::string* State::mutable_current() { + _has_bits_[0] |= 0x00000002u; + // @@protoc_insertion_point(field_mutable:p2p.State.current) + return current_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* State::release_current() { + // @@protoc_insertion_point(field_release:p2p.State.current) + if (!has_current()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000002u; + return current_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void State::set_allocated_current(std::string* current) { + if (current != nullptr) { + _has_bits_[0] |= 0x00000002u; + } else { + _has_bits_[0] &= ~0x00000002u; + } + current_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), current); + // @@protoc_insertion_point(field_set_allocated:p2p.State.current) +} + +// optional .p2p.StateDifference difference = 3; +inline bool State::has_difference() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void State::clear_difference() { + if (difference_ != nullptr) difference_->Clear(); + _has_bits_[0] &= ~0x00000004u; +} +inline const ::p2p::StateDifference& State::difference() const { + const ::p2p::StateDifference* p = difference_; + // @@protoc_insertion_point(field_get:p2p.State.difference) + return p != nullptr ? *p : *reinterpret_cast( + &::p2p::_StateDifference_default_instance_); +} +inline ::p2p::StateDifference* State::release_difference() { + // @@protoc_insertion_point(field_release:p2p.State.difference) + _has_bits_[0] &= ~0x00000004u; + ::p2p::StateDifference* temp = difference_; + difference_ = nullptr; + return temp; +} +inline ::p2p::StateDifference* State::mutable_difference() { + _has_bits_[0] |= 0x00000004u; + if (difference_ == nullptr) { + auto* p = CreateMaybeMessage<::p2p::StateDifference>(GetArenaNoVirtual()); + difference_ = p; + } + // @@protoc_insertion_point(field_mutable:p2p.State.difference) + return difference_; +} +inline void State::set_allocated_difference(::p2p::StateDifference* difference) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete difference_; + } + if (difference) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + difference = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, difference, submessage_arena); + } + _has_bits_[0] |= 0x00000004u; + } else { + _has_bits_[0] &= ~0x00000004u; + } + difference_ = difference; + // @@protoc_insertion_point(field_set_allocated:p2p.State.difference) +} + +// map patch = 4; +inline int State::patch_size() const { + return patch_.size(); +} +inline void State::clear_patch() { + patch_.Clear(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >& +State::patch() const { + // @@protoc_insertion_point(field_map:p2p.State.patch) + return patch_.GetMap(); +} +inline ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >* +State::mutable_patch() { + // @@protoc_insertion_point(field_mutable_map:p2p.State.patch) + return patch_.MutableMap(); +} + +// ------------------------------------------------------------------- + +// Proposal + +// repeated string connections = 1; +inline int Proposal::connections_size() const { + return connections_.size(); +} +inline void Proposal::clear_connections() { + connections_.Clear(); +} +inline const std::string& Proposal::connections(int index) const { + // @@protoc_insertion_point(field_get:p2p.Proposal.connections) + return connections_.Get(index); +} +inline std::string* Proposal::mutable_connections(int index) { + // @@protoc_insertion_point(field_mutable:p2p.Proposal.connections) + return connections_.Mutable(index); +} +inline void Proposal::set_connections(int index, const std::string& value) { + // @@protoc_insertion_point(field_set:p2p.Proposal.connections) + connections_.Mutable(index)->assign(value); +} +inline void Proposal::set_connections(int index, std::string&& value) { + // @@protoc_insertion_point(field_set:p2p.Proposal.connections) + connections_.Mutable(index)->assign(std::move(value)); +} +inline void Proposal::set_connections(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + connections_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:p2p.Proposal.connections) +} +inline void Proposal::set_connections(int index, const char* value, size_t size) { + connections_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:p2p.Proposal.connections) +} +inline std::string* Proposal::add_connections() { + // @@protoc_insertion_point(field_add_mutable:p2p.Proposal.connections) + return connections_.Add(); +} +inline void Proposal::add_connections(const std::string& value) { + connections_.Add()->assign(value); + // @@protoc_insertion_point(field_add:p2p.Proposal.connections) +} +inline void Proposal::add_connections(std::string&& value) { + connections_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:p2p.Proposal.connections) +} +inline void Proposal::add_connections(const char* value) { + GOOGLE_DCHECK(value != nullptr); + connections_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:p2p.Proposal.connections) +} +inline void Proposal::add_connections(const char* value, size_t size) { + connections_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:p2p.Proposal.connections) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +Proposal::connections() const { + // @@protoc_insertion_point(field_list:p2p.Proposal.connections) + return connections_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +Proposal::mutable_connections() { + // @@protoc_insertion_point(field_mutable_list:p2p.Proposal.connections) + return &connections_; +} + +// repeated string inputs = 2; +inline int Proposal::inputs_size() const { + return inputs_.size(); +} +inline void Proposal::clear_inputs() { + inputs_.Clear(); +} +inline const std::string& Proposal::inputs(int index) const { + // @@protoc_insertion_point(field_get:p2p.Proposal.inputs) + return inputs_.Get(index); +} +inline std::string* Proposal::mutable_inputs(int index) { + // @@protoc_insertion_point(field_mutable:p2p.Proposal.inputs) + return inputs_.Mutable(index); +} +inline void Proposal::set_inputs(int index, const std::string& value) { + // @@protoc_insertion_point(field_set:p2p.Proposal.inputs) + inputs_.Mutable(index)->assign(value); +} +inline void Proposal::set_inputs(int index, std::string&& value) { + // @@protoc_insertion_point(field_set:p2p.Proposal.inputs) + inputs_.Mutable(index)->assign(std::move(value)); +} +inline void Proposal::set_inputs(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + inputs_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:p2p.Proposal.inputs) +} +inline void Proposal::set_inputs(int index, const char* value, size_t size) { + inputs_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:p2p.Proposal.inputs) +} +inline std::string* Proposal::add_inputs() { + // @@protoc_insertion_point(field_add_mutable:p2p.Proposal.inputs) + return inputs_.Add(); +} +inline void Proposal::add_inputs(const std::string& value) { + inputs_.Add()->assign(value); + // @@protoc_insertion_point(field_add:p2p.Proposal.inputs) +} +inline void Proposal::add_inputs(std::string&& value) { + inputs_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:p2p.Proposal.inputs) +} +inline void Proposal::add_inputs(const char* value) { + GOOGLE_DCHECK(value != nullptr); + inputs_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:p2p.Proposal.inputs) +} +inline void Proposal::add_inputs(const char* value, size_t size) { + inputs_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:p2p.Proposal.inputs) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +Proposal::inputs() const { + // @@protoc_insertion_point(field_list:p2p.Proposal.inputs) + return inputs_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +Proposal::mutable_inputs() { + // @@protoc_insertion_point(field_mutable_list:p2p.Proposal.inputs) + return &inputs_; +} + +// repeated string outputs = 3; +inline int Proposal::outputs_size() const { + return outputs_.size(); +} +inline void Proposal::clear_outputs() { + outputs_.Clear(); +} +inline const std::string& Proposal::outputs(int index) const { + // @@protoc_insertion_point(field_get:p2p.Proposal.outputs) + return outputs_.Get(index); +} +inline std::string* Proposal::mutable_outputs(int index) { + // @@protoc_insertion_point(field_mutable:p2p.Proposal.outputs) + return outputs_.Mutable(index); +} +inline void Proposal::set_outputs(int index, const std::string& value) { + // @@protoc_insertion_point(field_set:p2p.Proposal.outputs) + outputs_.Mutable(index)->assign(value); +} +inline void Proposal::set_outputs(int index, std::string&& value) { + // @@protoc_insertion_point(field_set:p2p.Proposal.outputs) + outputs_.Mutable(index)->assign(std::move(value)); +} +inline void Proposal::set_outputs(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + outputs_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:p2p.Proposal.outputs) +} +inline void Proposal::set_outputs(int index, const char* value, size_t size) { + outputs_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:p2p.Proposal.outputs) +} +inline std::string* Proposal::add_outputs() { + // @@protoc_insertion_point(field_add_mutable:p2p.Proposal.outputs) + return outputs_.Add(); +} +inline void Proposal::add_outputs(const std::string& value) { + outputs_.Add()->assign(value); + // @@protoc_insertion_point(field_add:p2p.Proposal.outputs) +} +inline void Proposal::add_outputs(std::string&& value) { + outputs_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:p2p.Proposal.outputs) +} +inline void Proposal::add_outputs(const char* value) { + GOOGLE_DCHECK(value != nullptr); + outputs_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:p2p.Proposal.outputs) +} +inline void Proposal::add_outputs(const char* value, size_t size) { + outputs_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:p2p.Proposal.outputs) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +Proposal::outputs() const { + // @@protoc_insertion_point(field_list:p2p.Proposal.outputs) + return outputs_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +Proposal::mutable_outputs() { + // @@protoc_insertion_point(field_mutable_list:p2p.Proposal.outputs) + return &outputs_; +} + +// optional int32 stage = 4; +inline bool Proposal::has_stage() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Proposal::clear_stage() { + stage_ = 0; + _has_bits_[0] &= ~0x00000004u; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 Proposal::stage() const { + // @@protoc_insertion_point(field_get:p2p.Proposal.stage) + return stage_; +} +inline void Proposal::set_stage(::PROTOBUF_NAMESPACE_ID::int32 value) { + _has_bits_[0] |= 0x00000004u; + stage_ = value; + // @@protoc_insertion_point(field_set:p2p.Proposal.stage) +} + +// optional int32 time = 5; +inline bool Proposal::has_time() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Proposal::clear_time() { + time_ = 0; + _has_bits_[0] &= ~0x00000008u; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 Proposal::time() const { + // @@protoc_insertion_point(field_get:p2p.Proposal.time) + return time_; +} +inline void Proposal::set_time(::PROTOBUF_NAMESPACE_ID::int32 value) { + _has_bits_[0] |= 0x00000008u; + time_ = value; + // @@protoc_insertion_point(field_set:p2p.Proposal.time) +} + +// optional .p2p.State state = 6; +inline bool Proposal::has_state() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Proposal::clear_state() { + if (state_ != nullptr) state_->Clear(); + _has_bits_[0] &= ~0x00000002u; +} +inline const ::p2p::State& Proposal::state() const { + const ::p2p::State* p = state_; + // @@protoc_insertion_point(field_get:p2p.Proposal.state) + return p != nullptr ? *p : *reinterpret_cast( + &::p2p::_State_default_instance_); +} +inline ::p2p::State* Proposal::release_state() { + // @@protoc_insertion_point(field_release:p2p.Proposal.state) + _has_bits_[0] &= ~0x00000002u; + ::p2p::State* temp = state_; + state_ = nullptr; + return temp; +} +inline ::p2p::State* Proposal::mutable_state() { + _has_bits_[0] |= 0x00000002u; + if (state_ == nullptr) { + auto* p = CreateMaybeMessage<::p2p::State>(GetArenaNoVirtual()); + state_ = p; + } + // @@protoc_insertion_point(field_mutable:p2p.Proposal.state) + return state_; +} +inline void Proposal::set_allocated_state(::p2p::State* state) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + if (message_arena == nullptr) { + delete state_; + } + if (state) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + state = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, state, submessage_arena); + } + _has_bits_[0] |= 0x00000002u; + } else { + _has_bits_[0] &= ~0x00000002u; + } + state_ = state; + // @@protoc_insertion_point(field_set_allocated:p2p.Proposal.state) +} + +// optional bytes lcl = 7; +inline bool Proposal::has_lcl() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Proposal::clear_lcl() { + lcl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& Proposal::lcl() const { + // @@protoc_insertion_point(field_get:p2p.Proposal.lcl) + return lcl_.GetNoArena(); +} +inline void Proposal::set_lcl(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + lcl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.Proposal.lcl) +} +inline void Proposal::set_lcl(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + lcl_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.Proposal.lcl) +} +inline void Proposal::set_lcl(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + lcl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.Proposal.lcl) +} +inline void Proposal::set_lcl(const void* value, size_t size) { + _has_bits_[0] |= 0x00000001u; + lcl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.Proposal.lcl) +} +inline std::string* Proposal::mutable_lcl() { + _has_bits_[0] |= 0x00000001u; + // @@protoc_insertion_point(field_mutable:p2p.Proposal.lcl) + return lcl_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* Proposal::release_lcl() { + // @@protoc_insertion_point(field_release:p2p.Proposal.lcl) + if (!has_lcl()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return lcl_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void Proposal::set_allocated_lcl(std::string* lcl) { + if (lcl != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + lcl_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), lcl); + // @@protoc_insertion_point(field_set_allocated:p2p.Proposal.lcl) +} + +// ------------------------------------------------------------------- + +// NPL + +// optional bytes data = 1; +inline bool NPL::has_data() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void NPL::clear_data() { + data_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000001u; +} +inline const std::string& NPL::data() const { + // @@protoc_insertion_point(field_get:p2p.NPL.data) + return data_.GetNoArena(); +} +inline void NPL::set_data(const std::string& value) { + _has_bits_[0] |= 0x00000001u; + data_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.NPL.data) +} +inline void NPL::set_data(std::string&& value) { + _has_bits_[0] |= 0x00000001u; + data_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.NPL.data) +} +inline void NPL::set_data(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000001u; + data_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.NPL.data) +} +inline void NPL::set_data(const void* value, size_t size) { + _has_bits_[0] |= 0x00000001u; + data_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.NPL.data) +} +inline std::string* NPL::mutable_data() { + _has_bits_[0] |= 0x00000001u; + // @@protoc_insertion_point(field_mutable:p2p.NPL.data) + return data_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* NPL::release_data() { + // @@protoc_insertion_point(field_release:p2p.NPL.data) + if (!has_data()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000001u; + return data_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void NPL::set_allocated_data(std::string* data) { + if (data != nullptr) { + _has_bits_[0] |= 0x00000001u; + } else { + _has_bits_[0] &= ~0x00000001u; + } + data_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), data); + // @@protoc_insertion_point(field_set_allocated:p2p.NPL.data) +} + +// optional bytes lcl = 2; +inline bool NPL::has_lcl() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void NPL::clear_lcl() { + lcl_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + _has_bits_[0] &= ~0x00000002u; +} +inline const std::string& NPL::lcl() const { + // @@protoc_insertion_point(field_get:p2p.NPL.lcl) + return lcl_.GetNoArena(); +} +inline void NPL::set_lcl(const std::string& value) { + _has_bits_[0] |= 0x00000002u; + lcl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:p2p.NPL.lcl) +} +inline void NPL::set_lcl(std::string&& value) { + _has_bits_[0] |= 0x00000002u; + lcl_.SetNoArena( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:p2p.NPL.lcl) +} +inline void NPL::set_lcl(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _has_bits_[0] |= 0x00000002u; + lcl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:p2p.NPL.lcl) +} +inline void NPL::set_lcl(const void* value, size_t size) { + _has_bits_[0] |= 0x00000002u; + lcl_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:p2p.NPL.lcl) +} +inline std::string* NPL::mutable_lcl() { + _has_bits_[0] |= 0x00000002u; + // @@protoc_insertion_point(field_mutable:p2p.NPL.lcl) + return lcl_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline std::string* NPL::release_lcl() { + // @@protoc_insertion_point(field_release:p2p.NPL.lcl) + if (!has_lcl()) { + return nullptr; + } + _has_bits_[0] &= ~0x00000002u; + return lcl_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} +inline void NPL::set_allocated_lcl(std::string* lcl) { + if (lcl != nullptr) { + _has_bits_[0] |= 0x00000002u; + } else { + _has_bits_[0] &= ~0x00000002u; + } + lcl_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), lcl); + // @@protoc_insertion_point(field_set_allocated:p2p.NPL.lcl) +} + +// ------------------------------------------------------------------- + +// StateRequest + +// ------------------------------------------------------------------- + +// StateResponse + +// ------------------------------------------------------------------- + +// HistoryRequest + +// ------------------------------------------------------------------- + +// HistoryResponse + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace p2p + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::p2p::Message_Messagetype> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::p2p::Message_Messagetype>() { + return ::p2p::Message_Messagetype_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_message_2eproto diff --git a/src/p2p/message.proto b/src/p2p/message.proto new file mode 100644 index 00000000..60f84ac2 --- /dev/null +++ b/src/p2p/message.proto @@ -0,0 +1,69 @@ +syntax = "proto2"; + +package p2p; + +message Message { + optional string version = 1; + optional bytes publicKey = 2; + optional int32 timestamp = 3; + optional bytes signature = 4; + + enum Messagetype { + PROPOSAL = 0; + NPL = 1; + STATE_REQUEST = 2; + STATE_RESPONSE = 3; + HISTORY_REQUEST = 4; + HISTORY_RESPONSE = 5; + } + + optional Messagetype type = 5; + optional bytes content = 6; +} + +message StateDifference { +map created = 1; +map updated = 2; +map deleted = 3; +} + +message State { +optional bytes previous = 1; +optional bytes current = 2; +optional StateDifference difference = 3; +map patch = 4; +} + + +message Proposal { + repeated string connections = 1; + repeated string inputs = 2; + repeated string outputs = 3; + optional int32 stage = 4; + optional int32 time = 5; + optional State state = 6; + optional bytes lcl = 7; +} + +message NPL { + optional bytes data = 1; + optional bytes lcl = 2; +} + +message StateRequest { + +} + +message StateResponse { + +} + +message HistoryRequest { + +} + +message HistoryResponse { + +} + +