Start to use UberMessage protobuf

This commit is contained in:
Tyler Neely
2022-09-23 14:41:54 +00:00
parent 63871d0b03
commit d46e6e36a2
7 changed files with 2624 additions and 1180 deletions

View File

@@ -1,595 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: src/protobuf/echo_test.proto
#include "protobuf/echo_test.pb.h"
#include <algorithm>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
#include <google/protobuf/wire_format_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
namespace memgraph {
namespace protobuf {
class TestRequestDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TestRequest> _instance;
} _TestRequest_default_instance_;
class TestResponseDefaultTypeInternal {
public:
::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TestResponse> _instance;
} _TestResponse_default_instance_;
} // namespace protobuf
} // namespace memgraph
static void InitDefaultsscc_info_TestRequest_src_2fprotobuf_2fecho_5ftest_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void *ptr = &::memgraph::protobuf::_TestRequest_default_instance_;
new (ptr)::memgraph::protobuf::TestRequest();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::memgraph::protobuf::TestRequest::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TestRequest_src_2fprotobuf_2fecho_5ftest_2eproto = {
{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0,
InitDefaultsscc_info_TestRequest_src_2fprotobuf_2fecho_5ftest_2eproto},
{}};
static void InitDefaultsscc_info_TestResponse_src_2fprotobuf_2fecho_5ftest_2eproto() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void *ptr = &::memgraph::protobuf::_TestResponse_default_instance_;
new (ptr)::memgraph::protobuf::TestResponse();
::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
}
::memgraph::protobuf::TestResponse::InitAsDefaultInstance();
}
::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TestResponse_src_2fprotobuf_2fecho_5ftest_2eproto = {
{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0,
InitDefaultsscc_info_TestResponse_src_2fprotobuf_2fecho_5ftest_2eproto},
{}};
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_src_2fprotobuf_2fecho_5ftest_2eproto[2];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const *
*file_level_enum_descriptors_src_2fprotobuf_2fecho_5ftest_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const *
*file_level_service_descriptors_src_2fprotobuf_2fecho_5ftest_2eproto = nullptr;
const ::PROTOBUF_NAMESPACE_ID::uint32
TableStruct_src_2fprotobuf_2fecho_5ftest_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::memgraph::protobuf::TestRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::memgraph::protobuf::TestRequest, request_id_),
PROTOBUF_FIELD_OFFSET(::memgraph::protobuf::TestRequest, content_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::memgraph::protobuf::TestResponse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::memgraph::protobuf::TestResponse, request_id_),
PROTOBUF_FIELD_OFFSET(::memgraph::protobuf::TestResponse, content_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, sizeof(::memgraph::protobuf::TestRequest)},
{7, -1, sizeof(::memgraph::protobuf::TestResponse)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const *const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message *>(&::memgraph::protobuf::_TestRequest_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message *>(&::memgraph::protobuf::_TestResponse_default_instance_),
};
const char descriptor_table_protodef_src_2fprotobuf_2fecho_5ftest_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\034src/protobuf/echo_test.proto\022\021memgraph"
".protobuf\"2\n\013TestRequest\022\022\n\nrequest_id\030\001"
" \001(\004\022\017\n\007content\030\002 \001(\t\"3\n\014TestResponse\022\022\n"
"\nrequest_id\030\001 \001(\004\022\017\n\007content\030\002 \001(\tb\006prot"
"o3";
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
*const descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto_deps[1] = {};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase
*const descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto_sccs[2] = {
&scc_info_TestRequest_src_2fprotobuf_2fecho_5ftest_2eproto.base,
&scc_info_TestResponse_src_2fprotobuf_2fecho_5ftest_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto = {
false,
false,
descriptor_table_protodef_src_2fprotobuf_2fecho_5ftest_2eproto,
"src/protobuf/echo_test.proto",
162,
&descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto_once,
descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto_sccs,
descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto_deps,
2,
0,
schemas,
file_default_instances,
TableStruct_src_2fprotobuf_2fecho_5ftest_2eproto::offsets,
file_level_metadata_src_2fprotobuf_2fecho_5ftest_2eproto,
2,
file_level_enum_descriptors_src_2fprotobuf_2fecho_5ftest_2eproto,
file_level_service_descriptors_src_2fprotobuf_2fecho_5ftest_2eproto,
};
// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_src_2fprotobuf_2fecho_5ftest_2eproto =
(static_cast<void>(
::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto)),
true);
namespace memgraph {
namespace protobuf {
// ===================================================================
void TestRequest::InitAsDefaultInstance() {}
class TestRequest::_Internal {
public:
};
TestRequest::TestRequest(::PROTOBUF_NAMESPACE_ID::Arena *arena) : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:memgraph.protobuf.TestRequest)
}
TestRequest::TestRequest(const TestRequest &from) : ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_content().empty()) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_content(),
GetArena());
}
request_id_ = from.request_id_;
// @@protoc_insertion_point(copy_constructor:memgraph.protobuf.TestRequest)
}
void TestRequest::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TestRequest_src_2fprotobuf_2fecho_5ftest_2eproto.base);
content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
request_id_ = PROTOBUF_ULONGLONG(0);
}
TestRequest::~TestRequest() {
// @@protoc_insertion_point(destructor:memgraph.protobuf.TestRequest)
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
void TestRequest::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void TestRequest::ArenaDtor(void *object) {
TestRequest *_this = reinterpret_cast<TestRequest *>(object);
(void)_this;
}
void TestRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *) {}
void TestRequest::SetCachedSize(int size) const { _cached_size_.Set(size); }
const TestRequest &TestRequest::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TestRequest_src_2fprotobuf_2fecho_5ftest_2eproto.base);
return *internal_default_instance();
}
void TestRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:memgraph.protobuf.TestRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;
content_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
request_id_ = PROTOBUF_ULONGLONG(0);
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char *TestRequest::_InternalParse(const char *ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext *ctx) {
#define CHK_(x) \
if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
::PROTOBUF_NAMESPACE_ID::Arena *arena = GetArena();
(void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// uint64 request_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string content = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_content();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "memgraph.protobuf.TestRequest.content"));
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_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8 *TestRequest::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8 *target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream *stream) const {
// @@protoc_insertion_point(serialize_to_array_start:memgraph.protobuf.TestRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void)cached_has_bits;
// uint64 request_id = 1;
if (this->request_id() != 0) {
target = stream->EnsureSpace(target);
target =
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_request_id(), target);
}
// string content = 2;
if (this->content().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_content().data(), static_cast<int>(this->_internal_content().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "memgraph.protobuf.TestRequest.content");
target = stream->WriteStringMaybeAliased(2, this->_internal_content(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(
::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance),
target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:memgraph.protobuf.TestRequest)
return target;
}
size_t TestRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:memgraph.protobuf.TestRequest)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;
// string content = 2;
if (this->content().size() > 0) {
total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(this->_internal_content());
}
// uint64 request_id = 1;
if (this->request_id() != 0) {
total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(this->_internal_request_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void TestRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) {
// @@protoc_insertion_point(generalized_merge_from_start:memgraph.protobuf.TestRequest)
GOOGLE_DCHECK_NE(&from, this);
const TestRequest *source = ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TestRequest>(&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:memgraph.protobuf.TestRequest)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:memgraph.protobuf.TestRequest)
MergeFrom(*source);
}
}
void TestRequest::MergeFrom(const TestRequest &from) {
// @@protoc_insertion_point(class_specific_merge_from_start:memgraph.protobuf.TestRequest)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void)cached_has_bits;
if (from.content().size() > 0) {
_internal_set_content(from._internal_content());
}
if (from.request_id() != 0) {
_internal_set_request_id(from._internal_request_id());
}
}
void TestRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) {
// @@protoc_insertion_point(generalized_copy_from_start:memgraph.protobuf.TestRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TestRequest::CopyFrom(const TestRequest &from) {
// @@protoc_insertion_point(class_specific_copy_from_start:memgraph.protobuf.TestRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool TestRequest::IsInitialized() const { return true; }
void TestRequest::InternalSwap(TestRequest *other) {
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
content_.Swap(&other->content_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
swap(request_id_, other->request_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata TestRequest::GetMetadata() const { return GetMetadataStatic(); }
// ===================================================================
void TestResponse::InitAsDefaultInstance() {}
class TestResponse::_Internal {
public:
};
TestResponse::TestResponse(::PROTOBUF_NAMESPACE_ID::Arena *arena) : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:memgraph.protobuf.TestResponse)
}
TestResponse::TestResponse(const TestResponse &from) : ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_content().empty()) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_content(),
GetArena());
}
request_id_ = from.request_id_;
// @@protoc_insertion_point(copy_constructor:memgraph.protobuf.TestResponse)
}
void TestResponse::SharedCtor() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TestResponse_src_2fprotobuf_2fecho_5ftest_2eproto.base);
content_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
request_id_ = PROTOBUF_ULONGLONG(0);
}
TestResponse::~TestResponse() {
// @@protoc_insertion_point(destructor:memgraph.protobuf.TestResponse)
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
void TestResponse::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
content_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void TestResponse::ArenaDtor(void *object) {
TestResponse *_this = reinterpret_cast<TestResponse *>(object);
(void)_this;
}
void TestResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *) {}
void TestResponse::SetCachedSize(int size) const { _cached_size_.Set(size); }
const TestResponse &TestResponse::default_instance() {
::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TestResponse_src_2fprotobuf_2fecho_5ftest_2eproto.base);
return *internal_default_instance();
}
void TestResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:memgraph.protobuf.TestResponse)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;
content_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
request_id_ = PROTOBUF_ULONGLONG(0);
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char *TestResponse::_InternalParse(const char *ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext *ctx) {
#define CHK_(x) \
if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
::PROTOBUF_NAMESPACE_ID::Arena *arena = GetArena();
(void)arena;
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// uint64 request_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
request_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string content = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_content();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "memgraph.protobuf.TestResponse.content"));
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_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8 *TestResponse::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8 *target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream *stream) const {
// @@protoc_insertion_point(serialize_to_array_start:memgraph.protobuf.TestResponse)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void)cached_has_bits;
// uint64 request_id = 1;
if (this->request_id() != 0) {
target = stream->EnsureSpace(target);
target =
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_request_id(), target);
}
// string content = 2;
if (this->content().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_content().data(), static_cast<int>(this->_internal_content().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "memgraph.protobuf.TestResponse.content");
target = stream->WriteStringMaybeAliased(2, this->_internal_content(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(
::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance),
target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:memgraph.protobuf.TestResponse)
return target;
}
size_t TestResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:memgraph.protobuf.TestResponse)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;
// string content = 2;
if (this->content().size() > 0) {
total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(this->_internal_content());
}
// uint64 request_id = 1;
if (this->request_id() != 0) {
total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(this->_internal_request_id());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void TestResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) {
// @@protoc_insertion_point(generalized_merge_from_start:memgraph.protobuf.TestResponse)
GOOGLE_DCHECK_NE(&from, this);
const TestResponse *source = ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<TestResponse>(&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:memgraph.protobuf.TestResponse)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:memgraph.protobuf.TestResponse)
MergeFrom(*source);
}
}
void TestResponse::MergeFrom(const TestResponse &from) {
// @@protoc_insertion_point(class_specific_merge_from_start:memgraph.protobuf.TestResponse)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void)cached_has_bits;
if (from.content().size() > 0) {
_internal_set_content(from._internal_content());
}
if (from.request_id() != 0) {
_internal_set_request_id(from._internal_request_id());
}
}
void TestResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) {
// @@protoc_insertion_point(generalized_copy_from_start:memgraph.protobuf.TestResponse)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TestResponse::CopyFrom(const TestResponse &from) {
// @@protoc_insertion_point(class_specific_copy_from_start:memgraph.protobuf.TestResponse)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool TestResponse::IsInitialized() const { return true; }
void TestResponse::InternalSwap(TestResponse *other) {
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
content_.Swap(&other->content_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
swap(request_id_, other->request_id_);
}
::PROTOBUF_NAMESPACE_ID::Metadata TestResponse::GetMetadata() const { return GetMetadataStatic(); }
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
} // namespace memgraph
PROTOBUF_NAMESPACE_OPEN
template <>
PROTOBUF_NOINLINE ::memgraph::protobuf::TestRequest *Arena::CreateMaybeMessage<::memgraph::protobuf::TestRequest>(
Arena *arena) {
return Arena::CreateMessageInternal<::memgraph::protobuf::TestRequest>(arena);
}
template <>
PROTOBUF_NOINLINE ::memgraph::protobuf::TestResponse *Arena::CreateMaybeMessage<::memgraph::protobuf::TestResponse>(
Arena *arena) {
return Arena::CreateMessageInternal<::memgraph::protobuf::TestResponse>(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>

View File

@@ -1,563 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: src/protobuf/echo_test.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_src_2fprotobuf_2fecho_5ftest_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_src_2fprotobuf_2fecho_5ftest_2eproto
#include <limits>
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3012000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/message.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
#include <google/protobuf/port_undef.inc>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_src_2fprotobuf_2fecho_5ftest_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_src_2fprotobuf_2fecho_5ftest_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(
protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[2] 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_src_2fprotobuf_2fecho_5ftest_2eproto;
namespace memgraph {
namespace protobuf {
class TestRequest;
class TestRequestDefaultTypeInternal;
extern TestRequestDefaultTypeInternal _TestRequest_default_instance_;
class TestResponse;
class TestResponseDefaultTypeInternal;
extern TestResponseDefaultTypeInternal _TestResponse_default_instance_;
} // namespace protobuf
} // namespace memgraph
PROTOBUF_NAMESPACE_OPEN
template <>
::memgraph::protobuf::TestRequest *Arena::CreateMaybeMessage<::memgraph::protobuf::TestRequest>(Arena *);
template <>
::memgraph::protobuf::TestResponse *Arena::CreateMaybeMessage<::memgraph::protobuf::TestResponse>(Arena *);
PROTOBUF_NAMESPACE_CLOSE
namespace memgraph {
namespace protobuf {
// ===================================================================
class TestRequest PROTOBUF_FINAL
: public ::PROTOBUF_NAMESPACE_ID::
Message /* @@protoc_insertion_point(class_definition:memgraph.protobuf.TestRequest) */ {
public:
inline TestRequest() : TestRequest(nullptr){};
virtual ~TestRequest();
TestRequest(const TestRequest &from);
TestRequest(TestRequest &&from) noexcept : TestRequest() { *this = ::std::move(from); }
inline TestRequest &operator=(const TestRequest &from) {
CopyFrom(from);
return *this;
}
inline TestRequest &operator=(TestRequest &&from) noexcept {
if (GetArena() == from.GetArena()) {
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 TestRequest &default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const TestRequest *internal_default_instance() {
return reinterpret_cast<const TestRequest *>(&_TestRequest_default_instance_);
}
static constexpr int kIndexInFileMessages = 0;
friend void swap(TestRequest &a, TestRequest &b) { a.Swap(&b); }
inline void Swap(TestRequest *other) {
if (other == this) return;
if (GetArena() == other->GetArena()) {
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(TestRequest *other) {
if (other == this) return;
GOOGLE_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline TestRequest *New() const final { return CreateMaybeMessage<TestRequest>(nullptr); }
TestRequest *New(::PROTOBUF_NAMESPACE_ID::Arena *arena) const final { return CreateMaybeMessage<TestRequest>(arena); }
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) final;
void CopyFrom(const TestRequest &from);
void MergeFrom(const TestRequest &from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char *_InternalParse(const char *ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext *ctx) final;
::PROTOBUF_NAMESPACE_ID::uint8 *_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8 *target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream *stream) 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(TestRequest *other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "memgraph.protobuf.TestRequest"; }
protected:
explicit TestRequest(::PROTOBUF_NAMESPACE_ID::Arena *arena);
private:
static void ArenaDtor(void *object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *arena);
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto);
return ::descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kContentFieldNumber = 2,
kRequestIdFieldNumber = 1,
};
// string content = 2;
void clear_content();
const std::string &content() const;
void set_content(const std::string &value);
void set_content(std::string &&value);
void set_content(const char *value);
void set_content(const char *value, size_t size);
std::string *mutable_content();
std::string *release_content();
void set_allocated_content(std::string *content);
GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(
"The unsafe_arena_ accessors for"
" string fields are deprecated and will be removed in a"
" future release.")
std::string *unsafe_arena_release_content();
GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(
"The unsafe_arena_ accessors for"
" string fields are deprecated and will be removed in a"
" future release.")
void unsafe_arena_set_allocated_content(std::string *content);
private:
const std::string &_internal_content() const;
void _internal_set_content(const std::string &value);
std::string *_internal_mutable_content();
public:
// uint64 request_id = 1;
void clear_request_id();
::PROTOBUF_NAMESPACE_ID::uint64 request_id() const;
void set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value);
private:
::PROTOBUF_NAMESPACE_ID::uint64 _internal_request_id() const;
void _internal_set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value);
public:
// @@protoc_insertion_point(class_scope:memgraph.protobuf.TestRequest)
private:
class _Internal;
template <typename T>
friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_;
::PROTOBUF_NAMESPACE_ID::uint64 request_id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_src_2fprotobuf_2fecho_5ftest_2eproto;
};
// -------------------------------------------------------------------
class TestResponse PROTOBUF_FINAL
: public ::PROTOBUF_NAMESPACE_ID::
Message /* @@protoc_insertion_point(class_definition:memgraph.protobuf.TestResponse) */ {
public:
inline TestResponse() : TestResponse(nullptr){};
virtual ~TestResponse();
TestResponse(const TestResponse &from);
TestResponse(TestResponse &&from) noexcept : TestResponse() { *this = ::std::move(from); }
inline TestResponse &operator=(const TestResponse &from) {
CopyFrom(from);
return *this;
}
inline TestResponse &operator=(TestResponse &&from) noexcept {
if (GetArena() == from.GetArena()) {
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 TestResponse &default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const TestResponse *internal_default_instance() {
return reinterpret_cast<const TestResponse *>(&_TestResponse_default_instance_);
}
static constexpr int kIndexInFileMessages = 1;
friend void swap(TestResponse &a, TestResponse &b) { a.Swap(&b); }
inline void Swap(TestResponse *other) {
if (other == this) return;
if (GetArena() == other->GetArena()) {
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(TestResponse *other) {
if (other == this) return;
GOOGLE_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline TestResponse *New() const final { return CreateMaybeMessage<TestResponse>(nullptr); }
TestResponse *New(::PROTOBUF_NAMESPACE_ID::Arena *arena) const final {
return CreateMaybeMessage<TestResponse>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message &from) final;
void CopyFrom(const TestResponse &from);
void MergeFrom(const TestResponse &from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char *_InternalParse(const char *ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext *ctx) final;
::PROTOBUF_NAMESPACE_ID::uint8 *_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8 *target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream *stream) 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(TestResponse *other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "memgraph.protobuf.TestResponse"; }
protected:
explicit TestResponse(::PROTOBUF_NAMESPACE_ID::Arena *arena);
private:
static void ArenaDtor(void *object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena *arena);
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto);
return ::descriptor_table_src_2fprotobuf_2fecho_5ftest_2eproto.file_level_metadata[kIndexInFileMessages];
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kContentFieldNumber = 2,
kRequestIdFieldNumber = 1,
};
// string content = 2;
void clear_content();
const std::string &content() const;
void set_content(const std::string &value);
void set_content(std::string &&value);
void set_content(const char *value);
void set_content(const char *value, size_t size);
std::string *mutable_content();
std::string *release_content();
void set_allocated_content(std::string *content);
GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(
"The unsafe_arena_ accessors for"
" string fields are deprecated and will be removed in a"
" future release.")
std::string *unsafe_arena_release_content();
GOOGLE_PROTOBUF_RUNTIME_DEPRECATED(
"The unsafe_arena_ accessors for"
" string fields are deprecated and will be removed in a"
" future release.")
void unsafe_arena_set_allocated_content(std::string *content);
private:
const std::string &_internal_content() const;
void _internal_set_content(const std::string &value);
std::string *_internal_mutable_content();
public:
// uint64 request_id = 1;
void clear_request_id();
::PROTOBUF_NAMESPACE_ID::uint64 request_id() const;
void set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value);
private:
::PROTOBUF_NAMESPACE_ID::uint64 _internal_request_id() const;
void _internal_set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value);
public:
// @@protoc_insertion_point(class_scope:memgraph.protobuf.TestResponse)
private:
class _Internal;
template <typename T>
friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr content_;
::PROTOBUF_NAMESPACE_ID::uint64 request_id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_src_2fprotobuf_2fecho_5ftest_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// TestRequest
// uint64 request_id = 1;
inline void TestRequest::clear_request_id() { request_id_ = PROTOBUF_ULONGLONG(0); }
inline ::PROTOBUF_NAMESPACE_ID::uint64 TestRequest::_internal_request_id() const { return request_id_; }
inline ::PROTOBUF_NAMESPACE_ID::uint64 TestRequest::request_id() const {
// @@protoc_insertion_point(field_get:memgraph.protobuf.TestRequest.request_id)
return _internal_request_id();
}
inline void TestRequest::_internal_set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { request_id_ = value; }
inline void TestRequest::set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value) {
_internal_set_request_id(value);
// @@protoc_insertion_point(field_set:memgraph.protobuf.TestRequest.request_id)
}
// string content = 2;
inline void TestRequest::clear_content() {
content_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline const std::string &TestRequest::content() const {
// @@protoc_insertion_point(field_get:memgraph.protobuf.TestRequest.content)
return _internal_content();
}
inline void TestRequest::set_content(const std::string &value) {
_internal_set_content(value);
// @@protoc_insertion_point(field_set:memgraph.protobuf.TestRequest.content)
}
inline std::string *TestRequest::mutable_content() {
// @@protoc_insertion_point(field_mutable:memgraph.protobuf.TestRequest.content)
return _internal_mutable_content();
}
inline const std::string &TestRequest::_internal_content() const { return content_.Get(); }
inline void TestRequest::_internal_set_content(const std::string &value) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena());
}
inline void TestRequest::set_content(std::string &&value) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:memgraph.protobuf.TestRequest.content)
}
inline void TestRequest::set_content(const char *value) {
GOOGLE_DCHECK(value != nullptr);
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:memgraph.protobuf.TestRequest.content)
}
inline void TestRequest::set_content(const char *value, size_t size) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char *>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:memgraph.protobuf.TestRequest.content)
}
inline std::string *TestRequest::_internal_mutable_content() {
return content_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline std::string *TestRequest::release_content() {
// @@protoc_insertion_point(field_release:memgraph.protobuf.TestRequest.content)
return content_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void TestRequest::set_allocated_content(std::string *content) {
if (content != nullptr) {
} else {
}
content_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content, GetArena());
// @@protoc_insertion_point(field_set_allocated:memgraph.protobuf.TestRequest.content)
}
inline std::string *TestRequest::unsafe_arena_release_content() {
// @@protoc_insertion_point(field_unsafe_arena_release:memgraph.protobuf.TestRequest.content)
GOOGLE_DCHECK(GetArena() != nullptr);
return content_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void TestRequest::unsafe_arena_set_allocated_content(std::string *content) {
GOOGLE_DCHECK(GetArena() != nullptr);
if (content != nullptr) {
} else {
}
content_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content,
GetArena());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:memgraph.protobuf.TestRequest.content)
}
// -------------------------------------------------------------------
// TestResponse
// uint64 request_id = 1;
inline void TestResponse::clear_request_id() { request_id_ = PROTOBUF_ULONGLONG(0); }
inline ::PROTOBUF_NAMESPACE_ID::uint64 TestResponse::_internal_request_id() const { return request_id_; }
inline ::PROTOBUF_NAMESPACE_ID::uint64 TestResponse::request_id() const {
// @@protoc_insertion_point(field_get:memgraph.protobuf.TestResponse.request_id)
return _internal_request_id();
}
inline void TestResponse::_internal_set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { request_id_ = value; }
inline void TestResponse::set_request_id(::PROTOBUF_NAMESPACE_ID::uint64 value) {
_internal_set_request_id(value);
// @@protoc_insertion_point(field_set:memgraph.protobuf.TestResponse.request_id)
}
// string content = 2;
inline void TestResponse::clear_content() {
content_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline const std::string &TestResponse::content() const {
// @@protoc_insertion_point(field_get:memgraph.protobuf.TestResponse.content)
return _internal_content();
}
inline void TestResponse::set_content(const std::string &value) {
_internal_set_content(value);
// @@protoc_insertion_point(field_set:memgraph.protobuf.TestResponse.content)
}
inline std::string *TestResponse::mutable_content() {
// @@protoc_insertion_point(field_mutable:memgraph.protobuf.TestResponse.content)
return _internal_mutable_content();
}
inline const std::string &TestResponse::_internal_content() const { return content_.Get(); }
inline void TestResponse::_internal_set_content(const std::string &value) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena());
}
inline void TestResponse::set_content(std::string &&value) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:memgraph.protobuf.TestResponse.content)
}
inline void TestResponse::set_content(const char *value) {
GOOGLE_DCHECK(value != nullptr);
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:memgraph.protobuf.TestResponse.content)
}
inline void TestResponse::set_content(const char *value, size_t size) {
content_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char *>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:memgraph.protobuf.TestResponse.content)
}
inline std::string *TestResponse::_internal_mutable_content() {
return content_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline std::string *TestResponse::release_content() {
// @@protoc_insertion_point(field_release:memgraph.protobuf.TestResponse.content)
return content_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void TestResponse::set_allocated_content(std::string *content) {
if (content != nullptr) {
} else {
}
content_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content, GetArena());
// @@protoc_insertion_point(field_set_allocated:memgraph.protobuf.TestResponse.content)
}
inline std::string *TestResponse::unsafe_arena_release_content() {
// @@protoc_insertion_point(field_unsafe_arena_release:memgraph.protobuf.TestResponse.content)
GOOGLE_DCHECK(GetArena() != nullptr);
return content_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void TestResponse::unsafe_arena_set_allocated_content(std::string *content) {
GOOGLE_DCHECK(GetArena() != nullptr);
if (content != nullptr) {
} else {
}
content_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), content,
GetArena());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:memgraph.protobuf.TestResponse.content)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
} // namespace memgraph
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_src_2fprotobuf_2fecho_5ftest_2eproto

