From 0a089a6e41a73609cd1ccfff4857b9ef69757964 Mon Sep 17 00:00:00 2001 From: skywb Date: Sun, 19 May 2019 15:15:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8protobuf=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IM/IMProtocol.pb.cc | 2023 +++++++++++++++++++++++++++++++++++++------ IM/IMProtocol.pb.h | 957 +++++++++++++++++++- IM/IMProtocol.proto | 64 +- 3 files changed, 2746 insertions(+), 298 deletions(-) diff --git a/IM/IMProtocol.pb.cc b/IM/IMProtocol.pb.cc index 2a9683f..f8d1d3c 100644 --- a/IM/IMProtocol.pb.cc +++ b/IM/IMProtocol.pb.cc @@ -15,6 +15,24 @@ #include // @@protoc_insertion_point(includes) #include +extern PROTOBUF_INTERNAL_EXPORT_IMProtocol_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Request_login_IMProtocol_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_IMProtocol_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Request_logout_IMProtocol_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_IMProtocol_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Request_sendmsg_IMProtocol_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_IMProtocol_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Response_login_IMProtocol_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_IMProtocol_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Response_sendmsg_IMProtocol_2eproto; +class RequestDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; + const ::Request_login* request_login_; + const ::Request_logout* request_logout_; + const ::Request_sendmsg* request_sendmsg_; +} _Request_default_instance_; +class ResponseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; + const ::Response_login* response_login_; + const ::Response_sendmsg* response_sendmsg_; +} _Response_default_instance_; class Request_loginDefaultTypeInternal { public: ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; @@ -31,6 +49,27 @@ class Request_sendmsgDefaultTypeInternal { public: ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; } _Request_sendmsg_default_instance_; +class Response_sendmsgDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Response_sendmsg_default_instance_; +static void InitDefaultsscc_info_Request_IMProtocol_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_Request_default_instance_; + new (ptr) ::Request(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::Request::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_Request_IMProtocol_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsscc_info_Request_IMProtocol_2eproto}, { + &scc_info_Request_login_IMProtocol_2eproto.base, + &scc_info_Request_logout_IMProtocol_2eproto.base, + &scc_info_Request_sendmsg_IMProtocol_2eproto.base,}}; + static void InitDefaultsscc_info_Request_login_IMProtocol_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -73,6 +112,22 @@ static void InitDefaultsscc_info_Request_sendmsg_IMProtocol_2eproto() { ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Request_sendmsg_IMProtocol_2eproto = {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Request_sendmsg_IMProtocol_2eproto}, {}}; +static void InitDefaultsscc_info_Response_IMProtocol_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_Response_default_instance_; + new (ptr) ::Response(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::Response::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Response_IMProtocol_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_Response_IMProtocol_2eproto}, { + &scc_info_Response_login_IMProtocol_2eproto.base, + &scc_info_Response_sendmsg_IMProtocol_2eproto.base,}}; + static void InitDefaultsscc_info_Response_login_IMProtocol_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; @@ -87,11 +142,44 @@ static void InitDefaultsscc_info_Response_login_IMProtocol_2eproto() { ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Response_login_IMProtocol_2eproto = {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Response_login_IMProtocol_2eproto}, {}}; -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_IMProtocol_2eproto[4]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_IMProtocol_2eproto[1]; +static void InitDefaultsscc_info_Response_sendmsg_IMProtocol_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::_Response_sendmsg_default_instance_; + new (ptr) ::Response_sendmsg(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::Response_sendmsg::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Response_sendmsg_IMProtocol_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_Response_sendmsg_IMProtocol_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_IMProtocol_2eproto[7]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_IMProtocol_2eproto[3]; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_IMProtocol_2eproto = nullptr; const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_IMProtocol_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::Request, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::Request, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::Request, type_), + offsetof(::RequestDefaultTypeInternal, request_login_), + offsetof(::RequestDefaultTypeInternal, request_logout_), + offsetof(::RequestDefaultTypeInternal, request_sendmsg_), + PROTOBUF_FIELD_OFFSET(::Request, pdu_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::Response, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::Response, _oneof_case_[0]), + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::Response, type_), + offsetof(::ResponseDefaultTypeInternal, response_login_), + offsetof(::ResponseDefaultTypeInternal, response_sendmsg_), + PROTOBUF_FIELD_OFFSET(::Response, pdu_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::Request_login, _internal_metadata_), ~0u, // no _extensions_ @@ -116,57 +204,132 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_IMProtocol_2eproto::offsets[] ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::Request_sendmsg, msgid_), PROTOBUF_FIELD_OFFSET(::Request_sendmsg, id_), PROTOBUF_FIELD_OFFSET(::Request_sendmsg, objid_), PROTOBUF_FIELD_OFFSET(::Request_sendmsg, msg_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::Response_sendmsg, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::Response_sendmsg, msgid_), + PROTOBUF_FIELD_OFFSET(::Response_sendmsg, stat_), }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::Request_login)}, - { 7, -1, sizeof(::Response_login)}, - { 13, -1, sizeof(::Request_logout)}, - { 19, -1, sizeof(::Request_sendmsg)}, + { 0, -1, sizeof(::Request)}, + { 10, -1, sizeof(::Response)}, + { 19, -1, sizeof(::Request_login)}, + { 26, -1, sizeof(::Response_login)}, + { 32, -1, sizeof(::Request_logout)}, + { 38, -1, sizeof(::Request_sendmsg)}, + { 47, -1, sizeof(::Response_sendmsg)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::_Request_default_instance_), + reinterpret_cast(&::_Response_default_instance_), reinterpret_cast(&::_Request_login_default_instance_), reinterpret_cast(&::_Response_login_default_instance_), reinterpret_cast(&::_Request_logout_default_instance_), reinterpret_cast(&::_Request_sendmsg_default_instance_), + reinterpret_cast(&::_Response_sendmsg_default_instance_), }; const char descriptor_table_protodef_IMProtocol_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\020IMProtocol.proto\"-\n\rRequest_login\022\n\n\002I" - "D\030\001 \001(\004\022\020\n\010password\030\002 \001(\t\"\214\001\n\016Response_l" - "ogin\022\"\n\004stat\030\001 \001(\0162\024.Response_login.STAT" - "\"V\n\004STAT\022\013\n\007SUCCESS\020\000\022\020\n\014ACCOUNT_NULL\020\001\022" - "\020\n\014ACCOUNT_LOCK\020\002\022\022\n\016PASSWORD_ERROR\020\003\022\t\n" - "\005ERROR\020\n\"\034\n\016Request_logout\022\n\n\002ID\030\001 \001(\004\"9" - "\n\017Request_sendmsg\022\n\n\002ID\030\001 \001(\004\022\r\n\005objID\030\002" - " \001(\004\022\013\n\003msg\030\003 \001(\tb\006proto3" + "\n\020IMProtocol.proto\"\332\001\n\007Request\022\033\n\004type\030\001" + " \001(\0162\r.Request.Type\022\'\n\rrequest_login\030\013 \001" + "(\0132\016.Request_loginH\000\022)\n\016request_logout\030\014" + " \001(\0132\017.Request_logoutH\000\022+\n\017request_sendm" + "sg\030\r \001(\0132\020.Request_sendmsgH\000\"*\n\004Type\022\t\n\005" + "LOGIN\020\000\022\n\n\006LOGOUT\020\001\022\013\n\007SENDMSG\020\002B\005\n\003pdu\"" + "\265\001\n\010Response\022\034\n\004type\030\001 \001(\0162\016.Response.Ty" + "pe\022)\n\016response_login\030\013 \001(\0132\017.Response_lo" + "ginH\000\022-\n\020response_sendmsg\030\r \001(\0132\021.Respon" + "se_sendmsgH\000\"*\n\004Type\022\t\n\005LOGIN\020\000\022\n\n\006LOGOU" + "T\020\001\022\013\n\007SENDMSG\020\002B\005\n\003pdu\"-\n\rRequest_login" + "\022\n\n\002ID\030\001 \001(\004\022\020\n\010password\030\002 \001(\t\"\214\001\n\016Respo" + "nse_login\022\"\n\004stat\030\001 \001(\0162\024.Response_login" + ".STAT\"V\n\004STAT\022\013\n\007SUCCESS\020\000\022\020\n\014ACCOUNT_NU" + "LL\020\001\022\020\n\014ACCOUNT_LOCK\020\002\022\022\n\016PASSWORD_ERROR" + "\020\003\022\t\n\005ERROR\020\n\"\034\n\016Request_logout\022\n\n\002ID\030\001 " + "\001(\004\"H\n\017Request_sendmsg\022\r\n\005msgID\030\001 \001(\r\022\n\n" + "\002ID\030\002 \001(\004\022\r\n\005objID\030\003 \001(\004\022\013\n\003msg\030\004 \001(\t\"/\n" + "\020Response_sendmsg\022\r\n\005msgID\030\001 \001(\r\022\014\n\004stat" + "\030\002 \001(\010b\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_IMProtocol_2eproto_deps[1] = { }; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_IMProtocol_2eproto_sccs[4] = { +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_IMProtocol_2eproto_sccs[7] = { + &scc_info_Request_IMProtocol_2eproto.base, &scc_info_Request_login_IMProtocol_2eproto.base, &scc_info_Request_logout_IMProtocol_2eproto.base, &scc_info_Request_sendmsg_IMProtocol_2eproto.base, + &scc_info_Response_IMProtocol_2eproto.base, &scc_info_Response_login_IMProtocol_2eproto.base, + &scc_info_Response_sendmsg_IMProtocol_2eproto.base, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_IMProtocol_2eproto_once; static bool descriptor_table_IMProtocol_2eproto_initialized = false; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_IMProtocol_2eproto = { - &descriptor_table_IMProtocol_2eproto_initialized, descriptor_table_protodef_IMProtocol_2eproto, "IMProtocol.proto", 305, - &descriptor_table_IMProtocol_2eproto_once, descriptor_table_IMProtocol_2eproto_sccs, descriptor_table_IMProtocol_2eproto_deps, 4, 0, + &descriptor_table_IMProtocol_2eproto_initialized, descriptor_table_protodef_IMProtocol_2eproto, "IMProtocol.proto", 774, + &descriptor_table_IMProtocol_2eproto_once, descriptor_table_IMProtocol_2eproto_sccs, descriptor_table_IMProtocol_2eproto_deps, 7, 0, schemas, file_default_instances, TableStruct_IMProtocol_2eproto::offsets, - file_level_metadata_IMProtocol_2eproto, 4, file_level_enum_descriptors_IMProtocol_2eproto, file_level_service_descriptors_IMProtocol_2eproto, + file_level_metadata_IMProtocol_2eproto, 7, file_level_enum_descriptors_IMProtocol_2eproto, file_level_service_descriptors_IMProtocol_2eproto, }; // Force running AddDescriptors() at dynamic initialization time. static bool dynamic_init_dummy_IMProtocol_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_IMProtocol_2eproto), true); -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Response_login_STAT_descriptor() { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Request_Type_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_IMProtocol_2eproto); return file_level_enum_descriptors_IMProtocol_2eproto[0]; } +bool Request_Type_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +constexpr Request_Type Request::LOGIN; +constexpr Request_Type Request::LOGOUT; +constexpr Request_Type Request::SENDMSG; +constexpr Request_Type Request::Type_MIN; +constexpr Request_Type Request::Type_MAX; +constexpr int Request::Type_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Response_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_IMProtocol_2eproto); + return file_level_enum_descriptors_IMProtocol_2eproto[1]; +} +bool Response_Type_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +constexpr Response_Type Response::LOGIN; +constexpr Response_Type Response::LOGOUT; +constexpr Response_Type Response::SENDMSG; +constexpr Response_Type Response::Type_MIN; +constexpr Response_Type Response::Type_MAX; +constexpr int Response::Type_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Response_login_STAT_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_IMProtocol_2eproto); + return file_level_enum_descriptors_IMProtocol_2eproto[2]; +} bool Response_login_STAT_IsValid(int value) { switch (value) { case 0: @@ -193,88 +356,207 @@ constexpr int Response_login::STAT_ARRAYSIZE; // =================================================================== -void Request_login::InitAsDefaultInstance() { +void Request::InitAsDefaultInstance() { + ::_Request_default_instance_.request_login_ = const_cast< ::Request_login*>( + ::Request_login::internal_default_instance()); + ::_Request_default_instance_.request_logout_ = const_cast< ::Request_logout*>( + ::Request_logout::internal_default_instance()); + ::_Request_default_instance_.request_sendmsg_ = const_cast< ::Request_sendmsg*>( + ::Request_sendmsg::internal_default_instance()); } -class Request_login::HasBitSetters { +class Request::HasBitSetters { public: + static const ::Request_login& request_login(const Request* msg); + static const ::Request_logout& request_logout(const Request* msg); + static const ::Request_sendmsg& request_sendmsg(const Request* msg); }; +const ::Request_login& +Request::HasBitSetters::request_login(const Request* msg) { + return *msg->pdu_.request_login_; +} +const ::Request_logout& +Request::HasBitSetters::request_logout(const Request* msg) { + return *msg->pdu_.request_logout_; +} +const ::Request_sendmsg& +Request::HasBitSetters::request_sendmsg(const Request* msg) { + return *msg->pdu_.request_sendmsg_; +} +void Request::set_allocated_request_login(::Request_login* request_login) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_pdu(); + if (request_login) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + request_login = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, request_login, submessage_arena); + } + set_has_request_login(); + pdu_.request_login_ = request_login; + } + // @@protoc_insertion_point(field_set_allocated:Request.request_login) +} +void Request::set_allocated_request_logout(::Request_logout* request_logout) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_pdu(); + if (request_logout) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + request_logout = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, request_logout, submessage_arena); + } + set_has_request_logout(); + pdu_.request_logout_ = request_logout; + } + // @@protoc_insertion_point(field_set_allocated:Request.request_logout) +} +void Request::set_allocated_request_sendmsg(::Request_sendmsg* request_sendmsg) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_pdu(); + if (request_sendmsg) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + request_sendmsg = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, request_sendmsg, submessage_arena); + } + set_has_request_sendmsg(); + pdu_.request_sendmsg_ = request_sendmsg; + } + // @@protoc_insertion_point(field_set_allocated:Request.request_sendmsg) +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int Request_login::kIDFieldNumber; -const int Request_login::kPasswordFieldNumber; +const int Request::kTypeFieldNumber; +const int Request::kRequestLoginFieldNumber; +const int Request::kRequestLogoutFieldNumber; +const int Request::kRequestSendmsgFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -Request_login::Request_login() +Request::Request() : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { SharedCtor(); - // @@protoc_insertion_point(constructor:Request_login) + // @@protoc_insertion_point(constructor:Request) } -Request_login::Request_login(const Request_login& from) +Request::Request(const Request& from) : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); - password_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (from.password().size() > 0) { - password_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.password_); + type_ = from.type_; + clear_has_pdu(); + switch (from.pdu_case()) { + case kRequestLogin: { + mutable_request_login()->::Request_login::MergeFrom(from.request_login()); + break; + } + case kRequestLogout: { + mutable_request_logout()->::Request_logout::MergeFrom(from.request_logout()); + break; + } + case kRequestSendmsg: { + mutable_request_sendmsg()->::Request_sendmsg::MergeFrom(from.request_sendmsg()); + break; + } + case PDU_NOT_SET: { + break; + } } - id_ = from.id_; - // @@protoc_insertion_point(copy_constructor:Request_login) + // @@protoc_insertion_point(copy_constructor:Request) } -void Request_login::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Request_login_IMProtocol_2eproto.base); - password_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - id_ = PROTOBUF_ULONGLONG(0); +void Request::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Request_IMProtocol_2eproto.base); + type_ = 0; + clear_has_pdu(); } -Request_login::~Request_login() { - // @@protoc_insertion_point(destructor:Request_login) +Request::~Request() { + // @@protoc_insertion_point(destructor:Request) SharedDtor(); } -void Request_login::SharedDtor() { - password_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +void Request::SharedDtor() { + if (has_pdu()) { + clear_pdu(); + } } -void Request_login::SetCachedSize(int size) const { +void Request::SetCachedSize(int size) const { _cached_size_.Set(size); } -const Request_login& Request_login::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Request_login_IMProtocol_2eproto.base); +const Request& Request::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Request_IMProtocol_2eproto.base); return *internal_default_instance(); } -void Request_login::Clear() { -// @@protoc_insertion_point(message_clear_start:Request_login) +void Request::clear_pdu() { +// @@protoc_insertion_point(one_of_clear_start:Request) + switch (pdu_case()) { + case kRequestLogin: { + delete pdu_.request_login_; + break; + } + case kRequestLogout: { + delete pdu_.request_logout_; + break; + } + case kRequestSendmsg: { + delete pdu_.request_sendmsg_; + break; + } + case PDU_NOT_SET: { + break; + } + } + _oneof_case_[0] = PDU_NOT_SET; +} + + +void Request::Clear() { +// @@protoc_insertion_point(message_clear_start:Request) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - password_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - id_ = PROTOBUF_ULONGLONG(0); + type_ = 0; + clear_pdu(); _internal_metadata_.Clear(); } #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Request_login::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Request::_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) { - // uint64 ID = 1; + // .Request.Type type = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); CHK_(ptr); + set_type(static_cast<::Request_Type>(val)); } else goto handle_unusual; continue; - // string password = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_password(), ptr, ctx, "Request_login.password"); + // .Request_login request_login = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + ptr = ctx->ParseMessage(mutable_request_login(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .Request_logout request_logout = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { + ptr = ctx->ParseMessage(mutable_request_logout(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .Request_sendmsg request_sendmsg = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + ptr = ctx->ParseMessage(mutable_request_sendmsg(), ptr); CHK_(ptr); } else goto handle_unusual; continue; @@ -298,38 +580,57 @@ const char* Request_login::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ #undef CHK_ } #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Request_login::MergePartialFromCodedStream( +bool Request::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:Request_login) + // @@protoc_insertion_point(parse_start:Request) 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)) { - // uint64 ID = 1; + // .Request.Type type = 1; case 1: { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { - + int value = 0; DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &id_))); + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_type(static_cast< ::Request_Type >(value)); } else { goto handle_unusual; } break; } - // string password = 2; - case 2: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( - input, this->mutable_password())); - DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->password().data(), static_cast(this->password().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, - "Request_login.password")); + // .Request_login request_login = 11; + case 11: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_request_login())); + } else { + goto handle_unusual; + } + break; + } + + // .Request_logout request_logout = 12; + case 12: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (98 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_request_logout())); + } else { + goto handle_unusual; + } + break; + } + + // .Request_sendmsg request_sendmsg = 13; + case 13: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (106 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_request_sendmsg())); } else { goto handle_unusual; } @@ -348,75 +649,95 @@ bool Request_login::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:Request_login) + // @@protoc_insertion_point(parse_success:Request) return true; failure: - // @@protoc_insertion_point(parse_failure:Request_login) + // @@protoc_insertion_point(parse_failure:Request) return false; #undef DO_ } #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -void Request_login::SerializeWithCachedSizes( +void Request::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:Request_login) + // @@protoc_insertion_point(serialize_start:Request) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // uint64 ID = 1; - if (this->id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); + // .Request.Type type = 1; + if (this->type() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 1, this->type(), output); } - // string password = 2; - if (this->password().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->password().data(), static_cast(this->password().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "Request_login.password"); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->password(), output); + // .Request_login request_login = 11; + if (has_request_login()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, HasBitSetters::request_login(this), output); + } + + // .Request_logout request_logout = 12; + if (has_request_logout()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 12, HasBitSetters::request_logout(this), output); + } + + // .Request_sendmsg request_sendmsg = 13; + if (has_request_sendmsg()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, HasBitSetters::request_sendmsg(this), output); } if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:Request_login) + // @@protoc_insertion_point(serialize_end:Request) } -::PROTOBUF_NAMESPACE_ID::uint8* Request_login::InternalSerializeWithCachedSizesToArray( +::PROTOBUF_NAMESPACE_ID::uint8* Request::InternalSerializeWithCachedSizesToArray( ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:Request_login) + // @@protoc_insertion_point(serialize_to_array_start:Request) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // uint64 ID = 1; - if (this->id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); + // .Request.Type type = 1; + if (this->type() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->type(), target); } - // string password = 2; - if (this->password().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->password().data(), static_cast(this->password().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "Request_login.password"); - target = - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 2, this->password(), target); + // .Request_login request_login = 11; + if (has_request_login()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, HasBitSetters::request_login(this), target); + } + + // .Request_logout request_logout = 12; + if (has_request_logout()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 12, HasBitSetters::request_logout(this), target); + } + + // .Request_sendmsg request_sendmsg = 13; + if (has_request_sendmsg()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 13, HasBitSetters::request_sendmsg(this), 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:Request_login) + // @@protoc_insertion_point(serialize_to_array_end:Request) return target; } -size_t Request_login::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:Request_login) +size_t Request::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Request) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -428,161 +749,289 @@ size_t Request_login::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string password = 2; - if (this->password().size() > 0) { + // .Request.Type type = 1; + if (this->type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->password()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); } - // uint64 ID = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->id()); + switch (pdu_case()) { + // .Request_login request_login = 11; + case kRequestLogin: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *pdu_.request_login_); + break; + } + // .Request_logout request_logout = 12; + case kRequestLogout: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *pdu_.request_logout_); + break; + } + // .Request_sendmsg request_sendmsg = 13; + case kRequestSendmsg: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *pdu_.request_sendmsg_); + break; + } + case PDU_NOT_SET: { + break; + } } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } -void Request_login::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:Request_login) +void Request::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Request) GOOGLE_DCHECK_NE(&from, this); - const Request_login* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + const Request* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( &from); if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:Request_login) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Request) ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:Request_login) + // @@protoc_insertion_point(generalized_merge_from_cast_success:Request) MergeFrom(*source); } } -void Request_login::MergeFrom(const Request_login& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:Request_login) +void Request::MergeFrom(const Request& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Request) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from.password().size() > 0) { - - password_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.password_); + if (from.type() != 0) { + set_type(from.type()); } - if (from.id() != 0) { - set_id(from.id()); + switch (from.pdu_case()) { + case kRequestLogin: { + mutable_request_login()->::Request_login::MergeFrom(from.request_login()); + break; + } + case kRequestLogout: { + mutable_request_logout()->::Request_logout::MergeFrom(from.request_logout()); + break; + } + case kRequestSendmsg: { + mutable_request_sendmsg()->::Request_sendmsg::MergeFrom(from.request_sendmsg()); + break; + } + case PDU_NOT_SET: { + break; + } } } -void Request_login::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:Request_login) +void Request::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Request) if (&from == this) return; Clear(); MergeFrom(from); } -void Request_login::CopyFrom(const Request_login& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:Request_login) +void Request::CopyFrom(const Request& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Request) if (&from == this) return; Clear(); MergeFrom(from); } -bool Request_login::IsInitialized() const { +bool Request::IsInitialized() const { return true; } -void Request_login::Swap(Request_login* other) { +void Request::Swap(Request* other) { if (other == this) return; InternalSwap(other); } -void Request_login::InternalSwap(Request_login* other) { +void Request::InternalSwap(Request* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); - password_.Swap(&other->password_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArenaNoVirtual()); - swap(id_, other->id_); + swap(type_, other->type_); + swap(pdu_, other->pdu_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } -::PROTOBUF_NAMESPACE_ID::Metadata Request_login::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata Request::GetMetadata() const { return GetMetadataStatic(); } // =================================================================== -void Response_login::InitAsDefaultInstance() { +void Response::InitAsDefaultInstance() { + ::_Response_default_instance_.response_login_ = const_cast< ::Response_login*>( + ::Response_login::internal_default_instance()); + ::_Response_default_instance_.response_sendmsg_ = const_cast< ::Response_sendmsg*>( + ::Response_sendmsg::internal_default_instance()); } -class Response_login::HasBitSetters { +class Response::HasBitSetters { public: + static const ::Response_login& response_login(const Response* msg); + static const ::Response_sendmsg& response_sendmsg(const Response* msg); }; +const ::Response_login& +Response::HasBitSetters::response_login(const Response* msg) { + return *msg->pdu_.response_login_; +} +const ::Response_sendmsg& +Response::HasBitSetters::response_sendmsg(const Response* msg) { + return *msg->pdu_.response_sendmsg_; +} +void Response::set_allocated_response_login(::Response_login* response_login) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_pdu(); + if (response_login) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + response_login = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, response_login, submessage_arena); + } + set_has_response_login(); + pdu_.response_login_ = response_login; + } + // @@protoc_insertion_point(field_set_allocated:Response.response_login) +} +void Response::set_allocated_response_sendmsg(::Response_sendmsg* response_sendmsg) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); + clear_pdu(); + if (response_sendmsg) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; + if (message_arena != submessage_arena) { + response_sendmsg = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, response_sendmsg, submessage_arena); + } + set_has_response_sendmsg(); + pdu_.response_sendmsg_ = response_sendmsg; + } + // @@protoc_insertion_point(field_set_allocated:Response.response_sendmsg) +} #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int Response_login::kStatFieldNumber; +const int Response::kTypeFieldNumber; +const int Response::kResponseLoginFieldNumber; +const int Response::kResponseSendmsgFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -Response_login::Response_login() +Response::Response() : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { SharedCtor(); - // @@protoc_insertion_point(constructor:Response_login) + // @@protoc_insertion_point(constructor:Response) } -Response_login::Response_login(const Response_login& from) +Response::Response(const Response& from) : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); - stat_ = from.stat_; - // @@protoc_insertion_point(copy_constructor:Response_login) + type_ = from.type_; + clear_has_pdu(); + switch (from.pdu_case()) { + case kResponseLogin: { + mutable_response_login()->::Response_login::MergeFrom(from.response_login()); + break; + } + case kResponseSendmsg: { + mutable_response_sendmsg()->::Response_sendmsg::MergeFrom(from.response_sendmsg()); + break; + } + case PDU_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:Response) } -void Response_login::SharedCtor() { - stat_ = 0; +void Response::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Response_IMProtocol_2eproto.base); + type_ = 0; + clear_has_pdu(); } -Response_login::~Response_login() { - // @@protoc_insertion_point(destructor:Response_login) +Response::~Response() { + // @@protoc_insertion_point(destructor:Response) SharedDtor(); } -void Response_login::SharedDtor() { +void Response::SharedDtor() { + if (has_pdu()) { + clear_pdu(); + } } -void Response_login::SetCachedSize(int size) const { +void Response::SetCachedSize(int size) const { _cached_size_.Set(size); } -const Response_login& Response_login::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Response_login_IMProtocol_2eproto.base); +const Response& Response::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Response_IMProtocol_2eproto.base); return *internal_default_instance(); } -void Response_login::Clear() { -// @@protoc_insertion_point(message_clear_start:Response_login) +void Response::clear_pdu() { +// @@protoc_insertion_point(one_of_clear_start:Response) + switch (pdu_case()) { + case kResponseLogin: { + delete pdu_.response_login_; + break; + } + case kResponseSendmsg: { + delete pdu_.response_sendmsg_; + break; + } + case PDU_NOT_SET: { + break; + } + } + _oneof_case_[0] = PDU_NOT_SET; +} + + +void Response::Clear() { +// @@protoc_insertion_point(message_clear_start:Response) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - stat_ = 0; + type_ = 0; + clear_pdu(); _internal_metadata_.Clear(); } #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Response_login::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Response::_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) { - // .Response_login.STAT stat = 1; + // .Response.Type type = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); CHK_(ptr); - set_stat(static_cast<::Response_login_STAT>(val)); + set_type(static_cast<::Response_Type>(val)); + } else goto handle_unusual; + continue; + // .Response_login response_login = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + ptr = ctx->ParseMessage(mutable_response_login(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .Response_sendmsg response_sendmsg = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) { + ptr = ctx->ParseMessage(mutable_response_sendmsg(), ptr); + CHK_(ptr); } else goto handle_unusual; continue; default: { @@ -605,24 +1054,46 @@ const char* Response_login::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Response_login::MergePartialFromCodedStream( +bool Response::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:Response_login) + // @@protoc_insertion_point(parse_start:Response) 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)) { - // .Response_login.STAT stat = 1; + // .Response.Type type = 1; case 1: { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { int value = 0; DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( input, &value))); - set_stat(static_cast< ::Response_login_STAT >(value)); + set_type(static_cast< ::Response_Type >(value)); + } else { + goto handle_unusual; + } + break; + } + + // .Response_login response_login = 11; + case 11: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_response_login())); + } else { + goto handle_unusual; + } + break; + } + + // .Response_sendmsg response_sendmsg = 13; + case 13: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (106 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage( + input, mutable_response_sendmsg())); } else { goto handle_unusual; } @@ -641,56 +1112,82 @@ bool Response_login::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:Response_login) + // @@protoc_insertion_point(parse_success:Response) return true; failure: - // @@protoc_insertion_point(parse_failure:Response_login) + // @@protoc_insertion_point(parse_failure:Response) return false; #undef DO_ } #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -void Response_login::SerializeWithCachedSizes( +void Response::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:Response_login) + // @@protoc_insertion_point(serialize_start:Response) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // .Response_login.STAT stat = 1; - if (this->stat() != 0) { + // .Response.Type type = 1; + if (this->type() != 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( - 1, this->stat(), output); + 1, this->type(), output); + } + + // .Response_login response_login = 11; + if (has_response_login()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 11, HasBitSetters::response_login(this), output); + } + + // .Response_sendmsg response_sendmsg = 13; + if (has_response_sendmsg()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray( + 13, HasBitSetters::response_sendmsg(this), output); } if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:Response_login) + // @@protoc_insertion_point(serialize_end:Response) } -::PROTOBUF_NAMESPACE_ID::uint8* Response_login::InternalSerializeWithCachedSizesToArray( +::PROTOBUF_NAMESPACE_ID::uint8* Response::InternalSerializeWithCachedSizesToArray( ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:Response_login) + // @@protoc_insertion_point(serialize_to_array_start:Response) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // .Response_login.STAT stat = 1; - if (this->stat() != 0) { + // .Response.Type type = 1; + if (this->type() != 0) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->stat(), target); + 1, this->type(), target); + } + + // .Response_login response_login = 11; + if (has_response_login()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 11, HasBitSetters::response_login(this), target); + } + + // .Response_sendmsg response_sendmsg = 13; + if (has_response_sendmsg()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessageToArray( + 13, HasBitSetters::response_sendmsg(this), 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:Response_login) + // @@protoc_insertion_point(serialize_to_array_end:Response) return target; } -size_t Response_login::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:Response_login) +size_t Response::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Response) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -702,135 +1199,178 @@ size_t Response_login::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // .Response_login.STAT stat = 1; - if (this->stat() != 0) { + // .Response.Type type = 1; + if (this->type() != 0) { total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->stat()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type()); } + switch (pdu_case()) { + // .Response_login response_login = 11; + case kResponseLogin: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *pdu_.response_login_); + break; + } + // .Response_sendmsg response_sendmsg = 13; + case kResponseSendmsg: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *pdu_.response_sendmsg_); + break; + } + case PDU_NOT_SET: { + break; + } + } int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } -void Response_login::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:Response_login) +void Response::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Response) GOOGLE_DCHECK_NE(&from, this); - const Response_login* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + const Response* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( &from); if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:Response_login) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Response) ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:Response_login) + // @@protoc_insertion_point(generalized_merge_from_cast_success:Response) MergeFrom(*source); } } -void Response_login::MergeFrom(const Response_login& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:Response_login) +void Response::MergeFrom(const Response& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Response) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from.stat() != 0) { - set_stat(from.stat()); + if (from.type() != 0) { + set_type(from.type()); + } + switch (from.pdu_case()) { + case kResponseLogin: { + mutable_response_login()->::Response_login::MergeFrom(from.response_login()); + break; + } + case kResponseSendmsg: { + mutable_response_sendmsg()->::Response_sendmsg::MergeFrom(from.response_sendmsg()); + break; + } + case PDU_NOT_SET: { + break; + } } } -void Response_login::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:Response_login) +void Response::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Response) if (&from == this) return; Clear(); MergeFrom(from); } -void Response_login::CopyFrom(const Response_login& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:Response_login) +void Response::CopyFrom(const Response& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Response) if (&from == this) return; Clear(); MergeFrom(from); } -bool Response_login::IsInitialized() const { +bool Response::IsInitialized() const { return true; } -void Response_login::Swap(Response_login* other) { +void Response::Swap(Response* other) { if (other == this) return; InternalSwap(other); } -void Response_login::InternalSwap(Response_login* other) { +void Response::InternalSwap(Response* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); - swap(stat_, other->stat_); + swap(type_, other->type_); + swap(pdu_, other->pdu_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } -::PROTOBUF_NAMESPACE_ID::Metadata Response_login::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata Response::GetMetadata() const { return GetMetadataStatic(); } // =================================================================== -void Request_logout::InitAsDefaultInstance() { +void Request_login::InitAsDefaultInstance() { } -class Request_logout::HasBitSetters { +class Request_login::HasBitSetters { public: }; #if !defined(_MSC_VER) || _MSC_VER >= 1900 -const int Request_logout::kIDFieldNumber; +const int Request_login::kIDFieldNumber; +const int Request_login::kPasswordFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 -Request_logout::Request_logout() +Request_login::Request_login() : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { SharedCtor(); - // @@protoc_insertion_point(constructor:Request_logout) + // @@protoc_insertion_point(constructor:Request_login) } -Request_logout::Request_logout(const Request_logout& from) +Request_login::Request_login(const Request_login& from) : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); + password_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (from.password().size() > 0) { + password_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.password_); + } id_ = from.id_; - // @@protoc_insertion_point(copy_constructor:Request_logout) + // @@protoc_insertion_point(copy_constructor:Request_login) } -void Request_logout::SharedCtor() { +void Request_login::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Request_login_IMProtocol_2eproto.base); + password_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); id_ = PROTOBUF_ULONGLONG(0); } -Request_logout::~Request_logout() { - // @@protoc_insertion_point(destructor:Request_logout) +Request_login::~Request_login() { + // @@protoc_insertion_point(destructor:Request_login) SharedDtor(); } -void Request_logout::SharedDtor() { +void Request_login::SharedDtor() { + password_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } -void Request_logout::SetCachedSize(int size) const { +void Request_login::SetCachedSize(int size) const { _cached_size_.Set(size); } -const Request_logout& Request_logout::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Request_logout_IMProtocol_2eproto.base); +const Request_login& Request_login::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Request_login_IMProtocol_2eproto.base); return *internal_default_instance(); } -void Request_logout::Clear() { -// @@protoc_insertion_point(message_clear_start:Request_logout) +void Request_login::Clear() { +// @@protoc_insertion_point(message_clear_start:Request_login) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + password_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); id_ = PROTOBUF_ULONGLONG(0); _internal_metadata_.Clear(); } #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -const char* Request_logout::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +const char* Request_login::_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; @@ -844,6 +1384,13 @@ const char* Request_logout::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE CHK_(ptr); } else goto handle_unusual; continue; + // string password = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_password(), ptr, ctx, "Request_login.password"); + CHK_(ptr); + } else goto handle_unusual; + continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -864,11 +1411,11 @@ const char* Request_logout::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE #undef CHK_ } #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -bool Request_logout::MergePartialFromCodedStream( +bool Request_login::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:Request_logout) + // @@protoc_insertion_point(parse_start:Request_login) for (;;) { ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); tag = p.first; @@ -887,6 +1434,21 @@ bool Request_logout::MergePartialFromCodedStream( break; } + // string password = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) { + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( + input, this->mutable_password())); + DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->password().data(), static_cast(this->password().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE, + "Request_login.password")); + } else { + goto handle_unusual; + } + break; + } + default: { handle_unusual: if (tag == 0) { @@ -899,18 +1461,18 @@ bool Request_logout::MergePartialFromCodedStream( } } success: - // @@protoc_insertion_point(parse_success:Request_logout) + // @@protoc_insertion_point(parse_success:Request_login) return true; failure: - // @@protoc_insertion_point(parse_failure:Request_logout) + // @@protoc_insertion_point(parse_failure:Request_login) return false; #undef DO_ } #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER -void Request_logout::SerializeWithCachedSizes( +void Request_login::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { - // @@protoc_insertion_point(serialize_start:Request_logout) + // @@protoc_insertion_point(serialize_start:Request_login) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -919,16 +1481,26 @@ void Request_logout::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); } + // string password = 2; + if (this->password().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->password().data(), static_cast(this->password().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Request_login.password"); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->password(), output); + } + if (_internal_metadata_.have_unknown_fields()) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( _internal_metadata_.unknown_fields(), output); } - // @@protoc_insertion_point(serialize_end:Request_logout) + // @@protoc_insertion_point(serialize_end:Request_login) } -::PROTOBUF_NAMESPACE_ID::uint8* Request_logout::InternalSerializeWithCachedSizesToArray( +::PROTOBUF_NAMESPACE_ID::uint8* Request_login::InternalSerializeWithCachedSizesToArray( ::PROTOBUF_NAMESPACE_ID::uint8* target) const { - // @@protoc_insertion_point(serialize_to_array_start:Request_logout) + // @@protoc_insertion_point(serialize_to_array_start:Request_login) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; @@ -937,16 +1509,27 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Request_logout::InternalSerializeWithCachedSizes target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); } + // string password = 2; + if (this->password().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->password().data(), static_cast(this->password().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "Request_login.password"); + target = + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( + 2, this->password(), 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:Request_logout) + // @@protoc_insertion_point(serialize_to_array_end:Request_login) return target; } -size_t Request_logout::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:Request_logout) +size_t Request_login::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Request_login) size_t total_size = 0; if (_internal_metadata_.have_unknown_fields()) { @@ -958,6 +1541,13 @@ size_t Request_logout::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; + // string password = 2; + if (this->password().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->password()); + } + // uint64 ID = 1; if (this->id() != 0) { total_size += 1 + @@ -970,62 +1560,585 @@ size_t Request_logout::ByteSizeLong() const { return total_size; } -void Request_logout::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:Request_logout) +void Request_login::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Request_login) GOOGLE_DCHECK_NE(&from, this); - const Request_logout* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + const Request_login* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( &from); if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:Request_logout) + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Request_login) ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:Request_logout) + // @@protoc_insertion_point(generalized_merge_from_cast_success:Request_login) MergeFrom(*source); } } -void Request_logout::MergeFrom(const Request_logout& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:Request_logout) +void Request_login::MergeFrom(const Request_login& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Request_login) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; + if (from.password().size() > 0) { + + password_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.password_); + } if (from.id() != 0) { set_id(from.id()); } } -void Request_logout::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:Request_logout) +void Request_login::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Request_login) if (&from == this) return; Clear(); MergeFrom(from); } -void Request_logout::CopyFrom(const Request_logout& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:Request_logout) +void Request_login::CopyFrom(const Request_login& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Request_login) if (&from == this) return; Clear(); MergeFrom(from); } -bool Request_logout::IsInitialized() const { +bool Request_login::IsInitialized() const { return true; } -void Request_logout::Swap(Request_logout* other) { +void Request_login::Swap(Request_login* other) { if (other == this) return; InternalSwap(other); } -void Request_logout::InternalSwap(Request_logout* other) { +void Request_login::InternalSwap(Request_login* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); + password_.Swap(&other->password_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArenaNoVirtual()); swap(id_, other->id_); } -::PROTOBUF_NAMESPACE_ID::Metadata Request_logout::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata Request_login::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void Response_login::InitAsDefaultInstance() { +} +class Response_login::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Response_login::kStatFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Response_login::Response_login() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:Response_login) +} +Response_login::Response_login(const Response_login& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + stat_ = from.stat_; + // @@protoc_insertion_point(copy_constructor:Response_login) +} + +void Response_login::SharedCtor() { + stat_ = 0; +} + +Response_login::~Response_login() { + // @@protoc_insertion_point(destructor:Response_login) + SharedDtor(); +} + +void Response_login::SharedDtor() { +} + +void Response_login::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Response_login& Response_login::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Response_login_IMProtocol_2eproto.base); + return *internal_default_instance(); +} + + +void Response_login::Clear() { +// @@protoc_insertion_point(message_clear_start:Response_login) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + stat_ = 0; + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Response_login::_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) { + // .Response_login.STAT stat = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + set_stat(static_cast<::Response_login_STAT>(val)); + } 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 Response_login::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:Response_login) + 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)) { + // .Response_login.STAT stat = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + int value = 0; + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + set_stat(static_cast< ::Response_login_STAT >(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:Response_login) + return true; +failure: + // @@protoc_insertion_point(parse_failure:Response_login) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Response_login::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Response_login) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .Response_login.STAT stat = 1; + if (this->stat() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum( + 1, this->stat(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:Response_login) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Response_login::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Response_login) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .Response_login.STAT stat = 1; + if (this->stat() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->stat(), 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:Response_login) + return target; +} + +size_t Response_login::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Response_login) + 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; + + // .Response_login.STAT stat = 1; + if (this->stat() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->stat()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Response_login::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Response_login) + GOOGLE_DCHECK_NE(&from, this); + const Response_login* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Response_login) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:Response_login) + MergeFrom(*source); + } +} + +void Response_login::MergeFrom(const Response_login& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Response_login) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.stat() != 0) { + set_stat(from.stat()); + } +} + +void Response_login::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Response_login) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Response_login::CopyFrom(const Response_login& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Response_login) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Response_login::IsInitialized() const { + return true; +} + +void Response_login::Swap(Response_login* other) { + if (other == this) return; + InternalSwap(other); +} +void Response_login::InternalSwap(Response_login* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(stat_, other->stat_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Response_login::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void Request_logout::InitAsDefaultInstance() { +} +class Request_logout::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Request_logout::kIDFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Request_logout::Request_logout() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:Request_logout) +} +Request_logout::Request_logout(const Request_logout& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + id_ = from.id_; + // @@protoc_insertion_point(copy_constructor:Request_logout) +} + +void Request_logout::SharedCtor() { + id_ = PROTOBUF_ULONGLONG(0); +} + +Request_logout::~Request_logout() { + // @@protoc_insertion_point(destructor:Request_logout) + SharedDtor(); +} + +void Request_logout::SharedDtor() { +} + +void Request_logout::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Request_logout& Request_logout::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Request_logout_IMProtocol_2eproto.base); + return *internal_default_instance(); +} + + +void Request_logout::Clear() { +// @@protoc_insertion_point(message_clear_start:Request_logout) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + id_ = PROTOBUF_ULONGLONG(0); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Request_logout::_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) { + // uint64 ID = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + 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: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Request_logout::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:Request_logout) + 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)) { + // uint64 ID = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( + input, &id_))); + } 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:Request_logout) + return true; +failure: + // @@protoc_insertion_point(parse_failure:Request_logout) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Request_logout::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Request_logout) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 ID = 1; + if (this->id() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:Request_logout) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Request_logout::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Request_logout) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 ID = 1; + if (this->id() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), 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:Request_logout) + return target; +} + +size_t Request_logout::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Request_logout) + 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; + + // uint64 ID = 1; + if (this->id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->id()); + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Request_logout::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Request_logout) + GOOGLE_DCHECK_NE(&from, this); + const Request_logout* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Request_logout) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:Request_logout) + MergeFrom(*source); + } +} + +void Request_logout::MergeFrom(const Request_logout& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Request_logout) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.id() != 0) { + set_id(from.id()); + } +} + +void Request_logout::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Request_logout) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Request_logout::CopyFrom(const Request_logout& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Request_logout) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Request_logout::IsInitialized() const { + return true; +} + +void Request_logout::Swap(Request_logout* other) { + if (other == this) return; + InternalSwap(other); +} +void Request_logout::InternalSwap(Request_logout* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(id_, other->id_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Request_logout::GetMetadata() const { return GetMetadataStatic(); } @@ -1039,6 +2152,7 @@ class Request_sendmsg::HasBitSetters { }; #if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Request_sendmsg::kMsgIDFieldNumber; const int Request_sendmsg::kIDFieldNumber; const int Request_sendmsg::kObjIDFieldNumber; const int Request_sendmsg::kMsgFieldNumber; @@ -1058,8 +2172,8 @@ Request_sendmsg::Request_sendmsg(const Request_sendmsg& from) msg_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.msg_); } ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&objid_) - - reinterpret_cast(&id_)) + sizeof(objid_)); + static_cast(reinterpret_cast(&msgid_) - + reinterpret_cast(&id_)) + sizeof(msgid_)); // @@protoc_insertion_point(copy_constructor:Request_sendmsg) } @@ -1067,8 +2181,8 @@ void Request_sendmsg::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Request_sendmsg_IMProtocol_2eproto.base); msg_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&id_, 0, static_cast( - reinterpret_cast(&objid_) - - reinterpret_cast(&id_)) + sizeof(objid_)); + reinterpret_cast(&msgid_) - + reinterpret_cast(&id_)) + sizeof(msgid_)); } Request_sendmsg::~Request_sendmsg() { @@ -1097,8 +2211,8 @@ void Request_sendmsg::Clear() { msg_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&id_, 0, static_cast( - reinterpret_cast(&objid_) - - reinterpret_cast(&id_)) + sizeof(objid_)); + reinterpret_cast(&msgid_) - + reinterpret_cast(&id_)) + sizeof(msgid_)); _internal_metadata_.Clear(); } @@ -1110,23 +2224,30 @@ const char* Request_sendmsg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPAC ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); CHK_(ptr); switch (tag >> 3) { - // uint64 ID = 1; + // uint32 msgID = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + msgid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // uint64 objID = 2; + // uint64 ID = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - objid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); CHK_(ptr); } else goto handle_unusual; continue; - // string msg = 3; + // uint64 objID = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + objid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string msg = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_msg(), ptr, ctx, "Request_sendmsg.msg"); CHK_(ptr); } else goto handle_unusual; @@ -1161,35 +2282,48 @@ bool Request_sendmsg::MergePartialFromCodedStream( tag = p.first; if (!p.second) goto handle_unusual; switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // uint64 ID = 1; + // uint32 msgID = 1; case 1: { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< - ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &id_))); + ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>( + input, &msgid_))); } else { goto handle_unusual; } break; } - // uint64 objID = 2; + // uint64 ID = 2; case 2: { if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( - input, &objid_))); + input, &id_))); } else { goto handle_unusual; } break; } - // string msg = 3; + // uint64 objID = 3; case 3: { - if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>( + input, &objid_))); + } else { + goto handle_unusual; + } + break; + } + + // string msg = 4; + case 4: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) { DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString( input, this->mutable_msg())); DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( @@ -1229,24 +2363,29 @@ void Request_sendmsg::SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // uint64 ID = 1; + // uint32 msgID = 1; + if (this->msgid() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(1, this->msgid(), output); + } + + // uint64 ID = 2; if (this->id() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(1, this->id(), output); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->id(), output); } - // uint64 objID = 2; + // uint64 objID = 3; if (this->objid() != 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(2, this->objid(), output); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(3, this->objid(), output); } - // string msg = 3; + // string msg = 4; if (this->msg().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->msg().data(), static_cast(this->msg().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "Request_sendmsg.msg"); ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->msg(), output); + 4, this->msg(), output); } if (_internal_metadata_.have_unknown_fields()) { @@ -1262,17 +2401,22 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Request_sendmsg::InternalSerializeWithCachedSize ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - // uint64 ID = 1; + // uint32 msgID = 1; + if (this->msgid() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->msgid(), target); + } + + // uint64 ID = 2; if (this->id() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->id(), target); } - // uint64 objID = 2; + // uint64 objID = 3; if (this->objid() != 0) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->objid(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(3, this->objid(), target); } - // string msg = 3; + // string msg = 4; if (this->msg().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->msg().data(), static_cast(this->msg().length()), @@ -1280,7 +2424,7 @@ ::PROTOBUF_NAMESPACE_ID::uint8* Request_sendmsg::InternalSerializeWithCachedSize "Request_sendmsg.msg"); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray( - 3, this->msg(), target); + 4, this->msg(), target); } if (_internal_metadata_.have_unknown_fields()) { @@ -1304,27 +2448,34 @@ size_t Request_sendmsg::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // string msg = 3; + // string msg = 4; if (this->msg().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->msg()); } - // uint64 ID = 1; + // uint64 ID = 2; if (this->id() != 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( this->id()); } - // uint64 objID = 2; + // uint64 objID = 3; if (this->objid() != 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( this->objid()); } + // uint32 msgID = 1; + if (this->msgid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->msgid()); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; @@ -1362,6 +2513,9 @@ void Request_sendmsg::MergeFrom(const Request_sendmsg& from) { if (from.objid() != 0) { set_objid(from.objid()); } + if (from.msgid() != 0) { + set_msgid(from.msgid()); + } } void Request_sendmsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -1393,6 +2547,7 @@ void Request_sendmsg::InternalSwap(Request_sendmsg* other) { GetArenaNoVirtual()); swap(id_, other->id_); swap(objid_, other->objid_); + swap(msgid_, other->msgid_); } ::PROTOBUF_NAMESPACE_ID::Metadata Request_sendmsg::GetMetadata() const { @@ -1400,8 +2555,317 @@ ::PROTOBUF_NAMESPACE_ID::Metadata Request_sendmsg::GetMetadata() const { } +// =================================================================== + +void Response_sendmsg::InitAsDefaultInstance() { +} +class Response_sendmsg::HasBitSetters { + public: +}; + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int Response_sendmsg::kMsgIDFieldNumber; +const int Response_sendmsg::kStatFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +Response_sendmsg::Response_sendmsg() + : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { + SharedCtor(); + // @@protoc_insertion_point(constructor:Response_sendmsg) +} +Response_sendmsg::Response_sendmsg(const Response_sendmsg& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + _internal_metadata_(nullptr) { + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&msgid_, &from.msgid_, + static_cast(reinterpret_cast(&stat_) - + reinterpret_cast(&msgid_)) + sizeof(stat_)); + // @@protoc_insertion_point(copy_constructor:Response_sendmsg) +} + +void Response_sendmsg::SharedCtor() { + ::memset(&msgid_, 0, static_cast( + reinterpret_cast(&stat_) - + reinterpret_cast(&msgid_)) + sizeof(stat_)); +} + +Response_sendmsg::~Response_sendmsg() { + // @@protoc_insertion_point(destructor:Response_sendmsg) + SharedDtor(); +} + +void Response_sendmsg::SharedDtor() { +} + +void Response_sendmsg::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const Response_sendmsg& Response_sendmsg::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Response_sendmsg_IMProtocol_2eproto.base); + return *internal_default_instance(); +} + + +void Response_sendmsg::Clear() { +// @@protoc_insertion_point(message_clear_start:Response_sendmsg) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&msgid_, 0, static_cast( + reinterpret_cast(&stat_) - + reinterpret_cast(&msgid_)) + sizeof(stat_)); + _internal_metadata_.Clear(); +} + +#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +const char* Response_sendmsg::_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) { + // uint32 msgID = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + msgid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // bool stat = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + stat_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); + 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: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +#else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER +bool Response_sendmsg::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:Response_sendmsg) + 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)) { + // uint32 msgID = 1; + case 1: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>( + input, &msgid_))); + } else { + goto handle_unusual; + } + break; + } + + // bool stat = 2; + case 2: { + if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) { + + DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive< + bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>( + input, &stat_))); + } 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:Response_sendmsg) + return true; +failure: + // @@protoc_insertion_point(parse_failure:Response_sendmsg) + return false; +#undef DO_ +} +#endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER + +void Response_sendmsg::SerializeWithCachedSizes( + ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:Response_sendmsg) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 msgID = 1; + if (this->msgid() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(1, this->msgid(), output); + } + + // bool stat = 2; + if (this->stat() != 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(2, this->stat(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields( + _internal_metadata_.unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:Response_sendmsg) +} + +::PROTOBUF_NAMESPACE_ID::uint8* Response_sendmsg::InternalSerializeWithCachedSizesToArray( + ::PROTOBUF_NAMESPACE_ID::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:Response_sendmsg) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 msgID = 1; + if (this->msgid() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->msgid(), target); + } + + // bool stat = 2; + if (this->stat() != 0) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->stat(), 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:Response_sendmsg) + return target; +} + +size_t Response_sendmsg::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:Response_sendmsg) + 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; + + // uint32 msgID = 1; + if (this->msgid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->msgid()); + } + + // bool stat = 2; + if (this->stat() != 0) { + total_size += 1 + 1; + } + + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void Response_sendmsg::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:Response_sendmsg) + GOOGLE_DCHECK_NE(&from, this); + const Response_sendmsg* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:Response_sendmsg) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:Response_sendmsg) + MergeFrom(*source); + } +} + +void Response_sendmsg::MergeFrom(const Response_sendmsg& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:Response_sendmsg) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.msgid() != 0) { + set_msgid(from.msgid()); + } + if (from.stat() != 0) { + set_stat(from.stat()); + } +} + +void Response_sendmsg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:Response_sendmsg) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Response_sendmsg::CopyFrom(const Response_sendmsg& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:Response_sendmsg) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Response_sendmsg::IsInitialized() const { + return true; +} + +void Response_sendmsg::Swap(Response_sendmsg* other) { + if (other == this) return; + InternalSwap(other); +} +void Response_sendmsg::InternalSwap(Response_sendmsg* other) { + using std::swap; + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(msgid_, other->msgid_); + swap(stat_, other->stat_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Response_sendmsg::GetMetadata() const { + return GetMetadataStatic(); +} + + // @@protoc_insertion_point(namespace_scope) PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::Request* Arena::CreateMaybeMessage< ::Request >(Arena* arena) { + return Arena::CreateInternal< ::Request >(arena); +} +template<> PROTOBUF_NOINLINE ::Response* Arena::CreateMaybeMessage< ::Response >(Arena* arena) { + return Arena::CreateInternal< ::Response >(arena); +} template<> PROTOBUF_NOINLINE ::Request_login* Arena::CreateMaybeMessage< ::Request_login >(Arena* arena) { return Arena::CreateInternal< ::Request_login >(arena); } @@ -1414,6 +2878,9 @@ template<> PROTOBUF_NOINLINE ::Request_logout* Arena::CreateMaybeMessage< ::Requ template<> PROTOBUF_NOINLINE ::Request_sendmsg* Arena::CreateMaybeMessage< ::Request_sendmsg >(Arena* arena) { return Arena::CreateInternal< ::Request_sendmsg >(arena); } +template<> PROTOBUF_NOINLINE ::Response_sendmsg* Arena::CreateMaybeMessage< ::Response_sendmsg >(Arena* arena) { + return Arena::CreateInternal< ::Response_sendmsg >(arena); +} PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) diff --git a/IM/IMProtocol.pb.h b/IM/IMProtocol.pb.h index 382dd86..490908b 100644 --- a/IM/IMProtocol.pb.h +++ b/IM/IMProtocol.pb.h @@ -48,13 +48,16 @@ struct TableStruct_IMProtocol_2eproto { 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[4] + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[7] 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_IMProtocol_2eproto; +class Request; +class RequestDefaultTypeInternal; +extern RequestDefaultTypeInternal _Request_default_instance_; class Request_login; class Request_loginDefaultTypeInternal; extern Request_loginDefaultTypeInternal _Request_login_default_instance_; @@ -64,16 +67,77 @@ extern Request_logoutDefaultTypeInternal _Request_logout_default_instance_; class Request_sendmsg; class Request_sendmsgDefaultTypeInternal; extern Request_sendmsgDefaultTypeInternal _Request_sendmsg_default_instance_; +class Response; +class ResponseDefaultTypeInternal; +extern ResponseDefaultTypeInternal _Response_default_instance_; class Response_login; class Response_loginDefaultTypeInternal; extern Response_loginDefaultTypeInternal _Response_login_default_instance_; +class Response_sendmsg; +class Response_sendmsgDefaultTypeInternal; +extern Response_sendmsgDefaultTypeInternal _Response_sendmsg_default_instance_; PROTOBUF_NAMESPACE_OPEN +template<> ::Request* Arena::CreateMaybeMessage<::Request>(Arena*); template<> ::Request_login* Arena::CreateMaybeMessage<::Request_login>(Arena*); template<> ::Request_logout* Arena::CreateMaybeMessage<::Request_logout>(Arena*); template<> ::Request_sendmsg* Arena::CreateMaybeMessage<::Request_sendmsg>(Arena*); +template<> ::Response* Arena::CreateMaybeMessage<::Response>(Arena*); template<> ::Response_login* Arena::CreateMaybeMessage<::Response_login>(Arena*); +template<> ::Response_sendmsg* Arena::CreateMaybeMessage<::Response_sendmsg>(Arena*); PROTOBUF_NAMESPACE_CLOSE +enum Request_Type : int { + Request_Type_LOGIN = 0, + Request_Type_LOGOUT = 1, + Request_Type_SENDMSG = 2, + Request_Type_Request_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + Request_Type_Request_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool Request_Type_IsValid(int value); +constexpr Request_Type Request_Type_Type_MIN = Request_Type_LOGIN; +constexpr Request_Type Request_Type_Type_MAX = Request_Type_SENDMSG; +constexpr int Request_Type_Type_ARRAYSIZE = Request_Type_Type_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Request_Type_descriptor(); +template +inline const std::string& Request_Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Request_Type_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Request_Type_descriptor(), enum_t_value); +} +inline bool Request_Type_Parse( + const std::string& name, Request_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Request_Type_descriptor(), name, value); +} +enum Response_Type : int { + Response_Type_LOGIN = 0, + Response_Type_LOGOUT = 1, + Response_Type_SENDMSG = 2, + Response_Type_Response_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + Response_Type_Response_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool Response_Type_IsValid(int value); +constexpr Response_Type Response_Type_Type_MIN = Response_Type_LOGIN; +constexpr Response_Type Response_Type_Type_MAX = Response_Type_SENDMSG; +constexpr int Response_Type_Type_ARRAYSIZE = Response_Type_Type_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Response_Type_descriptor(); +template +inline const std::string& Response_Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Response_Type_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Response_Type_descriptor(), enum_t_value); +} +inline bool Response_Type_Parse( + const std::string& name, Response_Type* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Response_Type_descriptor(), name, value); +} enum Response_login_STAT : int { Response_login_STAT_SUCCESS = 0, Response_login_STAT_ACCOUNT_NULL = 1, @@ -104,6 +168,410 @@ inline bool Response_login_STAT_Parse( } // =================================================================== +class Request : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Request) */ { + public: + Request(); + virtual ~Request(); + + Request(const Request& from); + Request(Request&& from) noexcept + : Request() { + *this = ::std::move(from); + } + + inline Request& operator=(const Request& from) { + CopyFrom(from); + return *this; + } + inline Request& operator=(Request&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + 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 Request& default_instance(); + + enum PduCase { + kRequestLogin = 11, + kRequestLogout = 12, + kRequestSendmsg = 13, + PDU_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Request* internal_default_instance() { + return reinterpret_cast( + &_Request_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + void Swap(Request* other); + friend void swap(Request& a, Request& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Request* New() const final { + return CreateMaybeMessage(nullptr); + } + + Request* 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 Request& from); + void MergeFrom(const Request& 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(Request* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Request"; + } + 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_IMProtocol_2eproto); + return ::descriptor_table_IMProtocol_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + typedef Request_Type Type; + static constexpr Type LOGIN = + Request_Type_LOGIN; + static constexpr Type LOGOUT = + Request_Type_LOGOUT; + static constexpr Type SENDMSG = + Request_Type_SENDMSG; + static inline bool Type_IsValid(int value) { + return Request_Type_IsValid(value); + } + static constexpr Type Type_MIN = + Request_Type_Type_MIN; + static constexpr Type Type_MAX = + Request_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + Request_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return Request_Type_descriptor(); + } + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return Request_Type_Name(enum_t_value); + } + static inline bool Type_Parse(const std::string& name, + Type* value) { + return Request_Type_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // .Request.Type type = 1; + void clear_type(); + static const int kTypeFieldNumber = 1; + ::Request_Type type() const; + void set_type(::Request_Type value); + + // .Request_login request_login = 11; + bool has_request_login() const; + void clear_request_login(); + static const int kRequestLoginFieldNumber = 11; + const ::Request_login& request_login() const; + ::Request_login* release_request_login(); + ::Request_login* mutable_request_login(); + void set_allocated_request_login(::Request_login* request_login); + + // .Request_logout request_logout = 12; + bool has_request_logout() const; + void clear_request_logout(); + static const int kRequestLogoutFieldNumber = 12; + const ::Request_logout& request_logout() const; + ::Request_logout* release_request_logout(); + ::Request_logout* mutable_request_logout(); + void set_allocated_request_logout(::Request_logout* request_logout); + + // .Request_sendmsg request_sendmsg = 13; + bool has_request_sendmsg() const; + void clear_request_sendmsg(); + static const int kRequestSendmsgFieldNumber = 13; + const ::Request_sendmsg& request_sendmsg() const; + ::Request_sendmsg* release_request_sendmsg(); + ::Request_sendmsg* mutable_request_sendmsg(); + void set_allocated_request_sendmsg(::Request_sendmsg* request_sendmsg); + + void clear_pdu(); + PduCase pdu_case() const; + // @@protoc_insertion_point(class_scope:Request) + private: + class HasBitSetters; + void set_has_request_login(); + void set_has_request_logout(); + void set_has_request_sendmsg(); + + inline bool has_pdu() const; + inline void clear_has_pdu(); + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + int type_; + union PduUnion { + PduUnion() {} + ::Request_login* request_login_; + ::Request_logout* request_logout_; + ::Request_sendmsg* request_sendmsg_; + } pdu_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + + friend struct ::TableStruct_IMProtocol_2eproto; +}; +// ------------------------------------------------------------------- + +class Response : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Response) */ { + public: + Response(); + virtual ~Response(); + + Response(const Response& from); + Response(Response&& from) noexcept + : Response() { + *this = ::std::move(from); + } + + inline Response& operator=(const Response& from) { + CopyFrom(from); + return *this; + } + inline Response& operator=(Response&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + 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 Response& default_instance(); + + enum PduCase { + kResponseLogin = 11, + kResponseSendmsg = 13, + PDU_NOT_SET = 0, + }; + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Response* internal_default_instance() { + return reinterpret_cast( + &_Response_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + void Swap(Response* other); + friend void swap(Response& a, Response& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Response* New() const final { + return CreateMaybeMessage(nullptr); + } + + Response* 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 Response& from); + void MergeFrom(const Response& 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(Response* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Response"; + } + 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_IMProtocol_2eproto); + return ::descriptor_table_IMProtocol_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + typedef Response_Type Type; + static constexpr Type LOGIN = + Response_Type_LOGIN; + static constexpr Type LOGOUT = + Response_Type_LOGOUT; + static constexpr Type SENDMSG = + Response_Type_SENDMSG; + static inline bool Type_IsValid(int value) { + return Response_Type_IsValid(value); + } + static constexpr Type Type_MIN = + Response_Type_Type_MIN; + static constexpr Type Type_MAX = + Response_Type_Type_MAX; + static constexpr int Type_ARRAYSIZE = + Response_Type_Type_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + Type_descriptor() { + return Response_Type_descriptor(); + } + template + static inline const std::string& Type_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Type_Name."); + return Response_Type_Name(enum_t_value); + } + static inline bool Type_Parse(const std::string& name, + Type* value) { + return Response_Type_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // .Response.Type type = 1; + void clear_type(); + static const int kTypeFieldNumber = 1; + ::Response_Type type() const; + void set_type(::Response_Type value); + + // .Response_login response_login = 11; + bool has_response_login() const; + void clear_response_login(); + static const int kResponseLoginFieldNumber = 11; + const ::Response_login& response_login() const; + ::Response_login* release_response_login(); + ::Response_login* mutable_response_login(); + void set_allocated_response_login(::Response_login* response_login); + + // .Response_sendmsg response_sendmsg = 13; + bool has_response_sendmsg() const; + void clear_response_sendmsg(); + static const int kResponseSendmsgFieldNumber = 13; + const ::Response_sendmsg& response_sendmsg() const; + ::Response_sendmsg* release_response_sendmsg(); + ::Response_sendmsg* mutable_response_sendmsg(); + void set_allocated_response_sendmsg(::Response_sendmsg* response_sendmsg); + + void clear_pdu(); + PduCase pdu_case() const; + // @@protoc_insertion_point(class_scope:Response) + private: + class HasBitSetters; + void set_has_response_login(); + void set_has_response_sendmsg(); + + inline bool has_pdu() const; + inline void clear_has_pdu(); + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + int type_; + union PduUnion { + PduUnion() {} + ::Response_login* response_login_; + ::Response_sendmsg* response_sendmsg_; + } pdu_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; + + friend struct ::TableStruct_IMProtocol_2eproto; +}; +// ------------------------------------------------------------------- + class Request_login : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Request_login) */ { public: @@ -146,7 +614,7 @@ class Request_login : &_Request_login_default_instance_); } static constexpr int kIndexInFileMessages = - 0; + 2; void Swap(Request_login* other); friend void swap(Request_login& a, Request_login& b) { @@ -285,7 +753,7 @@ class Response_login : &_Response_login_default_instance_); } static constexpr int kIndexInFileMessages = - 1; + 3; void Swap(Response_login* other); friend void swap(Response_login& a, Response_login& b) { @@ -447,7 +915,7 @@ class Request_logout : &_Request_logout_default_instance_); } static constexpr int kIndexInFileMessages = - 2; + 4; void Swap(Request_logout* other); friend void swap(Request_logout& a, Request_logout& b) { @@ -573,7 +1041,7 @@ class Request_sendmsg : &_Request_sendmsg_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 5; void Swap(Request_sendmsg* other); friend void swap(Request_sendmsg& a, Request_sendmsg& b) { @@ -640,9 +1108,9 @@ class Request_sendmsg : // accessors ------------------------------------------------------- - // string msg = 3; + // string msg = 4; void clear_msg(); - static const int kMsgFieldNumber = 3; + static const int kMsgFieldNumber = 4; const std::string& msg() const; void set_msg(const std::string& value); void set_msg(std::string&& value); @@ -652,18 +1120,24 @@ class Request_sendmsg : std::string* release_msg(); void set_allocated_msg(std::string* msg); - // uint64 ID = 1; + // uint64 ID = 2; void clear_id(); - static const int kIDFieldNumber = 1; + static const int kIDFieldNumber = 2; ::PROTOBUF_NAMESPACE_ID::uint64 id() const; void set_id(::PROTOBUF_NAMESPACE_ID::uint64 value); - // uint64 objID = 2; + // uint64 objID = 3; void clear_objid(); - static const int kObjIDFieldNumber = 2; + static const int kObjIDFieldNumber = 3; ::PROTOBUF_NAMESPACE_ID::uint64 objid() const; void set_objid(::PROTOBUF_NAMESPACE_ID::uint64 value); + // uint32 msgID = 1; + void clear_msgid(); + static const int kMsgIDFieldNumber = 1; + ::PROTOBUF_NAMESPACE_ID::uint32 msgid() const; + void set_msgid(::PROTOBUF_NAMESPACE_ID::uint32 value); + // @@protoc_insertion_point(class_scope:Request_sendmsg) private: class HasBitSetters; @@ -672,6 +1146,140 @@ class Request_sendmsg : ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr msg_; ::PROTOBUF_NAMESPACE_ID::uint64 id_; ::PROTOBUF_NAMESPACE_ID::uint64 objid_; + ::PROTOBUF_NAMESPACE_ID::uint32 msgid_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_IMProtocol_2eproto; +}; +// ------------------------------------------------------------------- + +class Response_sendmsg : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Response_sendmsg) */ { + public: + Response_sendmsg(); + virtual ~Response_sendmsg(); + + Response_sendmsg(const Response_sendmsg& from); + Response_sendmsg(Response_sendmsg&& from) noexcept + : Response_sendmsg() { + *this = ::std::move(from); + } + + inline Response_sendmsg& operator=(const Response_sendmsg& from) { + CopyFrom(from); + return *this; + } + inline Response_sendmsg& operator=(Response_sendmsg&& from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + 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 Response_sendmsg& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const Response_sendmsg* internal_default_instance() { + return reinterpret_cast( + &_Response_sendmsg_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + void Swap(Response_sendmsg* other); + friend void swap(Response_sendmsg& a, Response_sendmsg& b) { + a.Swap(&b); + } + + // implements Message ---------------------------------------------- + + inline Response_sendmsg* New() const final { + return CreateMaybeMessage(nullptr); + } + + Response_sendmsg* 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 Response_sendmsg& from); + void MergeFrom(const Response_sendmsg& 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(Response_sendmsg* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "Response_sendmsg"; + } + 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_IMProtocol_2eproto); + return ::descriptor_table_IMProtocol_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // uint32 msgID = 1; + void clear_msgid(); + static const int kMsgIDFieldNumber = 1; + ::PROTOBUF_NAMESPACE_ID::uint32 msgid() const; + void set_msgid(::PROTOBUF_NAMESPACE_ID::uint32 value); + + // bool stat = 2; + void clear_stat(); + static const int kStatFieldNumber = 2; + bool stat() const; + void set_stat(bool value); + + // @@protoc_insertion_point(class_scope:Response_sendmsg) + private: + class HasBitSetters; + + ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; + ::PROTOBUF_NAMESPACE_ID::uint32 msgid_; + bool stat_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_IMProtocol_2eproto; }; @@ -684,6 +1292,265 @@ class Request_sendmsg : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ +// Request + +// .Request.Type type = 1; +inline void Request::clear_type() { + type_ = 0; +} +inline ::Request_Type Request::type() const { + // @@protoc_insertion_point(field_get:Request.type) + return static_cast< ::Request_Type >(type_); +} +inline void Request::set_type(::Request_Type value) { + + type_ = value; + // @@protoc_insertion_point(field_set:Request.type) +} + +// .Request_login request_login = 11; +inline bool Request::has_request_login() const { + return pdu_case() == kRequestLogin; +} +inline void Request::set_has_request_login() { + _oneof_case_[0] = kRequestLogin; +} +inline void Request::clear_request_login() { + if (has_request_login()) { + delete pdu_.request_login_; + clear_has_pdu(); + } +} +inline ::Request_login* Request::release_request_login() { + // @@protoc_insertion_point(field_release:Request.request_login) + if (has_request_login()) { + clear_has_pdu(); + ::Request_login* temp = pdu_.request_login_; + pdu_.request_login_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::Request_login& Request::request_login() const { + // @@protoc_insertion_point(field_get:Request.request_login) + return has_request_login() + ? *pdu_.request_login_ + : *reinterpret_cast< ::Request_login*>(&::_Request_login_default_instance_); +} +inline ::Request_login* Request::mutable_request_login() { + if (!has_request_login()) { + clear_pdu(); + set_has_request_login(); + pdu_.request_login_ = CreateMaybeMessage< ::Request_login >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:Request.request_login) + return pdu_.request_login_; +} + +// .Request_logout request_logout = 12; +inline bool Request::has_request_logout() const { + return pdu_case() == kRequestLogout; +} +inline void Request::set_has_request_logout() { + _oneof_case_[0] = kRequestLogout; +} +inline void Request::clear_request_logout() { + if (has_request_logout()) { + delete pdu_.request_logout_; + clear_has_pdu(); + } +} +inline ::Request_logout* Request::release_request_logout() { + // @@protoc_insertion_point(field_release:Request.request_logout) + if (has_request_logout()) { + clear_has_pdu(); + ::Request_logout* temp = pdu_.request_logout_; + pdu_.request_logout_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::Request_logout& Request::request_logout() const { + // @@protoc_insertion_point(field_get:Request.request_logout) + return has_request_logout() + ? *pdu_.request_logout_ + : *reinterpret_cast< ::Request_logout*>(&::_Request_logout_default_instance_); +} +inline ::Request_logout* Request::mutable_request_logout() { + if (!has_request_logout()) { + clear_pdu(); + set_has_request_logout(); + pdu_.request_logout_ = CreateMaybeMessage< ::Request_logout >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:Request.request_logout) + return pdu_.request_logout_; +} + +// .Request_sendmsg request_sendmsg = 13; +inline bool Request::has_request_sendmsg() const { + return pdu_case() == kRequestSendmsg; +} +inline void Request::set_has_request_sendmsg() { + _oneof_case_[0] = kRequestSendmsg; +} +inline void Request::clear_request_sendmsg() { + if (has_request_sendmsg()) { + delete pdu_.request_sendmsg_; + clear_has_pdu(); + } +} +inline ::Request_sendmsg* Request::release_request_sendmsg() { + // @@protoc_insertion_point(field_release:Request.request_sendmsg) + if (has_request_sendmsg()) { + clear_has_pdu(); + ::Request_sendmsg* temp = pdu_.request_sendmsg_; + pdu_.request_sendmsg_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::Request_sendmsg& Request::request_sendmsg() const { + // @@protoc_insertion_point(field_get:Request.request_sendmsg) + return has_request_sendmsg() + ? *pdu_.request_sendmsg_ + : *reinterpret_cast< ::Request_sendmsg*>(&::_Request_sendmsg_default_instance_); +} +inline ::Request_sendmsg* Request::mutable_request_sendmsg() { + if (!has_request_sendmsg()) { + clear_pdu(); + set_has_request_sendmsg(); + pdu_.request_sendmsg_ = CreateMaybeMessage< ::Request_sendmsg >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:Request.request_sendmsg) + return pdu_.request_sendmsg_; +} + +inline bool Request::has_pdu() const { + return pdu_case() != PDU_NOT_SET; +} +inline void Request::clear_has_pdu() { + _oneof_case_[0] = PDU_NOT_SET; +} +inline Request::PduCase Request::pdu_case() const { + return Request::PduCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Response + +// .Response.Type type = 1; +inline void Response::clear_type() { + type_ = 0; +} +inline ::Response_Type Response::type() const { + // @@protoc_insertion_point(field_get:Response.type) + return static_cast< ::Response_Type >(type_); +} +inline void Response::set_type(::Response_Type value) { + + type_ = value; + // @@protoc_insertion_point(field_set:Response.type) +} + +// .Response_login response_login = 11; +inline bool Response::has_response_login() const { + return pdu_case() == kResponseLogin; +} +inline void Response::set_has_response_login() { + _oneof_case_[0] = kResponseLogin; +} +inline void Response::clear_response_login() { + if (has_response_login()) { + delete pdu_.response_login_; + clear_has_pdu(); + } +} +inline ::Response_login* Response::release_response_login() { + // @@protoc_insertion_point(field_release:Response.response_login) + if (has_response_login()) { + clear_has_pdu(); + ::Response_login* temp = pdu_.response_login_; + pdu_.response_login_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::Response_login& Response::response_login() const { + // @@protoc_insertion_point(field_get:Response.response_login) + return has_response_login() + ? *pdu_.response_login_ + : *reinterpret_cast< ::Response_login*>(&::_Response_login_default_instance_); +} +inline ::Response_login* Response::mutable_response_login() { + if (!has_response_login()) { + clear_pdu(); + set_has_response_login(); + pdu_.response_login_ = CreateMaybeMessage< ::Response_login >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:Response.response_login) + return pdu_.response_login_; +} + +// .Response_sendmsg response_sendmsg = 13; +inline bool Response::has_response_sendmsg() const { + return pdu_case() == kResponseSendmsg; +} +inline void Response::set_has_response_sendmsg() { + _oneof_case_[0] = kResponseSendmsg; +} +inline void Response::clear_response_sendmsg() { + if (has_response_sendmsg()) { + delete pdu_.response_sendmsg_; + clear_has_pdu(); + } +} +inline ::Response_sendmsg* Response::release_response_sendmsg() { + // @@protoc_insertion_point(field_release:Response.response_sendmsg) + if (has_response_sendmsg()) { + clear_has_pdu(); + ::Response_sendmsg* temp = pdu_.response_sendmsg_; + pdu_.response_sendmsg_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::Response_sendmsg& Response::response_sendmsg() const { + // @@protoc_insertion_point(field_get:Response.response_sendmsg) + return has_response_sendmsg() + ? *pdu_.response_sendmsg_ + : *reinterpret_cast< ::Response_sendmsg*>(&::_Response_sendmsg_default_instance_); +} +inline ::Response_sendmsg* Response::mutable_response_sendmsg() { + if (!has_response_sendmsg()) { + clear_pdu(); + set_has_response_sendmsg(); + pdu_.response_sendmsg_ = CreateMaybeMessage< ::Response_sendmsg >( + GetArenaNoVirtual()); + } + // @@protoc_insertion_point(field_mutable:Response.response_sendmsg) + return pdu_.response_sendmsg_; +} + +inline bool Response::has_pdu() const { + return pdu_case() != PDU_NOT_SET; +} +inline void Response::clear_has_pdu() { + _oneof_case_[0] = PDU_NOT_SET; +} +inline Response::PduCase Response::pdu_case() const { + return Response::PduCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + // Request_login // uint64 ID = 1; @@ -791,7 +1658,21 @@ inline void Request_logout::set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { // Request_sendmsg -// uint64 ID = 1; +// uint32 msgID = 1; +inline void Request_sendmsg::clear_msgid() { + msgid_ = 0u; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 Request_sendmsg::msgid() const { + // @@protoc_insertion_point(field_get:Request_sendmsg.msgID) + return msgid_; +} +inline void Request_sendmsg::set_msgid(::PROTOBUF_NAMESPACE_ID::uint32 value) { + + msgid_ = value; + // @@protoc_insertion_point(field_set:Request_sendmsg.msgID) +} + +// uint64 ID = 2; inline void Request_sendmsg::clear_id() { id_ = PROTOBUF_ULONGLONG(0); } @@ -805,7 +1686,7 @@ inline void Request_sendmsg::set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { // @@protoc_insertion_point(field_set:Request_sendmsg.ID) } -// uint64 objID = 2; +// uint64 objID = 3; inline void Request_sendmsg::clear_objid() { objid_ = PROTOBUF_ULONGLONG(0); } @@ -819,7 +1700,7 @@ inline void Request_sendmsg::set_objid(::PROTOBUF_NAMESPACE_ID::uint64 value) { // @@protoc_insertion_point(field_set:Request_sendmsg.objID) } -// string msg = 3; +// string msg = 4; inline void Request_sendmsg::clear_msg() { msg_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } @@ -870,6 +1751,38 @@ inline void Request_sendmsg::set_allocated_msg(std::string* msg) { // @@protoc_insertion_point(field_set_allocated:Request_sendmsg.msg) } +// ------------------------------------------------------------------- + +// Response_sendmsg + +// uint32 msgID = 1; +inline void Response_sendmsg::clear_msgid() { + msgid_ = 0u; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 Response_sendmsg::msgid() const { + // @@protoc_insertion_point(field_get:Response_sendmsg.msgID) + return msgid_; +} +inline void Response_sendmsg::set_msgid(::PROTOBUF_NAMESPACE_ID::uint32 value) { + + msgid_ = value; + // @@protoc_insertion_point(field_set:Response_sendmsg.msgID) +} + +// bool stat = 2; +inline void Response_sendmsg::clear_stat() { + stat_ = false; +} +inline bool Response_sendmsg::stat() const { + // @@protoc_insertion_point(field_get:Response_sendmsg.stat) + return stat_; +} +inline void Response_sendmsg::set_stat(bool value) { + + stat_ = value; + // @@protoc_insertion_point(field_set:Response_sendmsg.stat) +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ @@ -879,12 +1792,28 @@ inline void Request_sendmsg::set_allocated_msg(std::string* msg) { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) PROTOBUF_NAMESPACE_OPEN +template <> struct is_proto_enum< ::Request_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::Request_Type>() { + return ::Request_Type_descriptor(); +} +template <> struct is_proto_enum< ::Response_Type> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::Response_Type>() { + return ::Response_Type_descriptor(); +} template <> struct is_proto_enum< ::Response_login_STAT> : ::std::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::Response_login_STAT>() { diff --git a/IM/IMProtocol.proto b/IM/IMProtocol.proto index d503aee..ce94842 100644 --- a/IM/IMProtocol.proto +++ b/IM/IMProtocol.proto @@ -1,8 +1,45 @@ syntax = "proto3"; +// +message Request { + + // 包类型 + enum Type { + LOGIN = 0; + LOGOUT = 1; + SENDMSG = 2; + } + Type type = 1; + oneof pdu { + Request_login request_login = 11; + Request_logout request_logout = 12; + Request_sendmsg request_sendmsg = 13; + } +} + +// 服务端对客户端的响应 +message Response { + + // 类型 + enum Type { + LOGIN = 0; + LOGOUT = 1; + SENDMSG = 2; + } + + Type type = 1; + oneof pdu { + Response_login response_login = 11; + //Response_logout response_logout = 12; + Response_sendmsg response_sendmsg = 13; + } +} + + + //登录请求 message Request_login { - uint64 ID = 1; + uint64 ID = 1; string password = 2; // Next available id: 1 } @@ -23,18 +60,33 @@ message Response_login { // Next available id: 1 } -//请求登出 +//登出请求 message Request_logout { uint64 ID = 1; // Next available id: 1 } -//请求发送消息 +////登出应答 +//message Response_logout { +// uint64 ID = 1; +// // Next available id: 1 +//} + + +//请求发送消 message Request_sendmsg { - uint64 ID = 1; //自己的ID - uint64 objID = 2; //对方的ID - string msg = 3; + uint32 msgID = 1; //消息ID + uint64 ID = 2; //自己的ID + uint64 objID = 3; //对方的ID + string msg = 4; + + // Next available id: 1 +} +//请求发送消 +message Response_sendmsg { + uint32 msgID = 1; + bool stat = 2; // Next available id: 1 }