MOD: restructures the build process

Adds a protobuf setup configuration which does the following:
	- recursively finds all directories with proto files and adds them to PROTO_IMPORT_DIRS list
	- sets the proto import directories as protoc arguments
	- calls protoc with given arguments to generate src files from the proto files
	- saves all generated file in a list for later use in other cmake files
This way all import dirs are recursively found, so protos can be easily used in projects that include these projects.
This commit is contained in:
2025-05-01 20:53:21 +02:00
parent 6422c368de
commit ddf8eb417e
12 changed files with 105 additions and 2365 deletions

View File

@ -1,6 +1,13 @@
cmake_minimum_required (VERSION 3.25 FATAL_ERROR)
project (whisperCom VERSION 0.0.1 LANGUAGES CXX C)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
# set the path to the protobuf setup when you call cmake like:
# cmake -DProtobufSetup_DIR=cmake/Modules/ProtobufSetupExport ..
find_package(ProtobufSetup REQUIRED)
#
# Options for compiling whisperCom
@ -14,7 +21,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
#
include(doxygen)
include(compdb)
include(protobuf)
IF(${TEST_WHISPERCOM})
include(CTest)
@ -60,42 +66,38 @@ IF(NOT TARGET cppzmq-static)
add_subdirectory(libs/cppzmq EXCLUDE_FROM_ALL)
ENDIF()
IF(NOT TARGET protobuf)
SET(protobuf_BUILD_TESTS OFF CACHE BOOL "disable protobuf tests")
SET(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "disable shared libraries")
#SET(WITH_PROTOC ON CACHE BOOL "enable building of protoc")
add_subdirectory(libs/protobuf EXCLUDE_FROM_ALL)
set(PROTOC ${CMAKE_CURRENT_BINARY_DIR}/libs/protobuf/protoc CACHE INTERNAL "" )
set(PROTO_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs/protobuf/src CACHE INTERNAL "" )
ENDIF()
# we are building with c++20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
# Protobuf related stuff
file(GLOB PROTO_FILES "${CMAKE_CURRENT_SOURCE_DIR}/protos/*.proto")
set(GENERATED_SRC_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated)
protobuf_generate_cpp(PROTO_PATH proto CPP_PATH proto HPP_PATH proto)
SET(WHISPERCOM_SOURCES
proto/RouterMessage.pb.cc
proto/Message.pb.cc
proto/TestMessage.pb.cc
include/WhisperCom/Router.hpp
src/WhisperCom/Router.cpp
include/WhisperCom/Service.hpp
src/WhisperCom/Service.cpp
protobuf_generate_cpp_manual(PROTO_SRCS PROTO_HDRS whisperCom "${PROTO_FILES}" "${GENERATED_SRC_DIR}")
SET(WHISPERCOM_SOURCES
${PROTO_SRCS}
include/WhisperCom/Router.hpp
src/WhisperCom/Router.cpp
include/WhisperCom/Service.hpp
src/WhisperCom/Service.cpp
)
add_library(whisperCom STATIC ${WHISPERCOM_SOURCES})
target_link_libraries(whisperCom loguru cppzmq-static protobuf::libprotobuf ${CMAKE_THREAD_LIBS_INIT} )
target_link_libraries(whisperCom loguru cppzmq-static ${CMAKE_THREAD_LIBS_INIT} ${PROTOBUF_LIBRARIES})
target_include_directories(whisperCom
PUBLIC
include
proto
PRIVATE
src
PUBLIC
include
${GENERATED_SRC_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/protos
${PROTOBUF_INCLUDE_DIR}
PRIVATE
src
)
add_dependencies(whisperCom protoc)
add_executable(wctest src/main.cpp)
target_link_libraries(wctest whisperCom)

View File

@ -0,0 +1,72 @@
find_program(PROTOC_PATH protoc)
if(NOT PROTOC_PATH)
message(FATAL_ERROR "protoc nicht gefunden! Bitte installieren oder Pfad setzen.")
else()
message(STATUS "Gefundenes protoc: ${PROTOC_PATH}")
endif()
set(PROTOBUF_INCLUDE_DIR ${CMAKE_BINARY_DIR}/libs/protobuf/src/google/protobuf CACHE PATH "Protobuf include directory")
# find libprotobuf.so
find_library(PROTOBUF_LIBRARIES
NAMES protobuf
HINTS /usr /usr/local /opt/homebrew
PATH_SUFFIXES lib lib64
REQUIRED
)
# recursively find all directories with proto files and add them to PROTO_IMPORT_DIRS list
file(GLOB_RECURSE ALL_PROTO_FILES RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/*.proto)
set(PROTO_IMPORT_DIRS "")
foreach(PROTO_FILE ${ALL_PROTO_FILES})
get_filename_component(DIR "${CMAKE_SOURCE_DIR}/${PROTO_FILE}" DIRECTORY)
list(APPEND PROTO_IMPORT_DIRS "${DIR}")
endforeach()
list(REMOVE_DUPLICATES PROTO_IMPORT_DIRS)
# set the proto import directories as protoc arguments
set(PROTOC_INCLUDE_ARGS "")
foreach(DIR ${PROTO_IMPORT_DIRS})
list(APPEND PROTOC_INCLUDE_ARGS -I ${DIR})
endforeach()
set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIR} PARENT_SCOPE)
set(PROTOBUF_LIBRARIES ${PROTOBUF_LIBRARIES} PARENT_SCOPE)
set(PROTOC_PATH ${PROTOC_PATH} PARENT_SCOPE)
set(PROTOC_INCLUDE_ARGS ${PROTOC_INCLUDE_ARGS} PARENT_SCOPE)
set(PROTO_IMPORT_DIRS ${PROTO_IMPORT_DIRS} PARENT_SCOPE)
# generate the .cc and .h files from the proto files
function(protobuf_generate_cpp_manual OUT_SRCS OUT_HDRS TARGET_NAME PROTO_FILES GENERATED_SRC_DIR)
file(MAKE_DIRECTORY ${GENERATED_SRC_DIR})
foreach(PROTO_FILE ${PROTO_FILES})
get_filename_component(PROTO_NAME ${PROTO_FILE} NAME_WE) # get the proto name example message
get_filename_component(PROTO_DIR ${PROTO_FILE} DIRECTORY) # get the directory of the "message" proto file
get_filename_component(PROTO_FILE_BASENAME ${PROTO_FILE} NAME) # get the file name message.proto
set(GENERATED_SRC "${GENERATED_SRC_DIR}/${PROTO_NAME}.pb.cc")
set(GENERATED_HDR "${GENERATED_SRC_DIR}/${PROTO_NAME}.pb.h")
add_custom_command(
OUTPUT ${GENERATED_SRC} ${GENERATED_HDR}
COMMAND ${PROTOC_PATH}
ARGS --cpp_out=${GENERATED_SRC_DIR}
-I ${PROTO_DIR}
${PROTOC_INCLUDE_ARGS}
${PROTO_FILE_BASENAME}
DEPENDS ${PROTO_FILE}
WORKING_DIRECTORY ${PROTO_DIR}
)
list(APPEND _SRCS ${GENERATED_SRC})
list(APPEND _HDRS ${GENERATED_HDR})
endforeach()
# all generated source and header files including relative path for use in other cmake file
set(${OUT_SRCS} ${_SRCS} PARENT_SCOPE)
set(${OUT_HDRS} ${_HDRS} PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,2 @@
include("${CMAKE_CURRENT_LIST_DIR}/ProtobufSetup.cmake")
set(PROTOBUF_SETUP_INCLUDED TRUE)

View File

@ -1,367 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Message.proto
#include "Message.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/generated_message_tctable_impl.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace WhisperCom {
namespace Protobuf {
template <typename>
PROTOBUF_CONSTEXPR Message::Message(::_pbi::ConstantInitialized)
: _impl_{
/*decltype(_impl_._has_bits_)*/ {},
/*decltype(_impl_._cached_size_)*/ {},
/*decltype(_impl_.payload_)*/ nullptr,
/*decltype(_impl_.type_)*/ 0u,
} {}
struct MessageDefaultTypeInternal {
PROTOBUF_CONSTEXPR MessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~MessageDefaultTypeInternal() {}
union {
Message _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageDefaultTypeInternal _Message_default_instance_;
} // namespace Protobuf
} // namespace WhisperCom
static ::_pb::Metadata file_level_metadata_Message_2eproto[1];
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_Message_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_Message_2eproto = nullptr;
const ::uint32_t TableStruct_Message_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::Message, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::Message, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::Message, _impl_.type_),
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::Message, _impl_.payload_),
~0u,
0,
};
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, 10, -1, sizeof(::WhisperCom::Protobuf::Message)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::WhisperCom::Protobuf::_Message_default_instance_._instance,
};
const char descriptor_table_protodef_Message_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\rMessage.proto\022\023WhisperCom.Protobuf\032\031go"
"ogle/protobuf/any.proto\">\n\007Message\022\014\n\004ty"
"pe\030\001 \001(\r\022%\n\007payload\030\002 \001(\0132\024.google.proto"
"buf.Anyb\006proto3"
};
static const ::_pbi::DescriptorTable* const descriptor_table_Message_2eproto_deps[1] =
{
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
};
static ::absl::once_flag descriptor_table_Message_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_Message_2eproto = {
false,
false,
135,
descriptor_table_protodef_Message_2eproto,
"Message.proto",
&descriptor_table_Message_2eproto_once,
descriptor_table_Message_2eproto_deps,
1,
1,
schemas,
file_default_instances,
TableStruct_Message_2eproto::offsets,
file_level_metadata_Message_2eproto,
file_level_enum_descriptors_Message_2eproto,
file_level_service_descriptors_Message_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_Message_2eproto_getter() {
return &descriptor_table_Message_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_Message_2eproto(&descriptor_table_Message_2eproto);
namespace WhisperCom {
namespace Protobuf {
// ===================================================================
class Message::_Internal {
public:
using HasBits = decltype(std::declval<Message>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(Message, _impl_._has_bits_);
static const ::google::protobuf::Any& payload(const Message* msg);
static void set_has_payload(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
const ::google::protobuf::Any& Message::_Internal::payload(const Message* msg) {
return *msg->_impl_.payload_;
}
void Message::clear_payload() {
if (_impl_.payload_ != nullptr) _impl_.payload_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
}
Message::Message(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:WhisperCom.Protobuf.Message)
}
Message::Message(const Message& from) : ::google::protobuf::Message() {
Message* const _this = this;
(void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_},
/*decltype(_impl_._cached_size_)*/ {},
decltype(_impl_.payload_){nullptr},
decltype(_impl_.type_){},
};
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_impl_.payload_ = new ::google::protobuf::Any(*from._impl_.payload_);
}
_this->_impl_.type_ = from._impl_.type_;
// @@protoc_insertion_point(copy_constructor:WhisperCom.Protobuf.Message)
}
inline void Message::SharedCtor(::_pb::Arena* arena) {
(void)arena;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){},
/*decltype(_impl_._cached_size_)*/ {},
decltype(_impl_.payload_){nullptr},
decltype(_impl_.type_){0u},
};
}
Message::~Message() {
// @@protoc_insertion_point(destructor:WhisperCom.Protobuf.Message)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void Message::SharedDtor() {
ABSL_DCHECK(GetArenaForAllocation() == nullptr);
if (this != internal_default_instance()) delete _impl_.payload_;
}
void Message::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
PROTOBUF_NOINLINE void Message::Clear() {
// @@protoc_insertion_point(message_clear_start:WhisperCom.Protobuf.Message)
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(_impl_.payload_ != nullptr);
_impl_.payload_->Clear();
}
_impl_.type_ = 0u;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* Message::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 1, 0, 2> Message::_table_ = {
{
PROTOBUF_FIELD_OFFSET(Message, _impl_._has_bits_),
0, // no _extensions_
2, 8, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967292, // skipmap
offsetof(decltype(_table_), field_entries),
2, // num_field_entries
1, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
&_Message_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// .google.protobuf.Any payload = 2;
{::_pbi::TcParser::FastMtS1,
{18, 0, 0, PROTOBUF_FIELD_OFFSET(Message, _impl_.payload_)}},
// uint32 type = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Message, _impl_.type_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(Message, _impl_.type_)}},
}}, {{
65535, 65535
}}, {{
// uint32 type = 1;
{PROTOBUF_FIELD_OFFSET(Message, _impl_.type_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
// .google.protobuf.Any payload = 2;
{PROTOBUF_FIELD_OFFSET(Message, _impl_.payload_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
}}, {{
{::_pbi::TcParser::GetTable<::google::protobuf::Any>()},
}}, {{
}},
};
::uint8_t* Message::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:WhisperCom.Protobuf.Message)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint32 type = 1;
if (this->_internal_type() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
1, this->_internal_type(), target);
}
cached_has_bits = _impl_._has_bits_[0];
// .google.protobuf.Any payload = 2;
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessage(2, _Internal::payload(this),
_Internal::payload(this).GetCachedSize(), target, stream);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:WhisperCom.Protobuf.Message)
return target;
}
::size_t Message::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:WhisperCom.Protobuf.Message)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// .google.protobuf.Any payload = 2;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*_impl_.payload_);
}
// uint32 type = 1;
if (this->_internal_type() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_type());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData Message::_class_data_ = {
::google::protobuf::Message::CopyWithSourceCheck,
Message::MergeImpl
};
const ::google::protobuf::Message::ClassData*Message::GetClassData() const { return &_class_data_; }
void Message::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<Message*>(&to_msg);
auto& from = static_cast<const Message&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:WhisperCom.Protobuf.Message)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_internal_mutable_payload()->::google::protobuf::Any::MergeFrom(
from._internal_payload());
}
if (from._internal_type() != 0) {
_this->_internal_set_type(from._internal_type());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void Message::CopyFrom(const Message& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:WhisperCom.Protobuf.Message)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool Message::IsInitialized() const {
return true;
}
void Message::InternalSwap(Message* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(Message, _impl_.type_)
+ sizeof(Message::_impl_.type_)
- PROTOBUF_FIELD_OFFSET(Message, _impl_.payload_)>(
reinterpret_cast<char*>(&_impl_.payload_),
reinterpret_cast<char*>(&other->_impl_.payload_));
}
::google::protobuf::Metadata Message::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_Message_2eproto_getter, &descriptor_table_Message_2eproto_once,
file_level_metadata_Message_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template<> PROTOBUF_NOINLINE ::WhisperCom::Protobuf::Message*
Arena::CreateMaybeMessage< ::WhisperCom::Protobuf::Message >(Arena* arena) {
return Arena::CreateMessageInternal< ::WhisperCom::Protobuf::Message >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

View File

@ -1,389 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Message.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_Message_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_Message_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4023000
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 4023000 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/arenastring.h"
#include "google/protobuf/generated_message_tctable_decl.h"
#include "google/protobuf/generated_message_util.h"
#include "google/protobuf/metadata_lite.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/message.h"
#include "google/protobuf/repeated_field.h" // IWYU pragma: export
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/any.pb.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_Message_2eproto
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_Message_2eproto {
static const ::uint32_t offsets[];
};
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_Message_2eproto;
namespace WhisperCom {
namespace Protobuf {
class Message;
struct MessageDefaultTypeInternal;
extern MessageDefaultTypeInternal _Message_default_instance_;
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template <>
::WhisperCom::Protobuf::Message* Arena::CreateMaybeMessage<::WhisperCom::Protobuf::Message>(Arena*);
} // namespace protobuf
} // namespace google
namespace WhisperCom {
namespace Protobuf {
// ===================================================================
// -------------------------------------------------------------------
class Message final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:WhisperCom.Protobuf.Message) */ {
public:
inline Message() : Message(nullptr) {}
~Message() override;
template<typename = void>
explicit PROTOBUF_CONSTEXPR Message(::google::protobuf::internal::ConstantInitialized);
Message(const Message& from);
Message(Message&& from) noexcept
: Message() {
*this = ::std::move(from);
}
inline Message& operator=(const Message& from) {
CopyFrom(from);
return *this;
}
inline Message& operator=(Message&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const Message& default_instance() {
return *internal_default_instance();
}
static inline const Message* internal_default_instance() {
return reinterpret_cast<const Message*>(
&_Message_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(Message& a, Message& b) {
a.Swap(&b);
}
inline void Swap(Message* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Message* other) {
if (other == this) return;
ABSL_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Message* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Message>(arena);
}
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const Message& from);
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const Message& from) {
Message::MergeImpl(*this, from);
}
private:
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
::uint8_t* _InternalSerialize(
::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Message* other);
private:
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "WhisperCom.Protobuf.Message";
}
protected:
explicit Message(::google::protobuf::Arena* arena);
public:
static const ClassData _class_data_;
const ::google::protobuf::Message::ClassData*GetClassData() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kPayloadFieldNumber = 2,
kTypeFieldNumber = 1,
};
// .google.protobuf.Any payload = 2;
bool has_payload() const;
void clear_payload() ;
const ::google::protobuf::Any& payload() const;
PROTOBUF_NODISCARD ::google::protobuf::Any* release_payload();
::google::protobuf::Any* mutable_payload();
void set_allocated_payload(::google::protobuf::Any* value);
void unsafe_arena_set_allocated_payload(::google::protobuf::Any* value);
::google::protobuf::Any* unsafe_arena_release_payload();
private:
const ::google::protobuf::Any& _internal_payload() const;
::google::protobuf::Any* _internal_mutable_payload();
public:
// uint32 type = 1;
void clear_type() ;
::uint32_t type() const;
void set_type(::uint32_t value);
private:
::uint32_t _internal_type() const;
void _internal_set_type(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:WhisperCom.Protobuf.Message)
private:
class _Internal;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<1, 2, 1, 0, 2> _table_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::Any* payload_;
::uint32_t type_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_Message_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Message
// uint32 type = 1;
inline void Message::clear_type() {
_impl_.type_ = 0u;
}
inline ::uint32_t Message::type() const {
// @@protoc_insertion_point(field_get:WhisperCom.Protobuf.Message.type)
return _internal_type();
}
inline void Message::set_type(::uint32_t value) {
_internal_set_type(value);
// @@protoc_insertion_point(field_set:WhisperCom.Protobuf.Message.type)
}
inline ::uint32_t Message::_internal_type() const {
return _impl_.type_;
}
inline void Message::_internal_set_type(::uint32_t value) {
;
_impl_.type_ = value;
}
// .google.protobuf.Any payload = 2;
inline bool Message::has_payload() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
PROTOBUF_ASSUME(!value || _impl_.payload_ != nullptr);
return value;
}
inline const ::google::protobuf::Any& Message::_internal_payload() const {
const ::google::protobuf::Any* p = _impl_.payload_;
return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::Any&>(::google::protobuf::_Any_default_instance_);
}
inline const ::google::protobuf::Any& Message::payload() const {
// @@protoc_insertion_point(field_get:WhisperCom.Protobuf.Message.payload)
return _internal_payload();
}
inline void Message::unsafe_arena_set_allocated_payload(::google::protobuf::Any* value) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.payload_);
}
_impl_.payload_ = reinterpret_cast<::google::protobuf::Any*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:WhisperCom.Protobuf.Message.payload)
}
inline ::google::protobuf::Any* Message::release_payload() {
_impl_._has_bits_[0] &= ~0x00000001u;
::google::protobuf::Any* released = _impl_.payload_;
_impl_.payload_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released);
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
if (GetArenaForAllocation() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return released;
}
inline ::google::protobuf::Any* Message::unsafe_arena_release_payload() {
// @@protoc_insertion_point(field_release:WhisperCom.Protobuf.Message.payload)
_impl_._has_bits_[0] &= ~0x00000001u;
::google::protobuf::Any* temp = _impl_.payload_;
_impl_.payload_ = nullptr;
return temp;
}
inline ::google::protobuf::Any* Message::_internal_mutable_payload() {
_impl_._has_bits_[0] |= 0x00000001u;
if (_impl_.payload_ == nullptr) {
auto* p = CreateMaybeMessage<::google::protobuf::Any>(GetArenaForAllocation());
_impl_.payload_ = reinterpret_cast<::google::protobuf::Any*>(p);
}
return _impl_.payload_;
}
inline ::google::protobuf::Any* Message::mutable_payload() {
::google::protobuf::Any* _msg = _internal_mutable_payload();
// @@protoc_insertion_point(field_mutable:WhisperCom.Protobuf.Message.payload)
return _msg;
}
inline void Message::set_allocated_payload(::google::protobuf::Any* value) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.payload_);
}
if (value != nullptr) {
::google::protobuf::Arena* submessage_arena =
::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::MessageLite*>(value));
if (message_arena != submessage_arena) {
value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.payload_ = reinterpret_cast<::google::protobuf::Any*>(value);
// @@protoc_insertion_point(field_set_allocated:WhisperCom.Protobuf.Message.payload)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace Protobuf
} // namespace WhisperCom
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_Message_2eproto_2epb_2eh