View File

@@ -1,19 +0,0 @@
syntax = "proto3";
package memgraph.protobuf;
message TestRequest {
// option optimize_for = LITE_RUNTIME;
// option cc_enable_arenas = true;
uint64 request_id = 1;
string content = 2;
}
message TestResponse {
// option optimize_for = LITE_RUNTIME;
// option cc_enable_arenas = true;
uint64 request_id = 1;
string content = 2;
}

1268
src/protobuf/messages.pb.cc Normal file

File diff suppressed because it is too large Load Diff

1322
src/protobuf/messages.pb.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
syntax = "proto3";
package memgraph.protobuf;
message Address {
bytes unique_id = 1;
// this is either 4 bytes for ipv4 or 16 bytes for ipv6
bytes last_known_ip = 2;
uint32 last_known_port = 3;
}
message TestRequest {
uint64 request_id = 1;
string content = 2;
}
message Content {
oneof content {
TestRequest test_request = 1;
}
}
message UberMessage {
uint64 request_id = 1;
Address to_address = 2;
Address from_address = 3;
Content content = 4;
}

View File

@@ -17,13 +17,15 @@
#include <gtest/gtest.h>
#include "io/protobuf_transport/protobuf_transport.hpp"
#include "protobuf/echo_test.pb.cc"
#include "protobuf/echo_test.pb.h"
#include "protobuf/messages.pb.cc"
#include "protobuf/messages.pb.h"
namespace memgraph::io::tests {
using memgraph::protobuf::Address;
using memgraph::protobuf::Content;
using memgraph::protobuf::TestRequest;
using memgraph::protobuf::TestResponse;
using memgraph::protobuf::UberMessage;
TEST(ProtobufTransport, Echo) {
spdlog::error("ayo");