View File

@ -1,443 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: RouterMessage.proto
#include "RouterMessage.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/generated_message_tctable_impl.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace WhisperCom {
namespace Protobuf {
template <typename>
PROTOBUF_CONSTEXPR RouterMessage::RouterMessage(::_pbi::ConstantInitialized)
: _impl_{
/*decltype(_impl_._has_bits_)*/ {},
/*decltype(_impl_._cached_size_)*/ {},
/*decltype(_impl_.topic_)*/ {
&::_pbi::fixed_address_empty_string,
::_pbi::ConstantInitialized{},
},
/*decltype(_impl_.msg_)*/ nullptr,
/*decltype(_impl_.type_)*/ 0,
} {}
struct RouterMessageDefaultTypeInternal {
PROTOBUF_CONSTEXPR RouterMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~RouterMessageDefaultTypeInternal() {}
union {
RouterMessage _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RouterMessageDefaultTypeInternal _RouterMessage_default_instance_;
} // namespace Protobuf
} // namespace WhisperCom
static ::_pb::Metadata file_level_metadata_RouterMessage_2eproto[1];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_RouterMessage_2eproto[1];
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_RouterMessage_2eproto = nullptr;
const ::uint32_t TableStruct_RouterMessage_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::RouterMessage, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::RouterMessage, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::RouterMessage, _impl_.type_),
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::RouterMessage, _impl_.msg_),
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::RouterMessage, _impl_.topic_),
~0u,
0,
~0u,
};
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, 11, -1, sizeof(::WhisperCom::Protobuf::RouterMessage)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::WhisperCom::Protobuf::_RouterMessage_default_instance_._instance,
};
const char descriptor_table_protodef_RouterMessage_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\023RouterMessage.proto\022\023WhisperCom.Protob"
"uf\032\031google/protobuf/any.proto\032\rMessage.p"
"roto\"\177\n\rRouterMessage\0224\n\004type\030\001 \001(\0162&.Wh"
"isperCom.Protobuf.RouterMessageType\022)\n\003m"
"sg\030\002 \001(\0132\034.WhisperCom.Protobuf.Message\022\r"
"\n\005topic\030\003 \001(\t*\203\001\n\021RouterMessageType\022\013\n\007U"
"NKNOWN\020\000\022\010\n\004JOIN\020\001\022\t\n\005LEAVE\020\002\022\010\n\004DATA\020\003\022"
"\r\n\tKEEPALIVE\020\004\022\r\n\tSUBSCRIBE\020\005\022\017\n\013UNSUBSC"
"RIBE\020\006\022\023\n\017UNSUBSCRIBE_ALL\020\007b\006proto3"
};
static const ::_pbi::DescriptorTable* const descriptor_table_RouterMessage_2eproto_deps[2] =
{
&::descriptor_table_Message_2eproto,
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
};
static ::absl::once_flag descriptor_table_RouterMessage_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_RouterMessage_2eproto = {
false,
false,
355,
descriptor_table_protodef_RouterMessage_2eproto,
"RouterMessage.proto",
&descriptor_table_RouterMessage_2eproto_once,
descriptor_table_RouterMessage_2eproto_deps,
2,
1,
schemas,
file_default_instances,
TableStruct_RouterMessage_2eproto::offsets,
file_level_metadata_RouterMessage_2eproto,
file_level_enum_descriptors_RouterMessage_2eproto,
file_level_service_descriptors_RouterMessage_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_RouterMessage_2eproto_getter() {
return &descriptor_table_RouterMessage_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_RouterMessage_2eproto(&descriptor_table_RouterMessage_2eproto);
namespace WhisperCom {
namespace Protobuf {
const ::google::protobuf::EnumDescriptor* RouterMessageType_descriptor() {
::google::protobuf::internal::AssignDescriptors(&descriptor_table_RouterMessage_2eproto);
return file_level_enum_descriptors_RouterMessage_2eproto[0];
}
bool RouterMessageType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
return true;
default:
return false;
}
}
// ===================================================================
class RouterMessage::_Internal {
public:
using HasBits = decltype(std::declval<RouterMessage>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_._has_bits_);
static const ::WhisperCom::Protobuf::Message& msg(const RouterMessage* msg);
static void set_has_msg(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
};
const ::WhisperCom::Protobuf::Message& RouterMessage::_Internal::msg(const RouterMessage* msg) {
return *msg->_impl_.msg_;
}
void RouterMessage::clear_msg() {
if (_impl_.msg_ != nullptr) _impl_.msg_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
}
RouterMessage::RouterMessage(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:WhisperCom.Protobuf.RouterMessage)
}
RouterMessage::RouterMessage(const RouterMessage& from) : ::google::protobuf::Message() {
RouterMessage* const _this = this;
(void)_this;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){from._impl_._has_bits_},
/*decltype(_impl_._cached_size_)*/ {},
decltype(_impl_.topic_){},
decltype(_impl_.msg_){nullptr},
decltype(_impl_.type_){},
};
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
_impl_.topic_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.topic_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_topic().empty()) {
_this->_impl_.topic_.Set(from._internal_topic(), _this->GetArenaForAllocation());
}
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_impl_.msg_ = new ::WhisperCom::Protobuf::Message(*from._impl_.msg_);
}
_this->_impl_.type_ = from._impl_.type_;
// @@protoc_insertion_point(copy_constructor:WhisperCom.Protobuf.RouterMessage)
}
inline void RouterMessage::SharedCtor(::_pb::Arena* arena) {
(void)arena;
new (&_impl_) Impl_{
decltype(_impl_._has_bits_){},
/*decltype(_impl_._cached_size_)*/ {},
decltype(_impl_.topic_){},
decltype(_impl_.msg_){nullptr},
decltype(_impl_.type_){0},
};
_impl_.topic_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.topic_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
RouterMessage::~RouterMessage() {
// @@protoc_insertion_point(destructor:WhisperCom.Protobuf.RouterMessage)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void RouterMessage::SharedDtor() {
ABSL_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.topic_.Destroy();
if (this != internal_default_instance()) delete _impl_.msg_;
}
void RouterMessage::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
PROTOBUF_NOINLINE void RouterMessage::Clear() {
// @@protoc_insertion_point(message_clear_start:WhisperCom.Protobuf.RouterMessage)
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.topic_.ClearToEmpty();
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(_impl_.msg_ != nullptr);
_impl_.msg_->Clear();
}
_impl_.type_ = 0;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* RouterMessage::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<2, 3, 1, 47, 2> RouterMessage::_table_ = {
{
PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_._has_bits_),
0, // no _extensions_
3, 24, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967288, // skipmap
offsetof(decltype(_table_), field_entries),
3, // num_field_entries
1, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
&_RouterMessage_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
{::_pbi::TcParser::MiniParse, {}},
// .WhisperCom.Protobuf.RouterMessageType type = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RouterMessage, _impl_.type_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.type_)}},
// .WhisperCom.Protobuf.Message msg = 2;
{::_pbi::TcParser::FastMtS1,
{18, 0, 0, PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.msg_)}},
// string topic = 3;
{::_pbi::TcParser::FastUS1,
{26, 63, 0, PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.topic_)}},
}}, {{
65535, 65535
}}, {{
// .WhisperCom.Protobuf.RouterMessageType type = 1;
{PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.type_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kOpenEnum)},
// .WhisperCom.Protobuf.Message msg = 2;
{PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.msg_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
// string topic = 3;
{PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.topic_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
}}, {{
{::_pbi::TcParser::GetTable<::WhisperCom::Protobuf::Message>()},
}}, {{
"\41\0\0\5\0\0\0\0"
"WhisperCom.Protobuf.RouterMessage"
"topic"
}},
};
::uint8_t* RouterMessage::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:WhisperCom.Protobuf.RouterMessage)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// .WhisperCom.Protobuf.RouterMessageType type = 1;
if (this->_internal_type() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
1, this->_internal_type(), target);
}
cached_has_bits = _impl_._has_bits_[0];
// .WhisperCom.Protobuf.Message msg = 2;
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessage(2, _Internal::msg(this),
_Internal::msg(this).GetCachedSize(), target, stream);
}
// string topic = 3;
if (!this->_internal_topic().empty()) {
const std::string& _s = this->_internal_topic();
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "WhisperCom.Protobuf.RouterMessage.topic");
target = stream->WriteStringMaybeAliased(3, _s, target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:WhisperCom.Protobuf.RouterMessage)
return target;
}
::size_t RouterMessage::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:WhisperCom.Protobuf.RouterMessage)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string topic = 3;
if (!this->_internal_topic().empty()) {
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this->_internal_topic());
}
// .WhisperCom.Protobuf.Message msg = 2;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*_impl_.msg_);
}
// .WhisperCom.Protobuf.RouterMessageType type = 1;
if (this->_internal_type() != 0) {
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_type());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData RouterMessage::_class_data_ = {
::google::protobuf::Message::CopyWithSourceCheck,
RouterMessage::MergeImpl
};
const ::google::protobuf::Message::ClassData*RouterMessage::GetClassData() const { return &_class_data_; }
void RouterMessage::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<RouterMessage*>(&to_msg);
auto& from = static_cast<const RouterMessage&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:WhisperCom.Protobuf.RouterMessage)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_topic().empty()) {
_this->_internal_set_topic(from._internal_topic());
}
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_internal_mutable_msg()->::WhisperCom::Protobuf::Message::MergeFrom(
from._internal_msg());
}
if (from._internal_type() != 0) {
_this->_internal_set_type(from._internal_type());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void RouterMessage::CopyFrom(const RouterMessage& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:WhisperCom.Protobuf.RouterMessage)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool RouterMessage::IsInitialized() const {
return true;
}
void RouterMessage::InternalSwap(RouterMessage* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.topic_, lhs_arena,
&other->_impl_.topic_, rhs_arena);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.type_)
+ sizeof(RouterMessage::_impl_.type_)
- PROTOBUF_FIELD_OFFSET(RouterMessage, _impl_.msg_)>(
reinterpret_cast<char*>(&_impl_.msg_),
reinterpret_cast<char*>(&other->_impl_.msg_));
}
::google::protobuf::Metadata RouterMessage::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_RouterMessage_2eproto_getter, &descriptor_table_RouterMessage_2eproto_once,
file_level_metadata_RouterMessage_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template<> PROTOBUF_NOINLINE ::WhisperCom::Protobuf::RouterMessage*
Arena::CreateMaybeMessage< ::WhisperCom::Protobuf::RouterMessage >(Arena* arena) {
return Arena::CreateMessageInternal< ::WhisperCom::Protobuf::RouterMessage >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

View File

@ -1,505 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: RouterMessage.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_RouterMessage_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_RouterMessage_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4023000
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 4023000 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/arenastring.h"
#include "google/protobuf/generated_message_tctable_decl.h"
#include "google/protobuf/generated_message_util.h"
#include "google/protobuf/metadata_lite.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/message.h"
#include "google/protobuf/repeated_field.h" // IWYU pragma: export
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/generated_enum_reflection.h"
#include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/any.pb.h"
#include "Message.pb.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_RouterMessage_2eproto
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_RouterMessage_2eproto {
static const ::uint32_t offsets[];
};
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_RouterMessage_2eproto;
namespace WhisperCom {
namespace Protobuf {
class RouterMessage;
struct RouterMessageDefaultTypeInternal;
extern RouterMessageDefaultTypeInternal _RouterMessage_default_instance_;
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template <>
::WhisperCom::Protobuf::RouterMessage* Arena::CreateMaybeMessage<::WhisperCom::Protobuf::RouterMessage>(Arena*);
} // namespace protobuf
} // namespace google
namespace WhisperCom {
namespace Protobuf {
enum RouterMessageType : int {
UNKNOWN = 0,
JOIN = 1,
LEAVE = 2,
DATA = 3,
KEEPALIVE = 4,
SUBSCRIBE = 5,
UNSUBSCRIBE = 6,
UNSUBSCRIBE_ALL = 7,
RouterMessageType_INT_MIN_SENTINEL_DO_NOT_USE_ =
std::numeric_limits<::int32_t>::min(),
RouterMessageType_INT_MAX_SENTINEL_DO_NOT_USE_ =
std::numeric_limits<::int32_t>::max(),
};
bool RouterMessageType_IsValid(int value);
constexpr RouterMessageType RouterMessageType_MIN = static_cast<RouterMessageType>(0);
constexpr RouterMessageType RouterMessageType_MAX = static_cast<RouterMessageType>(7);
constexpr int RouterMessageType_ARRAYSIZE = 7 + 1;
const ::google::protobuf::EnumDescriptor*
RouterMessageType_descriptor();
template <typename T>
const std::string& RouterMessageType_Name(T value) {
static_assert(std::is_same<T, RouterMessageType>::value ||
std::is_integral<T>::value,
"Incorrect type passed to RouterMessageType_Name().");
return RouterMessageType_Name(static_cast<RouterMessageType>(value));
}
template <>
inline const std::string& RouterMessageType_Name(RouterMessageType value) {
return ::google::protobuf::internal::NameOfDenseEnum<RouterMessageType_descriptor,
0, 7>(
static_cast<int>(value));
}
inline bool RouterMessageType_Parse(absl::string_view name, RouterMessageType* value) {
return ::google::protobuf::internal::ParseNamedEnum<RouterMessageType>(
RouterMessageType_descriptor(), name, value);
}
// ===================================================================
// -------------------------------------------------------------------
class RouterMessage final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:WhisperCom.Protobuf.RouterMessage) */ {
public:
inline RouterMessage() : RouterMessage(nullptr) {}
~RouterMessage() override;
template<typename = void>
explicit PROTOBUF_CONSTEXPR RouterMessage(::google::protobuf::internal::ConstantInitialized);
RouterMessage(const RouterMessage& from);
RouterMessage(RouterMessage&& from) noexcept
: RouterMessage() {
*this = ::std::move(from);
}
inline RouterMessage& operator=(const RouterMessage& from) {
CopyFrom(from);
return *this;
}
inline RouterMessage& operator=(RouterMessage&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const RouterMessage& default_instance() {
return *internal_default_instance();
}
static inline const RouterMessage* internal_default_instance() {
return reinterpret_cast<const RouterMessage*>(
&_RouterMessage_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(RouterMessage& a, RouterMessage& b) {
a.Swap(&b);
}
inline void Swap(RouterMessage* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(RouterMessage* other) {
if (other == this) return;
ABSL_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
RouterMessage* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<RouterMessage>(arena);
}
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const RouterMessage& from);
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const RouterMessage& from) {
RouterMessage::MergeImpl(*this, from);
}
private:
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
::uint8_t* _InternalSerialize(
::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(RouterMessage* other);
private:
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "WhisperCom.Protobuf.RouterMessage";
}
protected:
explicit RouterMessage(::google::protobuf::Arena* arena);
public:
static const ClassData _class_data_;
const ::google::protobuf::Message::ClassData*GetClassData() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kTopicFieldNumber = 3,
kMsgFieldNumber = 2,
kTypeFieldNumber = 1,
};
// string topic = 3;
void clear_topic() ;
const std::string& topic() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_topic(Arg_&& arg, Args_... args);
std::string* mutable_topic();
PROTOBUF_NODISCARD std::string* release_topic();
void set_allocated_topic(std::string* ptr);
private:
const std::string& _internal_topic() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_topic(
const std::string& value);
std::string* _internal_mutable_topic();
public:
// .WhisperCom.Protobuf.Message msg = 2;
bool has_msg() const;
void clear_msg() ;
const ::WhisperCom::Protobuf::Message& msg() const;
PROTOBUF_NODISCARD ::WhisperCom::Protobuf::Message* release_msg();
::WhisperCom::Protobuf::Message* mutable_msg();
void set_allocated_msg(::WhisperCom::Protobuf::Message* value);
void unsafe_arena_set_allocated_msg(::WhisperCom::Protobuf::Message* value);
::WhisperCom::Protobuf::Message* unsafe_arena_release_msg();
private:
const ::WhisperCom::Protobuf::Message& _internal_msg() const;
::WhisperCom::Protobuf::Message* _internal_mutable_msg();
public:
// .WhisperCom.Protobuf.RouterMessageType type = 1;
void clear_type() ;
::WhisperCom::Protobuf::RouterMessageType type() const;
void set_type(::WhisperCom::Protobuf::RouterMessageType value);
private:
::WhisperCom::Protobuf::RouterMessageType _internal_type() const;
void _internal_set_type(::WhisperCom::Protobuf::RouterMessageType value);
public:
// @@protoc_insertion_point(class_scope:WhisperCom.Protobuf.RouterMessage)
private:
class _Internal;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<2, 3, 1, 47, 2> _table_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr topic_;
::WhisperCom::Protobuf::Message* msg_;
int type_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_RouterMessage_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// RouterMessage
// .WhisperCom.Protobuf.RouterMessageType type = 1;
inline void RouterMessage::clear_type() {
_impl_.type_ = 0;
}
inline ::WhisperCom::Protobuf::RouterMessageType RouterMessage::type() const {
// @@protoc_insertion_point(field_get:WhisperCom.Protobuf.RouterMessage.type)
return _internal_type();
}
inline void RouterMessage::set_type(::WhisperCom::Protobuf::RouterMessageType value) {
_internal_set_type(value);
// @@protoc_insertion_point(field_set:WhisperCom.Protobuf.RouterMessage.type)
}
inline ::WhisperCom::Protobuf::RouterMessageType RouterMessage::_internal_type() const {
return static_cast<::WhisperCom::Protobuf::RouterMessageType>(_impl_.type_);
}
inline void RouterMessage::_internal_set_type(::WhisperCom::Protobuf::RouterMessageType value) {
;
_impl_.type_ = value;
}
// .WhisperCom.Protobuf.Message msg = 2;
inline bool RouterMessage::has_msg() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
PROTOBUF_ASSUME(!value || _impl_.msg_ != nullptr);
return value;
}
inline const ::WhisperCom::Protobuf::Message& RouterMessage::_internal_msg() const {
const ::WhisperCom::Protobuf::Message* p = _impl_.msg_;
return p != nullptr ? *p : reinterpret_cast<const ::WhisperCom::Protobuf::Message&>(::WhisperCom::Protobuf::_Message_default_instance_);
}
inline const ::WhisperCom::Protobuf::Message& RouterMessage::msg() const {
// @@protoc_insertion_point(field_get:WhisperCom.Protobuf.RouterMessage.msg)
return _internal_msg();
}
inline void RouterMessage::unsafe_arena_set_allocated_msg(::WhisperCom::Protobuf::Message* value) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.msg_);
}
_impl_.msg_ = reinterpret_cast<::WhisperCom::Protobuf::Message*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:WhisperCom.Protobuf.RouterMessage.msg)
}
inline ::WhisperCom::Protobuf::Message* RouterMessage::release_msg() {
_impl_._has_bits_[0] &= ~0x00000001u;
::WhisperCom::Protobuf::Message* released = _impl_.msg_;
_impl_.msg_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released);
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
if (GetArenaForAllocation() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return released;
}
inline ::WhisperCom::Protobuf::Message* RouterMessage::unsafe_arena_release_msg() {
// @@protoc_insertion_point(field_release:WhisperCom.Protobuf.RouterMessage.msg)
_impl_._has_bits_[0] &= ~0x00000001u;
::WhisperCom::Protobuf::Message* temp = _impl_.msg_;
_impl_.msg_ = nullptr;
return temp;
}
inline ::WhisperCom::Protobuf::Message* RouterMessage::_internal_mutable_msg() {
_impl_._has_bits_[0] |= 0x00000001u;
if (_impl_.msg_ == nullptr) {
auto* p = CreateMaybeMessage<::WhisperCom::Protobuf::Message>(GetArenaForAllocation());
_impl_.msg_ = reinterpret_cast<::WhisperCom::Protobuf::Message*>(p);
}
return _impl_.msg_;
}
inline ::WhisperCom::Protobuf::Message* RouterMessage::mutable_msg() {
::WhisperCom::Protobuf::Message* _msg = _internal_mutable_msg();
// @@protoc_insertion_point(field_mutable:WhisperCom.Protobuf.RouterMessage.msg)
return _msg;
}
inline void RouterMessage::set_allocated_msg(::WhisperCom::Protobuf::Message* value) {
::google::protobuf::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.msg_);
}
if (value != nullptr) {
::google::protobuf::Arena* submessage_arena =
::google::protobuf::Arena::InternalGetOwningArena(reinterpret_cast<::google::protobuf::MessageLite*>(value));
if (message_arena != submessage_arena) {
value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.msg_ = reinterpret_cast<::WhisperCom::Protobuf::Message*>(value);
// @@protoc_insertion_point(field_set_allocated:WhisperCom.Protobuf.RouterMessage.msg)
}
// string topic = 3;
inline void RouterMessage::clear_topic() {
_impl_.topic_.ClearToEmpty();
}
inline const std::string& RouterMessage::topic() const {
// @@protoc_insertion_point(field_get:WhisperCom.Protobuf.RouterMessage.topic)
return _internal_topic();
}
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void RouterMessage::set_topic(Arg_&& arg,
Args_... args) {
;
_impl_.topic_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WhisperCom.Protobuf.RouterMessage.topic)
}
inline std::string* RouterMessage::mutable_topic() {
std::string* _s = _internal_mutable_topic();
// @@protoc_insertion_point(field_mutable:WhisperCom.Protobuf.RouterMessage.topic)
return _s;
}
inline const std::string& RouterMessage::_internal_topic() const {
return _impl_.topic_.Get();
}
inline void RouterMessage::_internal_set_topic(const std::string& value) {
;
_impl_.topic_.Set(value, GetArenaForAllocation());
}
inline std::string* RouterMessage::_internal_mutable_topic() {
;
return _impl_.topic_.Mutable( GetArenaForAllocation());
}
inline std::string* RouterMessage::release_topic() {
// @@protoc_insertion_point(field_release:WhisperCom.Protobuf.RouterMessage.topic)
return _impl_.topic_.Release();
}
inline void RouterMessage::set_allocated_topic(std::string* value) {
_impl_.topic_.SetAllocated(value, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.topic_.IsDefault()) {
_impl_.topic_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WhisperCom.Protobuf.RouterMessage.topic)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template <>
struct is_proto_enum<::WhisperCom::Protobuf::RouterMessageType> : std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor<::WhisperCom::Protobuf::RouterMessageType>() {
return ::WhisperCom::Protobuf::RouterMessageType_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_RouterMessage_2eproto_2epb_2eh

View File

@ -1,317 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TestMessage.proto
#include "TestMessage.pb.h"
#include <algorithm>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/reflection_ops.h"
#include "google/protobuf/wire_format.h"
#include "google/protobuf/generated_message_tctable_impl.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace WhisperCom {
namespace Protobuf {
template <typename>
PROTOBUF_CONSTEXPR TestMessage::TestMessage(::_pbi::ConstantInitialized)
: _impl_{
/*decltype(_impl_.str_)*/ {
&::_pbi::fixed_address_empty_string,
::_pbi::ConstantInitialized{},
},
/*decltype(_impl_._cached_size_)*/ {},
} {}
struct TestMessageDefaultTypeInternal {
PROTOBUF_CONSTEXPR TestMessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~TestMessageDefaultTypeInternal() {}
union {
TestMessage _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TestMessageDefaultTypeInternal _TestMessage_default_instance_;
} // namespace Protobuf
} // namespace WhisperCom
static ::_pb::Metadata file_level_metadata_TestMessage_2eproto[1];
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_TestMessage_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_TestMessage_2eproto = nullptr;
const ::uint32_t TableStruct_TestMessage_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::TestMessage, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::WhisperCom::Protobuf::TestMessage, _impl_.str_),
};
static const ::_pbi::MigrationSchema
schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::WhisperCom::Protobuf::TestMessage)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::WhisperCom::Protobuf::_TestMessage_default_instance_._instance,
};
const char descriptor_table_protodef_TestMessage_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
"\n\021TestMessage.proto\022\023WhisperCom.Protobuf"
"\"\032\n\013TestMessage\022\013\n\003str\030\001 \001(\tb\006proto3"
};
static ::absl::once_flag descriptor_table_TestMessage_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_TestMessage_2eproto = {
false,
false,
76,
descriptor_table_protodef_TestMessage_2eproto,
"TestMessage.proto",
&descriptor_table_TestMessage_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_TestMessage_2eproto::offsets,
file_level_metadata_TestMessage_2eproto,
file_level_enum_descriptors_TestMessage_2eproto,
file_level_service_descriptors_TestMessage_2eproto,
};
// This function exists to be marked as weak.
// It can significantly speed up compilation by breaking up LLVM's SCC
// in the .pb.cc translation units. Large translation units see a
// reduction of more than 35% of walltime for optimized builds. Without
// the weak attribute all the messages in the file, including all the
// vtables and everything they use become part of the same SCC through
// a cycle like:
// GetMetadata -> descriptor table -> default instances ->
// vtables -> GetMetadata
// By adding a weak function here we break the connection from the
// individual vtables back into the descriptor table.
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_TestMessage_2eproto_getter() {
return &descriptor_table_TestMessage_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_TestMessage_2eproto(&descriptor_table_TestMessage_2eproto);
namespace WhisperCom {
namespace Protobuf {
// ===================================================================
class TestMessage::_Internal {
public:
};
TestMessage::TestMessage(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:WhisperCom.Protobuf.TestMessage)
}
TestMessage::TestMessage(const TestMessage& from) : ::google::protobuf::Message() {
TestMessage* const _this = this;
(void)_this;
new (&_impl_) Impl_{
decltype(_impl_.str_){},
/*decltype(_impl_._cached_size_)*/ {},
};
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
_impl_.str_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.str_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_str().empty()) {
_this->_impl_.str_.Set(from._internal_str(), _this->GetArenaForAllocation());
}
// @@protoc_insertion_point(copy_constructor:WhisperCom.Protobuf.TestMessage)
}
inline void TestMessage::SharedCtor(::_pb::Arena* arena) {
(void)arena;
new (&_impl_) Impl_{
decltype(_impl_.str_){},
/*decltype(_impl_._cached_size_)*/ {},
};
_impl_.str_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.str_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}
TestMessage::~TestMessage() {
// @@protoc_insertion_point(destructor:WhisperCom.Protobuf.TestMessage)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void TestMessage::SharedDtor() {
ABSL_DCHECK(GetArenaForAllocation() == nullptr);
_impl_.str_.Destroy();
}
void TestMessage::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
}
PROTOBUF_NOINLINE void TestMessage::Clear() {
// @@protoc_insertion_point(message_clear_start:WhisperCom.Protobuf.TestMessage)
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.str_.ClearToEmpty();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* TestMessage::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<0, 1, 0, 43, 2> TestMessage::_table_ = {
{
0, // no _has_bits_
0, // no _extensions_
1, 0, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967294, // skipmap
offsetof(decltype(_table_), field_entries),
1, // num_field_entries
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
&_TestMessage_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// string str = 1;
{::_pbi::TcParser::FastUS1,
{10, 63, 0, PROTOBUF_FIELD_OFFSET(TestMessage, _impl_.str_)}},
}}, {{
65535, 65535
}}, {{
// string str = 1;
{PROTOBUF_FIELD_OFFSET(TestMessage, _impl_.str_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
}},
// no aux_entries
{{
"\37\3\0\0\0\0\0\0"
"WhisperCom.Protobuf.TestMessage"
"str"
}},
};
::uint8_t* TestMessage::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:WhisperCom.Protobuf.TestMessage)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// string str = 1;
if (!this->_internal_str().empty()) {
const std::string& _s = this->_internal_str();
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "WhisperCom.Protobuf.TestMessage.str");
target = stream->WriteStringMaybeAliased(1, _s, target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:WhisperCom.Protobuf.TestMessage)
return target;
}
::size_t TestMessage::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:WhisperCom.Protobuf.TestMessage)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string str = 1;
if (!this->_internal_str().empty()) {
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this->_internal_str());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData TestMessage::_class_data_ = {
::google::protobuf::Message::CopyWithSourceCheck,
TestMessage::MergeImpl
};
const ::google::protobuf::Message::ClassData*TestMessage::GetClassData() const { return &_class_data_; }
void TestMessage::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<TestMessage*>(&to_msg);
auto& from = static_cast<const TestMessage&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:WhisperCom.Protobuf.TestMessage)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_str().empty()) {
_this->_internal_set_str(from._internal_str());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void TestMessage::CopyFrom(const TestMessage& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:WhisperCom.Protobuf.TestMessage)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool TestMessage::IsInitialized() const {
return true;
}
void TestMessage::InternalSwap(TestMessage* other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.str_, lhs_arena,
&other->_impl_.str_, rhs_arena);
}
::google::protobuf::Metadata TestMessage::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_TestMessage_2eproto_getter, &descriptor_table_TestMessage_2eproto_once,
file_level_metadata_TestMessage_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template<> PROTOBUF_NOINLINE ::WhisperCom::Protobuf::TestMessage*
Arena::CreateMaybeMessage< ::WhisperCom::Protobuf::TestMessage >(Arena* arena) {
return Arena::CreateMessageInternal< ::WhisperCom::Protobuf::TestMessage >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"

View File

@ -1,315 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: TestMessage.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_TestMessage_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_TestMessage_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4023000
#error "This file was generated by a newer version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please update"
#error "your headers."
#endif // PROTOBUF_VERSION
#if 4023000 < PROTOBUF_MIN_PROTOC_VERSION
#error "This file was generated by an older version of protoc which is"
#error "incompatible with your Protocol Buffer headers. Please"
#error "regenerate this file with a newer version of protoc."
#endif // PROTOBUF_MIN_PROTOC_VERSION
#include "google/protobuf/port_undef.inc"
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/arenastring.h"
#include "google/protobuf/generated_message_tctable_decl.h"
#include "google/protobuf/generated_message_util.h"
#include "google/protobuf/metadata_lite.h"
#include "google/protobuf/generated_message_reflection.h"
#include "google/protobuf/message.h"
#include "google/protobuf/repeated_field.h" // IWYU pragma: export
#include "google/protobuf/extension_set.h" // IWYU pragma: export
#include "google/protobuf/unknown_field_set.h"
// @@protoc_insertion_point(includes)
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_TestMessage_2eproto
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_TestMessage_2eproto {
static const ::uint32_t offsets[];
};
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_TestMessage_2eproto;
namespace WhisperCom {
namespace Protobuf {
class TestMessage;
struct TestMessageDefaultTypeInternal;
extern TestMessageDefaultTypeInternal _TestMessage_default_instance_;
} // namespace Protobuf
} // namespace WhisperCom
namespace google {
namespace protobuf {
template <>
::WhisperCom::Protobuf::TestMessage* Arena::CreateMaybeMessage<::WhisperCom::Protobuf::TestMessage>(Arena*);
} // namespace protobuf
} // namespace google
namespace WhisperCom {
namespace Protobuf {
// ===================================================================
// -------------------------------------------------------------------
class TestMessage final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:WhisperCom.Protobuf.TestMessage) */ {
public:
inline TestMessage() : TestMessage(nullptr) {}
~TestMessage() override;
template<typename = void>
explicit PROTOBUF_CONSTEXPR TestMessage(::google::protobuf::internal::ConstantInitialized);
TestMessage(const TestMessage& from);
TestMessage(TestMessage&& from) noexcept
: TestMessage() {
*this = ::std::move(from);
}
inline TestMessage& operator=(const TestMessage& from) {
CopyFrom(from);
return *this;
}
inline TestMessage& operator=(TestMessage&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const TestMessage& default_instance() {
return *internal_default_instance();
}
static inline const TestMessage* internal_default_instance() {
return reinterpret_cast<const TestMessage*>(
&_TestMessage_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(TestMessage& a, TestMessage& b) {
a.Swap(&b);
}
inline void Swap(TestMessage* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(TestMessage* other) {
if (other == this) return;
ABSL_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
TestMessage* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<TestMessage>(arena);
}
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const TestMessage& from);
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const TestMessage& from) {
TestMessage::MergeImpl(*this, from);
}
private:
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
::uint8_t* _InternalSerialize(
::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(TestMessage* other);
private:
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "WhisperCom.Protobuf.TestMessage";
}
protected:
explicit TestMessage(::google::protobuf::Arena* arena);
public:
static const ClassData _class_data_;
const ::google::protobuf::Message::ClassData*GetClassData() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kStrFieldNumber = 1,
};
// string str = 1;
void clear_str() ;
const std::string& str() const;
template <typename Arg_ = const std::string&, typename... Args_>
void set_str(Arg_&& arg, Args_... args);
std::string* mutable_str();
PROTOBUF_NODISCARD std::string* release_str();
void set_allocated_str(std::string* ptr);
private:
const std::string& _internal_str() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_str(
const std::string& value);
std::string* _internal_mutable_str();
public:
// @@protoc_insertion_point(class_scope:WhisperCom.Protobuf.TestMessage)
private:
class _Internal;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<0, 1, 0, 43, 2> _table_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::google::protobuf::internal::ArenaStringPtr str_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_TestMessage_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// TestMessage
// string str = 1;
inline void TestMessage::clear_str() {
_impl_.str_.ClearToEmpty();
}
inline const std::string& TestMessage::str() const {
// @@protoc_insertion_point(field_get:WhisperCom.Protobuf.TestMessage.str)
return _internal_str();
}
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void TestMessage::set_str(Arg_&& arg,
Args_... args) {
;
_impl_.str_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WhisperCom.Protobuf.TestMessage.str)
}
inline std::string* TestMessage::mutable_str() {
std::string* _s = _internal_mutable_str();
// @@protoc_insertion_point(field_mutable:WhisperCom.Protobuf.TestMessage.str)
return _s;
}
inline const std::string& TestMessage::_internal_str() const {
return _impl_.str_.Get();
}
inline void TestMessage::_internal_set_str(const std::string& value) {
;
_impl_.str_.Set(value, GetArenaForAllocation());
}
inline std::string* TestMessage::_internal_mutable_str() {
;
return _impl_.str_.Mutable( GetArenaForAllocation());
}
inline std::string* TestMessage::release_str() {
// @@protoc_insertion_point(field_release:WhisperCom.Protobuf.TestMessage.str)
return _impl_.str_.Release();
}
inline void TestMessage::set_allocated_str(std::string* value) {
_impl_.str_.SetAllocated(value, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.str_.IsDefault()) {
_impl_.str_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WhisperCom.Protobuf.TestMessage.str)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace Protobuf
} // namespace WhisperCom
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_TestMessage_2eproto_2epb_2eh