UPDATE: change to submodule for protobuf and zmq libs

This commit is contained in:
Henry Winkel
2023-11-07 10:22:14 +01:00
parent 36bd28620d
commit e41cbd8a82
3414 changed files with 2325 additions and 1038133 deletions

17
.gitmodules vendored
View File

@@ -1,8 +1,9 @@
[submodule "libs/protobuf/third_party/googletest"]
path = libs/protobuf/third_party/googletest
url = https://github.com/google/googletest.git
ignore = dirty
[submodule "libs/protobuf/third_party/benchmark"]
path = libs/protobuf/third_party/benchmark
url = https://github.com/google/benchmark.git
[submodule "protobuf"]
path = libs/protobuf
url = https://github.com/protocolbuffers/protobuf.git
[submodule "libs/libzmq"]
path = libs/libzmq
url = https://github.com/zeromq/libzmq.git
[submodule "libs/cppzmq"]
path = libs/cppzmq
url = https://github.com/zeromq/cppzmq.git

View File

@@ -25,11 +25,13 @@ IF(NOT TARGET cppzmq)
ENDIF()
IF(NOT TARGET protobuf)
set(ABSL_PROPAGATE_CXX_STD ON CACHE INTERNAL "")
set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "")
set(protobuf_BUILD_EXAMPLES OFF CACHE INTERNAL "")
add_subdirectory(libs/protobuf )
include(protobuf)
ENDIF()
protobuf_generate_cpp(PROTO_PATH include/WHISPER/Messages/Protos/ CPP_PATH include/WHISPER/Messages/Protos HPP_PATH include/WHISPER/Messages/Protos)

View File

@@ -4,274 +4,300 @@
#include "join.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/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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace messages {
namespace join {
PROTOBUF_CONSTEXPR Join::Join(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.srcaddress_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.port_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
inline constexpr Join::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: srcaddress_(
&::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()),
port_{0u},
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR Join::Join(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct JoinDefaultTypeInternal {
PROTOBUF_CONSTEXPR JoinDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR JoinDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~JoinDefaultTypeInternal() {}
union {
Join _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 JoinDefaultTypeInternal _Join_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 JoinDefaultTypeInternal _Join_default_instance_;
} // namespace join
} // namespace messages
static ::_pb::Metadata file_level_metadata_join_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_join_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_join_2eproto = nullptr;
const uint32_t TableStruct_join_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_join_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_join_2eproto = nullptr;
const ::uint32_t
TableStruct_join_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::messages::join::Join, _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(::messages::join::Join, _impl_.port_),
PROTOBUF_FIELD_OFFSET(::messages::join::Join, _impl_.srcaddress_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::messages::join::Join)},
static const ::_pbi::MigrationSchema
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::messages::join::Join)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::messages::join::_Join_default_instance_._instance,
};
const char descriptor_table_protodef_join_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
const char descriptor_table_protodef_join_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
"\n\njoin.proto\022\rmessages.join\"(\n\004Join\022\014\n\004p"
"ort\030\001 \001(\r\022\022\n\nsrcAddress\030\002 \001(\tb\006proto3"
;
static ::_pbi::once_flag descriptor_table_join_2eproto_once;
};
static ::absl::once_flag descriptor_table_join_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_join_2eproto = {
false, false, 77, descriptor_table_protodef_join_2eproto,
false,
false,
77,
descriptor_table_protodef_join_2eproto,
"join.proto",
&descriptor_table_join_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_join_2eproto::offsets,
file_level_metadata_join_2eproto, file_level_enum_descriptors_join_2eproto,
&descriptor_table_join_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_join_2eproto::offsets,
file_level_metadata_join_2eproto,
file_level_enum_descriptors_join_2eproto,
file_level_service_descriptors_join_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_join_2eproto_getter() {
return &descriptor_table_join_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_join_2eproto(&descriptor_table_join_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_join_2eproto(&descriptor_table_join_2eproto);
namespace messages {
namespace join {
// ===================================================================
class Join::_Internal {
public:
};
Join::Join(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
Join::Join(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:messages.join.Join)
}
Join::Join(const Join& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
Join* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.srcaddress_){}
, decltype(_impl_.port_){}
, /*decltype(_impl_._cached_size_)*/{}};
inline PROTOBUF_NDEBUG_INLINE Join::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from)
: srcaddress_(arena, from.srcaddress_),
_cached_size_{0} {}
Join::Join(
::google::protobuf::Arena* arena,
const Join& from)
: ::google::protobuf::Message(arena) {
Join* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
_impl_.port_ = from._impl_.port_;
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.srcaddress_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.srcaddress_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_srcaddress().empty()) {
_this->_impl_.srcaddress_.Set(from._internal_srcaddress(),
_this->GetArenaForAllocation());
}
_this->_impl_.port_ = from._impl_.port_;
// @@protoc_insertion_point(copy_constructor:messages.join.Join)
}
inline PROTOBUF_NDEBUG_INLINE Join::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: srcaddress_(arena),
_cached_size_{0} {}
inline void Join::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.srcaddress_){}
, decltype(_impl_.port_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.srcaddress_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.srcaddress_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void Join::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.port_ = {};
}
Join::~Join() {
// @@protoc_insertion_point(destructor:messages.join.Join)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void Join::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
ABSL_DCHECK(GetArena() == nullptr);
_impl_.srcaddress_.Destroy();
_impl_.~Impl_();
}
void Join::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
const ::google::protobuf::MessageLite::ClassData*
Join::GetClassData() const {
PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite::ClassData
_data_ = {
Join::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
&::google::protobuf::Message::kDescriptorMethods,
PROTOBUF_FIELD_OFFSET(Join, _impl_._cached_size_),
};
return &_data_;
}
void Join::Clear() {
PROTOBUF_NOINLINE void Join::Clear() {
// @@protoc_insertion_point(message_clear_start:messages.join.Join)
uint32_t cached_has_bits = 0;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.srcaddress_.ClearToEmpty();
_impl_.port_ = 0u;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* Join::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint32 port = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string srcAddress = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_srcaddress();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "messages.join.Join.srcAddress"));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
const char* Join::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Join::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 0, 37, 2> Join::_table_ = {
{
0, // no _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
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
&_Join_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// string srcAddress = 2;
{::_pbi::TcParser::FastUS1,
{18, 63, 0, PROTOBUF_FIELD_OFFSET(Join, _impl_.srcaddress_)}},
// uint32 port = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Join, _impl_.port_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(Join, _impl_.port_)}},
}}, {{
65535, 65535
}}, {{
// uint32 port = 1;
{PROTOBUF_FIELD_OFFSET(Join, _impl_.port_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
// string srcAddress = 2;
{PROTOBUF_FIELD_OFFSET(Join, _impl_.srcaddress_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
}},
// no aux_entries
{{
"\22\0\12\0\0\0\0\0"
"messages.join.Join"
"srcAddress"
}},
};
::uint8_t* Join::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:messages.join.Join)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint32 port = 1;
if (this->_internal_port() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_port(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
1, this->_internal_port(), target);
}
// string srcAddress = 2;
if (!this->_internal_srcaddress().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_srcaddress().data(), static_cast<int>(this->_internal_srcaddress().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"messages.join.Join.srcAddress");
target = stream->WriteStringMaybeAliased(
2, this->_internal_srcaddress(), target);
const std::string& _s = this->_internal_srcaddress();
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "messages.join.Join.srcAddress");
target = stream->WriteStringMaybeAliased(2, _s, target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
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:messages.join.Join)
return target;
}
size_t Join::ByteSizeLong() const {
::size_t Join::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:messages.join.Join)
size_t total_size = 0;
::size_t total_size = 0;
uint32_t cached_has_bits = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string srcAddress = 2;
if (!this->_internal_srcaddress().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this->_internal_srcaddress());
}
// uint32 port = 1;
if (this->_internal_port() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_port());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_port());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Join::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
Join::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Join::GetClassData() const { return &_class_data_; }
void Join::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
void Join::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<Join*>(&to_msg);
auto& from = static_cast<const Join&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:messages.join.Join)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_srcaddress().empty()) {
@@ -280,7 +306,7 @@ void Join::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_
if (from._internal_port() != 0) {
_this->_internal_set_port(from._internal_port());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void Join::CopyFrom(const Join& from) {
@@ -290,37 +316,30 @@ void Join::CopyFrom(const Join& from) {
MergeFrom(from);
}
bool Join::IsInitialized() const {
PROTOBUF_NOINLINE bool Join::IsInitialized() const {
return true;
}
void Join::InternalSwap(Join* other) {
void Join::InternalSwap(Join* PROTOBUF_RESTRICT other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
auto* arena = GetArena();
ABSL_DCHECK_EQ(arena, other->GetArena());
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.srcaddress_, lhs_arena,
&other->_impl_.srcaddress_, rhs_arena
);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.srcaddress_, &other->_impl_.srcaddress_, arena);
swap(_impl_.port_, other->_impl_.port_);
}
::PROTOBUF_NAMESPACE_ID::Metadata Join::GetMetadata() const {
::google::protobuf::Metadata Join::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_join_2eproto_getter, &descriptor_table_join_2eproto_once,
file_level_metadata_join_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace join
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::messages::join::Join*
Arena::CreateMaybeMessage< ::messages::join::Join >(Arena* arena) {
return Arena::CreateMessageInternal< ::messages::join::Join >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#include "google/protobuf/port_undef.inc"

View File

@@ -1,49 +1,60 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: join.proto
// Protobuf C++ Version: 4.24.0-main
#ifndef GOOGLE_PROTOBUF_INCLUDED_join_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_join_2eproto
#ifndef GOOGLE_PROTOBUF_INCLUDED_join_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_join_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4025000
#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
#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_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>
#if 4025000 < 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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_join_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_join_2eproto {
static const uint32_t offsets[];
static const ::uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_join_2eproto;
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_join_2eproto;
namespace messages {
namespace join {
class Join;
@@ -51,22 +62,29 @@ struct JoinDefaultTypeInternal;
extern JoinDefaultTypeInternal _Join_default_instance_;
} // namespace join
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::join::Join* Arena::CreateMaybeMessage<::messages::join::Join>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
namespace messages {
namespace join {
// ===================================================================
// -------------------------------------------------------------------
class Join final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.join.Join) */ {
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:messages.join.Join) */ {
public:
inline Join() : Join(nullptr) {}
~Join() override;
explicit PROTOBUF_CONSTEXPR Join(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
template<typename = void>
explicit PROTOBUF_CONSTEXPR Join(::google::protobuf::internal::ConstantInitialized);
Join(const Join& from);
inline Join(const Join& from)
: Join(nullptr, from) {}
Join(Join&& from) noexcept
: Join() {
*this = ::std::move(from);
@@ -78,9 +96,9 @@ class Join final :
}
inline Join& operator=(Join&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
@@ -90,13 +108,22 @@ class Join final :
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const Join& default_instance() {
@@ -115,65 +142,62 @@ class Join final :
inline void Swap(Join* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Join* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Join* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
Join* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Join>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const Join& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const Join& from) {
Join::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
::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 { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Join* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "messages.join.Join";
}
protected:
explicit Join(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
explicit Join(::google::protobuf::Arena* arena);
Join(::google::protobuf::Arena* arena, const Join& from);
const ::google::protobuf::MessageLite::ClassData* GetClassData() const final;
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -184,134 +208,166 @@ class Join final :
kPortFieldNumber = 1,
};
// string srcAddress = 2;
void clear_srcaddress();
void clear_srcaddress() ;
const std::string& srcaddress() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_srcaddress(ArgT0&& arg0, ArgT... args);
template <typename Arg_ = const std::string&, typename... Args_>
void set_srcaddress(Arg_&& arg, Args_... args);
std::string* mutable_srcaddress();
PROTOBUF_NODISCARD std::string* release_srcaddress();
void set_allocated_srcaddress(std::string* srcaddress);
void set_allocated_srcaddress(std::string* value);
private:
const std::string& _internal_srcaddress() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_srcaddress(const std::string& value);
inline PROTOBUF_ALWAYS_INLINE void _internal_set_srcaddress(
const std::string& value);
std::string* _internal_mutable_srcaddress();
public:
public:
// uint32 port = 1;
void clear_port();
uint32_t port() const;
void set_port(uint32_t value);
private:
uint32_t _internal_port() const;
void _internal_set_port(uint32_t value);
public:
void clear_port() ;
::uint32_t port() const;
void set_port(::uint32_t value);
private:
::uint32_t _internal_port() const;
void _internal_set_port(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.join.Join)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
1, 2, 0,
37, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr srcaddress_;
uint32_t port_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::google::protobuf::internal::ArenaStringPtr srcaddress_;
::uint32_t port_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_join_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Join
// uint32 port = 1;
inline void Join::clear_port() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.port_ = 0u;
}
inline uint32_t Join::_internal_port() const {
return _impl_.port_;
}
inline uint32_t Join::port() const {
inline ::uint32_t Join::port() const {
// @@protoc_insertion_point(field_get:messages.join.Join.port)
return _internal_port();
}
inline void Join::_internal_set_port(uint32_t value) {
_impl_.port_ = value;
}
inline void Join::set_port(uint32_t value) {
inline void Join::set_port(::uint32_t value) {
_internal_set_port(value);
// @@protoc_insertion_point(field_set:messages.join.Join.port)
}
inline ::uint32_t Join::_internal_port() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.port_;
}
inline void Join::_internal_set_port(::uint32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.port_ = value;
}
// string srcAddress = 2;
inline void Join::clear_srcaddress() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.srcaddress_.ClearToEmpty();
}
inline const std::string& Join::srcaddress() const {
inline const std::string& Join::srcaddress() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:messages.join.Join.srcAddress)
return _internal_srcaddress();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void Join::set_srcaddress(ArgT0&& arg0, ArgT... args) {
_impl_.srcaddress_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void Join::set_srcaddress(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.srcaddress_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
// @@protoc_insertion_point(field_set:messages.join.Join.srcAddress)
}
inline std::string* Join::mutable_srcaddress() {
inline std::string* Join::mutable_srcaddress() ABSL_ATTRIBUTE_LIFETIME_BOUND {
std::string* _s = _internal_mutable_srcaddress();
// @@protoc_insertion_point(field_mutable:messages.join.Join.srcAddress)
return _s;
}
inline const std::string& Join::_internal_srcaddress() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.srcaddress_.Get();
}
inline void Join::_internal_set_srcaddress(const std::string& value) {
_impl_.srcaddress_.Set(value, GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.srcaddress_.Set(value, GetArena());
}
inline std::string* Join::_internal_mutable_srcaddress() {
return _impl_.srcaddress_.Mutable(GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
return _impl_.srcaddress_.Mutable( GetArena());
}
inline std::string* Join::release_srcaddress() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:messages.join.Join.srcAddress)
return _impl_.srcaddress_.Release();
}
inline void Join::set_allocated_srcaddress(std::string* srcaddress) {
if (srcaddress != nullptr) {
} else {
}
_impl_.srcaddress_.SetAllocated(srcaddress, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void Join::set_allocated_srcaddress(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.srcaddress_.SetAllocated(value, GetArena());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.srcaddress_.IsDefault()) {
_impl_.srcaddress_.Set("", GetArenaForAllocation());
_impl_.srcaddress_.Set("", GetArena());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:messages.join.Join.srcAddress)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace join
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_join_2eproto
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_join_2eproto_2epb_2eh

View File

@@ -4,274 +4,300 @@
#include "leave.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/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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace messages {
namespace leave {
PROTOBUF_CONSTEXPR Leave::Leave(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.srcaddress_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.port_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
inline constexpr Leave::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: srcaddress_(
&::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()),
port_{0u},
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR Leave::Leave(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct LeaveDefaultTypeInternal {
PROTOBUF_CONSTEXPR LeaveDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR LeaveDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~LeaveDefaultTypeInternal() {}
union {
Leave _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LeaveDefaultTypeInternal _Leave_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LeaveDefaultTypeInternal _Leave_default_instance_;
} // namespace leave
} // namespace messages
static ::_pb::Metadata file_level_metadata_leave_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_leave_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_leave_2eproto = nullptr;
const uint32_t TableStruct_leave_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_leave_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_leave_2eproto = nullptr;
const ::uint32_t
TableStruct_leave_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::messages::leave::Leave, _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(::messages::leave::Leave, _impl_.port_),
PROTOBUF_FIELD_OFFSET(::messages::leave::Leave, _impl_.srcaddress_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::messages::leave::Leave)},
static const ::_pbi::MigrationSchema
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::messages::leave::Leave)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::messages::leave::_Leave_default_instance_._instance,
};
const char descriptor_table_protodef_leave_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
const char descriptor_table_protodef_leave_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
"\n\013leave.proto\022\016messages.leave\")\n\005Leave\022\014"
"\n\004port\030\001 \001(\r\022\022\n\nsrcAddress\030\002 \001(\tb\006proto3"
;
static ::_pbi::once_flag descriptor_table_leave_2eproto_once;
};
static ::absl::once_flag descriptor_table_leave_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_leave_2eproto = {
false, false, 80, descriptor_table_protodef_leave_2eproto,
false,
false,
80,
descriptor_table_protodef_leave_2eproto,
"leave.proto",
&descriptor_table_leave_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_leave_2eproto::offsets,
file_level_metadata_leave_2eproto, file_level_enum_descriptors_leave_2eproto,
&descriptor_table_leave_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_leave_2eproto::offsets,
file_level_metadata_leave_2eproto,
file_level_enum_descriptors_leave_2eproto,
file_level_service_descriptors_leave_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_leave_2eproto_getter() {
return &descriptor_table_leave_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_leave_2eproto(&descriptor_table_leave_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_leave_2eproto(&descriptor_table_leave_2eproto);
namespace messages {
namespace leave {
// ===================================================================
class Leave::_Internal {
public:
};
Leave::Leave(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
Leave::Leave(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:messages.leave.Leave)
}
Leave::Leave(const Leave& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
Leave* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.srcaddress_){}
, decltype(_impl_.port_){}
, /*decltype(_impl_._cached_size_)*/{}};
inline PROTOBUF_NDEBUG_INLINE Leave::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from)
: srcaddress_(arena, from.srcaddress_),
_cached_size_{0} {}
Leave::Leave(
::google::protobuf::Arena* arena,
const Leave& from)
: ::google::protobuf::Message(arena) {
Leave* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
_impl_.port_ = from._impl_.port_;
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.srcaddress_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.srcaddress_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_srcaddress().empty()) {
_this->_impl_.srcaddress_.Set(from._internal_srcaddress(),
_this->GetArenaForAllocation());
}
_this->_impl_.port_ = from._impl_.port_;
// @@protoc_insertion_point(copy_constructor:messages.leave.Leave)
}
inline PROTOBUF_NDEBUG_INLINE Leave::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: srcaddress_(arena),
_cached_size_{0} {}
inline void Leave::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.srcaddress_){}
, decltype(_impl_.port_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.srcaddress_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.srcaddress_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void Leave::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.port_ = {};
}
Leave::~Leave() {
// @@protoc_insertion_point(destructor:messages.leave.Leave)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void Leave::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
ABSL_DCHECK(GetArena() == nullptr);
_impl_.srcaddress_.Destroy();
_impl_.~Impl_();
}
void Leave::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
const ::google::protobuf::MessageLite::ClassData*
Leave::GetClassData() const {
PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite::ClassData
_data_ = {
Leave::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
&::google::protobuf::Message::kDescriptorMethods,
PROTOBUF_FIELD_OFFSET(Leave, _impl_._cached_size_),
};
return &_data_;
}
void Leave::Clear() {
PROTOBUF_NOINLINE void Leave::Clear() {
// @@protoc_insertion_point(message_clear_start:messages.leave.Leave)
uint32_t cached_has_bits = 0;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.srcaddress_.ClearToEmpty();
_impl_.port_ = 0u;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* Leave::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint32 port = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string srcAddress = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
auto str = _internal_mutable_srcaddress();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "messages.leave.Leave.srcAddress"));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
const char* Leave::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Leave::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 0, 39, 2> Leave::_table_ = {
{
0, // no _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
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
&_Leave_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// string srcAddress = 2;
{::_pbi::TcParser::FastUS1,
{18, 63, 0, PROTOBUF_FIELD_OFFSET(Leave, _impl_.srcaddress_)}},
// uint32 port = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Leave, _impl_.port_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(Leave, _impl_.port_)}},
}}, {{
65535, 65535
}}, {{
// uint32 port = 1;
{PROTOBUF_FIELD_OFFSET(Leave, _impl_.port_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
// string srcAddress = 2;
{PROTOBUF_FIELD_OFFSET(Leave, _impl_.srcaddress_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
}},
// no aux_entries
{{
"\24\0\12\0\0\0\0\0"
"messages.leave.Leave"
"srcAddress"
}},
};
::uint8_t* Leave::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:messages.leave.Leave)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint32 port = 1;
if (this->_internal_port() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_port(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
1, this->_internal_port(), target);
}
// string srcAddress = 2;
if (!this->_internal_srcaddress().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_srcaddress().data(), static_cast<int>(this->_internal_srcaddress().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"messages.leave.Leave.srcAddress");
target = stream->WriteStringMaybeAliased(
2, this->_internal_srcaddress(), target);
const std::string& _s = this->_internal_srcaddress();
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "messages.leave.Leave.srcAddress");
target = stream->WriteStringMaybeAliased(2, _s, target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
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:messages.leave.Leave)
return target;
}
size_t Leave::ByteSizeLong() const {
::size_t Leave::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:messages.leave.Leave)
size_t total_size = 0;
::size_t total_size = 0;
uint32_t cached_has_bits = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string srcAddress = 2;
if (!this->_internal_srcaddress().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this->_internal_srcaddress());
}
// uint32 port = 1;
if (this->_internal_port() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_port());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_port());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Leave::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
Leave::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Leave::GetClassData() const { return &_class_data_; }
void Leave::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
void Leave::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<Leave*>(&to_msg);
auto& from = static_cast<const Leave&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:messages.leave.Leave)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_srcaddress().empty()) {
@@ -280,7 +306,7 @@ void Leave::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF
if (from._internal_port() != 0) {
_this->_internal_set_port(from._internal_port());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void Leave::CopyFrom(const Leave& from) {
@@ -290,37 +316,30 @@ void Leave::CopyFrom(const Leave& from) {
MergeFrom(from);
}
bool Leave::IsInitialized() const {
PROTOBUF_NOINLINE bool Leave::IsInitialized() const {
return true;
}
void Leave::InternalSwap(Leave* other) {
void Leave::InternalSwap(Leave* PROTOBUF_RESTRICT other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
auto* arena = GetArena();
ABSL_DCHECK_EQ(arena, other->GetArena());
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.srcaddress_, lhs_arena,
&other->_impl_.srcaddress_, rhs_arena
);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.srcaddress_, &other->_impl_.srcaddress_, arena);
swap(_impl_.port_, other->_impl_.port_);
}
::PROTOBUF_NAMESPACE_ID::Metadata Leave::GetMetadata() const {
::google::protobuf::Metadata Leave::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_leave_2eproto_getter, &descriptor_table_leave_2eproto_once,
file_level_metadata_leave_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace leave
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::messages::leave::Leave*
Arena::CreateMaybeMessage< ::messages::leave::Leave >(Arena* arena) {
return Arena::CreateMessageInternal< ::messages::leave::Leave >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#include "google/protobuf/port_undef.inc"

View File

@@ -1,49 +1,60 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: leave.proto
// Protobuf C++ Version: 4.24.0-main
#ifndef GOOGLE_PROTOBUF_INCLUDED_leave_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_leave_2eproto
#ifndef GOOGLE_PROTOBUF_INCLUDED_leave_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_leave_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4025000
#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
#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_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>
#if 4025000 < 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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_leave_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_leave_2eproto {
static const uint32_t offsets[];
static const ::uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_leave_2eproto;
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_leave_2eproto;
namespace messages {
namespace leave {
class Leave;
@@ -51,22 +62,29 @@ struct LeaveDefaultTypeInternal;
extern LeaveDefaultTypeInternal _Leave_default_instance_;
} // namespace leave
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::leave::Leave* Arena::CreateMaybeMessage<::messages::leave::Leave>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
namespace messages {
namespace leave {
// ===================================================================
// -------------------------------------------------------------------
class Leave final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.leave.Leave) */ {
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:messages.leave.Leave) */ {
public:
inline Leave() : Leave(nullptr) {}
~Leave() override;
explicit PROTOBUF_CONSTEXPR Leave(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
template<typename = void>
explicit PROTOBUF_CONSTEXPR Leave(::google::protobuf::internal::ConstantInitialized);
Leave(const Leave& from);
inline Leave(const Leave& from)
: Leave(nullptr, from) {}
Leave(Leave&& from) noexcept
: Leave() {
*this = ::std::move(from);
@@ -78,9 +96,9 @@ class Leave final :
}
inline Leave& operator=(Leave&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
@@ -90,13 +108,22 @@ class Leave final :
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const Leave& default_instance() {
@@ -115,65 +142,62 @@ class Leave final :
inline void Swap(Leave* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Leave* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Leave* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
Leave* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Leave>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const Leave& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const Leave& from) {
Leave::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
::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 { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Leave* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "messages.leave.Leave";
}
protected:
explicit Leave(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
explicit Leave(::google::protobuf::Arena* arena);
Leave(::google::protobuf::Arena* arena, const Leave& from);
const ::google::protobuf::MessageLite::ClassData* GetClassData() const final;
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -184,134 +208,166 @@ class Leave final :
kPortFieldNumber = 1,
};
// string srcAddress = 2;
void clear_srcaddress();
void clear_srcaddress() ;
const std::string& srcaddress() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_srcaddress(ArgT0&& arg0, ArgT... args);
template <typename Arg_ = const std::string&, typename... Args_>
void set_srcaddress(Arg_&& arg, Args_... args);
std::string* mutable_srcaddress();
PROTOBUF_NODISCARD std::string* release_srcaddress();
void set_allocated_srcaddress(std::string* srcaddress);
void set_allocated_srcaddress(std::string* value);
private:
const std::string& _internal_srcaddress() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_srcaddress(const std::string& value);
inline PROTOBUF_ALWAYS_INLINE void _internal_set_srcaddress(
const std::string& value);
std::string* _internal_mutable_srcaddress();
public:
public:
// uint32 port = 1;
void clear_port();
uint32_t port() const;
void set_port(uint32_t value);
private:
uint32_t _internal_port() const;
void _internal_set_port(uint32_t value);
public:
void clear_port() ;
::uint32_t port() const;
void set_port(::uint32_t value);
private:
::uint32_t _internal_port() const;
void _internal_set_port(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.leave.Leave)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
1, 2, 0,
39, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr srcaddress_;
uint32_t port_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::google::protobuf::internal::ArenaStringPtr srcaddress_;
::uint32_t port_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_leave_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Leave
// uint32 port = 1;
inline void Leave::clear_port() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.port_ = 0u;
}
inline uint32_t Leave::_internal_port() const {
return _impl_.port_;
}
inline uint32_t Leave::port() const {
inline ::uint32_t Leave::port() const {
// @@protoc_insertion_point(field_get:messages.leave.Leave.port)
return _internal_port();
}
inline void Leave::_internal_set_port(uint32_t value) {
_impl_.port_ = value;
}
inline void Leave::set_port(uint32_t value) {
inline void Leave::set_port(::uint32_t value) {
_internal_set_port(value);
// @@protoc_insertion_point(field_set:messages.leave.Leave.port)
}
inline ::uint32_t Leave::_internal_port() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.port_;
}
inline void Leave::_internal_set_port(::uint32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.port_ = value;
}
// string srcAddress = 2;
inline void Leave::clear_srcaddress() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.srcaddress_.ClearToEmpty();
}
inline const std::string& Leave::srcaddress() const {
inline const std::string& Leave::srcaddress() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:messages.leave.Leave.srcAddress)
return _internal_srcaddress();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void Leave::set_srcaddress(ArgT0&& arg0, ArgT... args) {
_impl_.srcaddress_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void Leave::set_srcaddress(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.srcaddress_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
// @@protoc_insertion_point(field_set:messages.leave.Leave.srcAddress)
}
inline std::string* Leave::mutable_srcaddress() {
inline std::string* Leave::mutable_srcaddress() ABSL_ATTRIBUTE_LIFETIME_BOUND {
std::string* _s = _internal_mutable_srcaddress();
// @@protoc_insertion_point(field_mutable:messages.leave.Leave.srcAddress)
return _s;
}
inline const std::string& Leave::_internal_srcaddress() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.srcaddress_.Get();
}
inline void Leave::_internal_set_srcaddress(const std::string& value) {
_impl_.srcaddress_.Set(value, GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.srcaddress_.Set(value, GetArena());
}
inline std::string* Leave::_internal_mutable_srcaddress() {
return _impl_.srcaddress_.Mutable(GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
return _impl_.srcaddress_.Mutable( GetArena());
}
inline std::string* Leave::release_srcaddress() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:messages.leave.Leave.srcAddress)
return _impl_.srcaddress_.Release();
}
inline void Leave::set_allocated_srcaddress(std::string* srcaddress) {
if (srcaddress != nullptr) {
} else {
}
_impl_.srcaddress_.SetAllocated(srcaddress, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void Leave::set_allocated_srcaddress(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.srcaddress_.SetAllocated(value, GetArena());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.srcaddress_.IsDefault()) {
_impl_.srcaddress_.Set("", GetArenaForAllocation());
_impl_.srcaddress_.Set("", GetArena());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:messages.leave.Leave.srcAddress)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace leave
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_leave_2eproto
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_leave_2eproto_2epb_2eh

View File

@@ -4,359 +4,406 @@
#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/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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace messages {
namespace header {
PROTOBUF_CONSTEXPR Message::Message(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.senderuuid_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_.payload_)*/nullptr
, /*decltype(_impl_.topic_)*/0u
, /*decltype(_impl_.msgtype_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
inline constexpr Message::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: _cached_size_{0},
senderuuid_(
&::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()),
payload_{nullptr},
topic_{0u},
msgtype_{0u} {}
template <typename>
PROTOBUF_CONSTEXPR Message::Message(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct MessageDefaultTypeInternal {
PROTOBUF_CONSTEXPR MessageDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR MessageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~MessageDefaultTypeInternal() {}
union {
Message _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageDefaultTypeInternal _Message_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MessageDefaultTypeInternal _Message_default_instance_;
} // namespace header
} // namespace messages
static ::_pb::Metadata file_level_metadata_message_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_message_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_message_2eproto = nullptr;
const uint32_t TableStruct_message_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
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[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::messages::header::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(::messages::header::Message, _impl_.topic_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.msgtype_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.senderuuid_),
PROTOBUF_FIELD_OFFSET(::messages::header::Message, _impl_.payload_),
~0u,
~0u,
~0u,
0,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::messages::header::Message)},
static const ::_pbi::MigrationSchema
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, 12, -1, sizeof(::messages::header::Message)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::messages::header::_Message_default_instance_._instance,
};
const char descriptor_table_protodef_message_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
const char descriptor_table_protodef_message_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
"\n\rmessage.proto\022\017messages.header\032\031google"
"/protobuf/any.proto\"d\n\007Message\022\r\n\005topic\030"
"\001 \001(\r\022\017\n\007msgType\030\002 \001(\r\022\022\n\nsenderUUID\030\003 \001"
"(\t\022%\n\007payload\030\005 \001(\0132\024.google.protobuf.An"
"yb\006proto3"
;
static const ::_pbi::DescriptorTable* const descriptor_table_message_2eproto_deps[1] = {
};
static const ::_pbi::DescriptorTable* const descriptor_table_message_2eproto_deps[1] =
{
&::descriptor_table_google_2fprotobuf_2fany_2eproto,
};
static ::_pbi::once_flag descriptor_table_message_2eproto_once;
static ::absl::once_flag descriptor_table_message_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_message_2eproto = {
false, false, 169, descriptor_table_protodef_message_2eproto,
false,
false,
169,
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,
&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);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_message_2eproto(&descriptor_table_message_2eproto);
namespace messages {
namespace header {
// ===================================================================
class Message::_Internal {
public:
static const ::PROTOBUF_NAMESPACE_ID::Any& payload(const Message* msg);
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 ::PROTOBUF_NAMESPACE_ID::Any&
Message::_Internal::payload(const Message* msg) {
const ::google::protobuf::Any& Message::_Internal::payload(const Message* msg) {
return *msg->_impl_.payload_;
}
void Message::clear_payload() {
if (GetArenaForAllocation() == nullptr && _impl_.payload_ != nullptr) {
delete _impl_.payload_;
}
_impl_.payload_ = nullptr;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (_impl_.payload_ != nullptr) _impl_.payload_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
}
Message::Message(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
Message::Message(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:messages.header.Message)
}
Message::Message(const Message& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
Message* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.senderuuid_){}
, decltype(_impl_.payload_){nullptr}
, decltype(_impl_.topic_){}
, decltype(_impl_.msgtype_){}
, /*decltype(_impl_._cached_size_)*/{}};
inline PROTOBUF_NDEBUG_INLINE Message::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from)
: _has_bits_{from._has_bits_},
_cached_size_{0},
senderuuid_(arena, from.senderuuid_) {}
Message::Message(
::google::protobuf::Arena* arena,
const Message& from)
: ::google::protobuf::Message(arena) {
Message* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
::uint32_t cached_has_bits = _impl_._has_bits_[0];
_impl_.payload_ = (cached_has_bits & 0x00000001u)
? CreateMaybeMessage<::google::protobuf::Any>(arena, *from._impl_.payload_)
: nullptr;
::memcpy(reinterpret_cast<char *>(&_impl_) +
offsetof(Impl_, topic_),
reinterpret_cast<const char *>(&from._impl_) +
offsetof(Impl_, topic_),
offsetof(Impl_, msgtype_) -
offsetof(Impl_, topic_) +
sizeof(Impl_::msgtype_));
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.senderuuid_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.senderuuid_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_senderuuid().empty()) {
_this->_impl_.senderuuid_.Set(from._internal_senderuuid(),
_this->GetArenaForAllocation());
}
if (from._internal_has_payload()) {
_this->_impl_.payload_ = new ::PROTOBUF_NAMESPACE_ID::Any(*from._impl_.payload_);
}
::memcpy(&_impl_.topic_, &from._impl_.topic_,
static_cast<size_t>(reinterpret_cast<char*>(&_impl_.msgtype_) -
reinterpret_cast<char*>(&_impl_.topic_)) + sizeof(_impl_.msgtype_));
// @@protoc_insertion_point(copy_constructor:messages.header.Message)
}
inline PROTOBUF_NDEBUG_INLINE Message::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: _cached_size_{0},
senderuuid_(arena) {}
inline void Message::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.senderuuid_){}
, decltype(_impl_.payload_){nullptr}
, decltype(_impl_.topic_){0u}
, decltype(_impl_.msgtype_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.senderuuid_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.senderuuid_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void Message::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
::memset(reinterpret_cast<char *>(&_impl_) +
offsetof(Impl_, payload_),
0,
offsetof(Impl_, msgtype_) -
offsetof(Impl_, payload_) +
sizeof(Impl_::msgtype_));
}
Message::~Message() {
// @@protoc_insertion_point(destructor:messages.header.Message)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void Message::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
ABSL_DCHECK(GetArena() == nullptr);
_impl_.senderuuid_.Destroy();
if (this != internal_default_instance()) delete _impl_.payload_;
delete _impl_.payload_;
_impl_.~Impl_();
}
void Message::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
const ::google::protobuf::MessageLite::ClassData*
Message::GetClassData() const {
PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite::ClassData
_data_ = {
Message::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
&::google::protobuf::Message::kDescriptorMethods,
PROTOBUF_FIELD_OFFSET(Message, _impl_._cached_size_),
};
return &_data_;
}
void Message::Clear() {
PROTOBUF_NOINLINE void Message::Clear() {
// @@protoc_insertion_point(message_clear_start:messages.header.Message)
uint32_t cached_has_bits = 0;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.senderuuid_.ClearToEmpty();
if (GetArenaForAllocation() == nullptr && _impl_.payload_ != nullptr) {
delete _impl_.payload_;
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
ABSL_DCHECK(_impl_.payload_ != nullptr);
_impl_.payload_->Clear();
}
_impl_.payload_ = nullptr;
::memset(&_impl_.topic_, 0, static_cast<size_t>(
::memset(&_impl_.topic_, 0, static_cast<::size_t>(
reinterpret_cast<char*>(&_impl_.msgtype_) -
reinterpret_cast<char*>(&_impl_.topic_)) + sizeof(_impl_.msgtype_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* Message::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint32 topic = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.topic_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// uint32 msgType = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
_impl_.msgtype_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// string senderUUID = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
auto str = _internal_mutable_senderuuid();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "messages.header.Message.senderUUID"));
} else
goto handle_unusual;
continue;
// .google.protobuf.Any payload = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
ptr = ctx->ParseMessage(_internal_mutable_payload(), ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
const char* Message::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Message::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<3, 4, 1, 42, 2> Message::_table_ = {
{
PROTOBUF_FIELD_OFFSET(Message, _impl_._has_bits_),
0, // no _extensions_
5, 56, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967272, // skipmap
offsetof(decltype(_table_), field_entries),
4, // num_field_entries
1, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
&_Message_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
{::_pbi::TcParser::MiniParse, {}},
// uint32 topic = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Message, _impl_.topic_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(Message, _impl_.topic_)}},
// uint32 msgType = 2;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Message, _impl_.msgtype_), 63>(),
{16, 63, 0, PROTOBUF_FIELD_OFFSET(Message, _impl_.msgtype_)}},
// string senderUUID = 3;
{::_pbi::TcParser::FastUS1,
{26, 63, 0, PROTOBUF_FIELD_OFFSET(Message, _impl_.senderuuid_)}},
{::_pbi::TcParser::MiniParse, {}},
// .google.protobuf.Any payload = 5;
{::_pbi::TcParser::FastMtS1,
{42, 0, 0, PROTOBUF_FIELD_OFFSET(Message, _impl_.payload_)}},
{::_pbi::TcParser::MiniParse, {}},
{::_pbi::TcParser::MiniParse, {}},
}}, {{
65535, 65535
}}, {{
// uint32 topic = 1;
{PROTOBUF_FIELD_OFFSET(Message, _impl_.topic_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
// uint32 msgType = 2;
{PROTOBUF_FIELD_OFFSET(Message, _impl_.msgtype_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
// string senderUUID = 3;
{PROTOBUF_FIELD_OFFSET(Message, _impl_.senderuuid_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
// .google.protobuf.Any payload = 5;
{PROTOBUF_FIELD_OFFSET(Message, _impl_.payload_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
}}, {{
{::_pbi::TcParser::GetTable<::google::protobuf::Any>()},
}}, {{
"\27\0\0\12\0\0\0\0"
"messages.header.Message"
"senderUUID"
}},
};
::uint8_t* Message::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:messages.header.Message)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint32 topic = 1;
if (this->_internal_topic() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_topic(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
1, this->_internal_topic(), target);
}
// uint32 msgType = 2;
if (this->_internal_msgtype() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_msgtype(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
2, this->_internal_msgtype(), target);
}
// string senderUUID = 3;
if (!this->_internal_senderuuid().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_senderuuid().data(), static_cast<int>(this->_internal_senderuuid().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"messages.header.Message.senderUUID");
target = stream->WriteStringMaybeAliased(
3, this->_internal_senderuuid(), target);
const std::string& _s = this->_internal_senderuuid();
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "messages.header.Message.senderUUID");
target = stream->WriteStringMaybeAliased(3, _s, target);
}
cached_has_bits = _impl_._has_bits_[0];
// .google.protobuf.Any payload = 5;
if (this->_internal_has_payload()) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
InternalWriteMessage(5, _Internal::payload(this),
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
5, _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<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
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:messages.header.Message)
return target;
}
size_t Message::ByteSizeLong() const {
::size_t Message::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:messages.header.Message)
size_t total_size = 0;
::size_t total_size = 0;
uint32_t cached_has_bits = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string senderUUID = 3;
if (!this->_internal_senderuuid().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this->_internal_senderuuid());
}
// .google.protobuf.Any payload = 5;
if (this->_internal_has_payload()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
*_impl_.payload_);
cached_has_bits = _impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
total_size +=
1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.payload_);
}
// uint32 topic = 1;
if (this->_internal_topic() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_topic());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_topic());
}
// uint32 msgType = 2;
if (this->_internal_msgtype() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_msgtype());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_msgtype());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Message::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
Message::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Message::GetClassData() const { return &_class_data_; }
void Message::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
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:messages.header.Message)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_senderuuid().empty()) {
_this->_internal_set_senderuuid(from._internal_senderuuid());
}
if (from._internal_has_payload()) {
_this->_internal_mutable_payload()->::PROTOBUF_NAMESPACE_ID::Any::MergeFrom(
if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_internal_mutable_payload()->::google::protobuf::Any::MergeFrom(
from._internal_payload());
}
if (from._internal_topic() != 0) {
@@ -365,7 +412,7 @@ void Message::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOB
if (from._internal_msgtype() != 0) {
_this->_internal_set_msgtype(from._internal_msgtype());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void Message::CopyFrom(const Message& from) {
@@ -375,20 +422,18 @@ void Message::CopyFrom(const Message& from) {
MergeFrom(from);
}
bool Message::IsInitialized() const {
PROTOBUF_NOINLINE bool Message::IsInitialized() const {
return true;
}
void Message::InternalSwap(Message* other) {
void Message::InternalSwap(Message* PROTOBUF_RESTRICT other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
auto* arena = GetArena();
ABSL_DCHECK_EQ(arena, other->GetArena());
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.senderuuid_, lhs_arena,
&other->_impl_.senderuuid_, rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.senderuuid_, &other->_impl_.senderuuid_, arena);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(Message, _impl_.msgtype_)
+ sizeof(Message::_impl_.msgtype_)
- PROTOBUF_FIELD_OFFSET(Message, _impl_.payload_)>(
@@ -396,21 +441,17 @@ void Message::InternalSwap(Message* other) {
reinterpret_cast<char*>(&other->_impl_.payload_));
}
::PROTOBUF_NAMESPACE_ID::Metadata Message::GetMetadata() const {
::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 header
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::messages::header::Message*
Arena::CreateMaybeMessage< ::messages::header::Message >(Arena* arena) {
return Arena::CreateMessageInternal< ::messages::header::Message >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#include "google/protobuf/port_undef.inc"

View File

@@ -1,50 +1,61 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: message.proto
// Protobuf C++ Version: 4.24.0-main
#ifndef GOOGLE_PROTOBUF_INCLUDED_message_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_message_2eproto
#ifndef GOOGLE_PROTOBUF_INCLUDED_message_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_message_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4025000
#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
#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_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>
#if 4025000 < 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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_message_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_message_2eproto {
static const uint32_t offsets[];
static const ::uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_message_2eproto;
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_message_2eproto;
namespace messages {
namespace header {
class Message;
@@ -52,22 +63,29 @@ struct MessageDefaultTypeInternal;
extern MessageDefaultTypeInternal _Message_default_instance_;
} // namespace header
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::header::Message* Arena::CreateMaybeMessage<::messages::header::Message>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
namespace messages {
namespace header {
// ===================================================================
// -------------------------------------------------------------------
class Message final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.header.Message) */ {
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:messages.header.Message) */ {
public:
inline Message() : Message(nullptr) {}
~Message() override;
explicit PROTOBUF_CONSTEXPR Message(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
template<typename = void>
explicit PROTOBUF_CONSTEXPR Message(::google::protobuf::internal::ConstantInitialized);
Message(const Message& from);
inline Message(const Message& from)
: Message(nullptr, from) {}
Message(Message&& from) noexcept
: Message() {
*this = ::std::move(from);
@@ -79,9 +97,9 @@ class Message final :
}
inline Message& operator=(Message&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
@@ -91,13 +109,22 @@ class Message final :
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const Message& default_instance() {
@@ -116,65 +143,62 @@ class Message final :
inline void Swap(Message* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Message* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Message* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
Message* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Message>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const Message& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const Message& from) {
Message::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
::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 { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Message* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "messages.header.Message";
}
protected:
explicit Message(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
explicit Message(::google::protobuf::Arena* arena);
Message(::google::protobuf::Arena* arena, const Message& from);
const ::google::protobuf::MessageLite::ClassData* GetClassData() const final;
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -187,268 +211,308 @@ class Message final :
kMsgTypeFieldNumber = 2,
};
// string senderUUID = 3;
void clear_senderuuid();
void clear_senderuuid() ;
const std::string& senderuuid() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_senderuuid(ArgT0&& arg0, ArgT... args);
template <typename Arg_ = const std::string&, typename... Args_>
void set_senderuuid(Arg_&& arg, Args_... args);
std::string* mutable_senderuuid();
PROTOBUF_NODISCARD std::string* release_senderuuid();
void set_allocated_senderuuid(std::string* senderuuid);
void set_allocated_senderuuid(std::string* value);
private:
const std::string& _internal_senderuuid() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_senderuuid(const std::string& value);
inline PROTOBUF_ALWAYS_INLINE void _internal_set_senderuuid(
const std::string& value);
std::string* _internal_mutable_senderuuid();
public:
public:
// .google.protobuf.Any payload = 5;
bool has_payload() const;
private:
bool _internal_has_payload() const;
public:
void clear_payload();
const ::PROTOBUF_NAMESPACE_ID::Any& payload() const;
PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::Any* release_payload();
::PROTOBUF_NAMESPACE_ID::Any* mutable_payload();
void set_allocated_payload(::PROTOBUF_NAMESPACE_ID::Any* payload);
private:
const ::PROTOBUF_NAMESPACE_ID::Any& _internal_payload() const;
::PROTOBUF_NAMESPACE_ID::Any* _internal_mutable_payload();
public:
void unsafe_arena_set_allocated_payload(
::PROTOBUF_NAMESPACE_ID::Any* payload);
::PROTOBUF_NAMESPACE_ID::Any* unsafe_arena_release_payload();
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 topic = 1;
void clear_topic();
uint32_t topic() const;
void set_topic(uint32_t value);
private:
uint32_t _internal_topic() const;
void _internal_set_topic(uint32_t value);
public:
void clear_topic() ;
::uint32_t topic() const;
void set_topic(::uint32_t value);
private:
::uint32_t _internal_topic() const;
void _internal_set_topic(::uint32_t value);
public:
// uint32 msgType = 2;
void clear_msgtype();
uint32_t msgtype() const;
void set_msgtype(uint32_t value);
private:
uint32_t _internal_msgtype() const;
void _internal_set_msgtype(uint32_t value);
public:
void clear_msgtype() ;
::uint32_t msgtype() const;
void set_msgtype(::uint32_t value);
private:
::uint32_t _internal_msgtype() const;
void _internal_set_msgtype(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.header.Message)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
3, 4, 1,
42, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr senderuuid_;
::PROTOBUF_NAMESPACE_ID::Any* payload_;
uint32_t topic_;
uint32_t msgtype_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr senderuuid_;
::google::protobuf::Any* payload_;
::uint32_t topic_;
::uint32_t msgtype_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_message_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Message
// uint32 topic = 1;
inline void Message::clear_topic() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.topic_ = 0u;
}
inline uint32_t Message::_internal_topic() const {
return _impl_.topic_;
}
inline uint32_t Message::topic() const {
inline ::uint32_t Message::topic() const {
// @@protoc_insertion_point(field_get:messages.header.Message.topic)
return _internal_topic();
}
inline void Message::_internal_set_topic(uint32_t value) {
_impl_.topic_ = value;
}
inline void Message::set_topic(uint32_t value) {
inline void Message::set_topic(::uint32_t value) {
_internal_set_topic(value);
// @@protoc_insertion_point(field_set:messages.header.Message.topic)
}
inline ::uint32_t Message::_internal_topic() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.topic_;
}
inline void Message::_internal_set_topic(::uint32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.topic_ = value;
}
// uint32 msgType = 2;
inline void Message::clear_msgtype() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.msgtype_ = 0u;
}
inline uint32_t Message::_internal_msgtype() const {
return _impl_.msgtype_;
}
inline uint32_t Message::msgtype() const {
inline ::uint32_t Message::msgtype() const {
// @@protoc_insertion_point(field_get:messages.header.Message.msgType)
return _internal_msgtype();
}
inline void Message::_internal_set_msgtype(uint32_t value) {
_impl_.msgtype_ = value;
}
inline void Message::set_msgtype(uint32_t value) {
inline void Message::set_msgtype(::uint32_t value) {
_internal_set_msgtype(value);
// @@protoc_insertion_point(field_set:messages.header.Message.msgType)
}
inline ::uint32_t Message::_internal_msgtype() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.msgtype_;
}
inline void Message::_internal_set_msgtype(::uint32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.msgtype_ = value;
}
// string senderUUID = 3;
inline void Message::clear_senderuuid() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.senderuuid_.ClearToEmpty();
}
inline const std::string& Message::senderuuid() const {
inline const std::string& Message::senderuuid() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:messages.header.Message.senderUUID)
return _internal_senderuuid();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void Message::set_senderuuid(ArgT0&& arg0, ArgT... args) {
_impl_.senderuuid_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void Message::set_senderuuid(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.senderuuid_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
// @@protoc_insertion_point(field_set:messages.header.Message.senderUUID)
}
inline std::string* Message::mutable_senderuuid() {
inline std::string* Message::mutable_senderuuid() ABSL_ATTRIBUTE_LIFETIME_BOUND {
std::string* _s = _internal_mutable_senderuuid();
// @@protoc_insertion_point(field_mutable:messages.header.Message.senderUUID)
return _s;
}
inline const std::string& Message::_internal_senderuuid() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.senderuuid_.Get();
}
inline void Message::_internal_set_senderuuid(const std::string& value) {
_impl_.senderuuid_.Set(value, GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.senderuuid_.Set(value, GetArena());
}
inline std::string* Message::_internal_mutable_senderuuid() {
return _impl_.senderuuid_.Mutable(GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
return _impl_.senderuuid_.Mutable( GetArena());
}
inline std::string* Message::release_senderuuid() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:messages.header.Message.senderUUID)
return _impl_.senderuuid_.Release();
}
inline void Message::set_allocated_senderuuid(std::string* senderuuid) {
if (senderuuid != nullptr) {
} else {
}
_impl_.senderuuid_.SetAllocated(senderuuid, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void Message::set_allocated_senderuuid(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.senderuuid_.SetAllocated(value, GetArena());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.senderuuid_.IsDefault()) {
_impl_.senderuuid_.Set("", GetArenaForAllocation());
_impl_.senderuuid_.Set("", GetArena());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:messages.header.Message.senderUUID)
}
// .google.protobuf.Any payload = 5;
inline bool Message::_internal_has_payload() const {
return this != internal_default_instance() && _impl_.payload_ != nullptr;
}
inline bool Message::has_payload() const {
return _internal_has_payload();
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
PROTOBUF_ASSUME(!value || _impl_.payload_ != nullptr);
return value;
}
inline const ::PROTOBUF_NAMESPACE_ID::Any& Message::_internal_payload() const {
const ::PROTOBUF_NAMESPACE_ID::Any* p = _impl_.payload_;
return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Any&>(
::PROTOBUF_NAMESPACE_ID::_Any_default_instance_);
inline const ::google::protobuf::Any& Message::_internal_payload() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
const ::google::protobuf::Any* p = _impl_.payload_;
return p != nullptr ? *p : reinterpret_cast<const ::google::protobuf::Any&>(::google::protobuf::_Any_default_instance_);
}
inline const ::PROTOBUF_NAMESPACE_ID::Any& Message::payload() const {
inline const ::google::protobuf::Any& Message::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:messages.header.Message.payload)
return _internal_payload();
}
inline void Message::unsafe_arena_set_allocated_payload(
::PROTOBUF_NAMESPACE_ID::Any* payload) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.payload_);
inline void Message::unsafe_arena_set_allocated_payload(::google::protobuf::Any* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (GetArena() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.payload_);
}
_impl_.payload_ = payload;
if (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:messages.header.Message.payload)
}
inline ::PROTOBUF_NAMESPACE_ID::Any* Message::release_payload() {
inline ::google::protobuf::Any* Message::release_payload() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::PROTOBUF_NAMESPACE_ID::Any* temp = _impl_.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<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArenaForAllocation() == nullptr) { delete old; }
auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released);
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
if (GetArena() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArena() != nullptr) {
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
return released;
}
inline ::PROTOBUF_NAMESPACE_ID::Any* Message::unsafe_arena_release_payload() {
inline ::google::protobuf::Any* Message::unsafe_arena_release_payload() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:messages.header.Message.payload)
::PROTOBUF_NAMESPACE_ID::Any* temp = _impl_.payload_;
_impl_._has_bits_[0] &= ~0x00000001u;
::google::protobuf::Any* temp = _impl_.payload_;
_impl_.payload_ = nullptr;
return temp;
}
inline ::PROTOBUF_NAMESPACE_ID::Any* Message::_internal_mutable_payload() {
inline ::google::protobuf::Any* Message::_internal_mutable_payload() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
if (_impl_.payload_ == nullptr) {
auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Any>(GetArenaForAllocation());
_impl_.payload_ = p;
auto* p = CreateMaybeMessage<::google::protobuf::Any>(GetArena());
_impl_.payload_ = reinterpret_cast<::google::protobuf::Any*>(p);
}
return _impl_.payload_;
}
inline ::PROTOBUF_NAMESPACE_ID::Any* Message::mutable_payload() {
::PROTOBUF_NAMESPACE_ID::Any* _msg = _internal_mutable_payload();
inline ::google::protobuf::Any* Message::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND {
::google::protobuf::Any* _msg = _internal_mutable_payload();
// @@protoc_insertion_point(field_mutable:messages.header.Message.payload)
return _msg;
}
inline void Message::set_allocated_payload(::PROTOBUF_NAMESPACE_ID::Any* payload) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
inline void Message::set_allocated_payload(::google::protobuf::Any* value) {
::google::protobuf::Arena* message_arena = GetArena();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.payload_);
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.payload_);
}
if (payload) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(payload));
if (value != nullptr) {
::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::MessageLite*>(value)->GetArena();
if (message_arena != submessage_arena) {
payload = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, payload, 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_ = payload;
_impl_.payload_ = reinterpret_cast<::google::protobuf::Any*>(value);
// @@protoc_insertion_point(field_set_allocated:messages.header.Message.payload)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace header
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_message_2eproto
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_message_2eproto_2epb_2eh

View File

@@ -4,235 +4,262 @@
#include "ping.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/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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace messages {
namespace ping {
PROTOBUF_CONSTEXPR Ping::Ping(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.port_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
inline constexpr Ping::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: port_{0u},
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR Ping::Ping(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct PingDefaultTypeInternal {
PROTOBUF_CONSTEXPR PingDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR PingDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~PingDefaultTypeInternal() {}
union {
Ping _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PingDefaultTypeInternal _Ping_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PingDefaultTypeInternal _Ping_default_instance_;
} // namespace ping
} // namespace messages
static ::_pb::Metadata file_level_metadata_ping_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_ping_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_ping_2eproto = nullptr;
const uint32_t TableStruct_ping_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_ping_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_ping_2eproto = nullptr;
const ::uint32_t
TableStruct_ping_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::messages::ping::Ping, _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(::messages::ping::Ping, _impl_.port_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::messages::ping::Ping)},
static const ::_pbi::MigrationSchema
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::messages::ping::Ping)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::messages::ping::_Ping_default_instance_._instance,
};
const char descriptor_table_protodef_ping_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
const char descriptor_table_protodef_ping_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
"\n\nping.proto\022\rmessages.ping\"\024\n\004Ping\022\014\n\004p"
"ort\030\002 \001(\rb\006proto3"
;
static ::_pbi::once_flag descriptor_table_ping_2eproto_once;
};
static ::absl::once_flag descriptor_table_ping_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_ping_2eproto = {
false, false, 57, descriptor_table_protodef_ping_2eproto,
false,
false,
57,
descriptor_table_protodef_ping_2eproto,
"ping.proto",
&descriptor_table_ping_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_ping_2eproto::offsets,
file_level_metadata_ping_2eproto, file_level_enum_descriptors_ping_2eproto,
&descriptor_table_ping_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_ping_2eproto::offsets,
file_level_metadata_ping_2eproto,
file_level_enum_descriptors_ping_2eproto,
file_level_service_descriptors_ping_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_ping_2eproto_getter() {
return &descriptor_table_ping_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_ping_2eproto(&descriptor_table_ping_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_ping_2eproto(&descriptor_table_ping_2eproto);
namespace messages {
namespace ping {
// ===================================================================
class Ping::_Internal {
public:
};
Ping::Ping(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
Ping::Ping(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:messages.ping.Ping)
}
Ping::Ping(const Ping& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
Ping* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.port_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.port_ = from._impl_.port_;
// @@protoc_insertion_point(copy_constructor:messages.ping.Ping)
Ping::Ping(
::google::protobuf::Arena* arena, const Ping& from)
: Ping(arena) {
MergeFrom(from);
}
inline PROTOBUF_NDEBUG_INLINE Ping::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: _cached_size_{0} {}
inline void Ping::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.port_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
inline void Ping::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.port_ = {};
}
Ping::~Ping() {
// @@protoc_insertion_point(destructor:messages.ping.Ping)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void Ping::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
ABSL_DCHECK(GetArena() == nullptr);
_impl_.~Impl_();
}
void Ping::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
const ::google::protobuf::MessageLite::ClassData*
Ping::GetClassData() const {
PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite::ClassData
_data_ = {
Ping::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
&::google::protobuf::Message::kDescriptorMethods,
PROTOBUF_FIELD_OFFSET(Ping, _impl_._cached_size_),
};
return &_data_;
}
void Ping::Clear() {
PROTOBUF_NOINLINE void Ping::Clear() {
// @@protoc_insertion_point(message_clear_start:messages.ping.Ping)
uint32_t cached_has_bits = 0;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.port_ = 0u;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* Ping::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint32 port = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
_impl_.port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
const char* Ping::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Ping::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<0, 1, 0, 0, 2> Ping::_table_ = {
{
0, // no _has_bits_
0, // no _extensions_
2, 0, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967293, // skipmap
offsetof(decltype(_table_), field_entries),
1, // num_field_entries
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
&_Ping_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// uint32 port = 2;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Ping, _impl_.port_), 63>(),
{16, 63, 0, PROTOBUF_FIELD_OFFSET(Ping, _impl_.port_)}},
}}, {{
65535, 65535
}}, {{
// uint32 port = 2;
{PROTOBUF_FIELD_OFFSET(Ping, _impl_.port_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
}},
// no aux_entries
{{
}},
};
::uint8_t* Ping::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:messages.ping.Ping)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint32 port = 2;
if (this->_internal_port() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_port(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
2, this->_internal_port(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
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:messages.ping.Ping)
return target;
}
size_t Ping::ByteSizeLong() const {
::size_t Ping::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:messages.ping.Ping)
size_t total_size = 0;
::size_t total_size = 0;
uint32_t cached_has_bits = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// uint32 port = 2;
if (this->_internal_port() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_port());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_port());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Ping::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
Ping::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Ping::GetClassData() const { return &_class_data_; }
void Ping::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
void Ping::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<Ping*>(&to_msg);
auto& from = static_cast<const Ping&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:messages.ping.Ping)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_port() != 0) {
_this->_internal_set_port(from._internal_port());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void Ping::CopyFrom(const Ping& from) {
@@ -242,31 +269,27 @@ void Ping::CopyFrom(const Ping& from) {
MergeFrom(from);
}
bool Ping::IsInitialized() const {
PROTOBUF_NOINLINE bool Ping::IsInitialized() const {
return true;
}
void Ping::InternalSwap(Ping* other) {
void Ping::InternalSwap(Ping* PROTOBUF_RESTRICT other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.port_, other->_impl_.port_);
}
::PROTOBUF_NAMESPACE_ID::Metadata Ping::GetMetadata() const {
::google::protobuf::Metadata Ping::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_ping_2eproto_getter, &descriptor_table_ping_2eproto_once,
file_level_metadata_ping_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace ping
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::messages::ping::Ping*
Arena::CreateMaybeMessage< ::messages::ping::Ping >(Arena* arena) {
return Arena::CreateMessageInternal< ::messages::ping::Ping >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#include "google/protobuf/port_undef.inc"

View File

@@ -1,49 +1,60 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ping.proto
// Protobuf C++ Version: 4.24.0-main
#ifndef GOOGLE_PROTOBUF_INCLUDED_ping_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_ping_2eproto
#ifndef GOOGLE_PROTOBUF_INCLUDED_ping_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_ping_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4025000
#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
#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_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>
#if 4025000 < 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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_ping_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_ping_2eproto {
static const uint32_t offsets[];
static const ::uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ping_2eproto;
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_ping_2eproto;
namespace messages {
namespace ping {
class Ping;
@@ -51,22 +62,29 @@ struct PingDefaultTypeInternal;
extern PingDefaultTypeInternal _Ping_default_instance_;
} // namespace ping
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::ping::Ping* Arena::CreateMaybeMessage<::messages::ping::Ping>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
namespace messages {
namespace ping {
// ===================================================================
// -------------------------------------------------------------------
class Ping final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.ping.Ping) */ {
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:messages.ping.Ping) */ {
public:
inline Ping() : Ping(nullptr) {}
~Ping() override;
explicit PROTOBUF_CONSTEXPR Ping(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
template<typename = void>
explicit PROTOBUF_CONSTEXPR Ping(::google::protobuf::internal::ConstantInitialized);
Ping(const Ping& from);
inline Ping(const Ping& from)
: Ping(nullptr, from) {}
Ping(Ping&& from) noexcept
: Ping() {
*this = ::std::move(from);
@@ -78,9 +96,9 @@ class Ping final :
}
inline Ping& operator=(Ping&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
@@ -90,13 +108,22 @@ class Ping final :
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const Ping& default_instance() {
@@ -115,65 +142,62 @@ class Ping final :
inline void Swap(Ping* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Ping* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Ping* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
Ping* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Ping>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const Ping& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const Ping& from) {
Ping::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
::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 { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Ping* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "messages.ping.Ping";
}
protected:
explicit Ping(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
explicit Ping(::google::protobuf::Arena* arena);
Ping(::google::protobuf::Arena* arena, const Ping& from);
const ::google::protobuf::MessageLite::ClassData* GetClassData() const final;
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -183,69 +207,96 @@ class Ping final :
kPortFieldNumber = 2,
};
// uint32 port = 2;
void clear_port();
uint32_t port() const;
void set_port(uint32_t value);
private:
uint32_t _internal_port() const;
void _internal_set_port(uint32_t value);
public:
void clear_port() ;
::uint32_t port() const;
void set_port(::uint32_t value);
private:
::uint32_t _internal_port() const;
void _internal_set_port(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.ping.Ping)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
0, 1, 0,
0, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
uint32_t port_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::uint32_t port_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_ping_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Ping
// uint32 port = 2;
inline void Ping::clear_port() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.port_ = 0u;
}
inline uint32_t Ping::_internal_port() const {
return _impl_.port_;
}
inline uint32_t Ping::port() const {
inline ::uint32_t Ping::port() const {
// @@protoc_insertion_point(field_get:messages.ping.Ping.port)
return _internal_port();
}
inline void Ping::_internal_set_port(uint32_t value) {
_impl_.port_ = value;
}
inline void Ping::set_port(uint32_t value) {
inline void Ping::set_port(::uint32_t value) {
_internal_set_port(value);
// @@protoc_insertion_point(field_set:messages.ping.Ping.port)
}
inline ::uint32_t Ping::_internal_port() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.port_;
}
inline void Ping::_internal_set_port(::uint32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.port_ = value;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace ping
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_ping_2eproto
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_ping_2eproto_2epb_2eh

View File

@@ -4,235 +4,262 @@
#include "pong.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/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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace messages {
namespace pong {
PROTOBUF_CONSTEXPR Pong::Pong(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.port_)*/0u
, /*decltype(_impl_._cached_size_)*/{}} {}
inline constexpr Pong::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: port_{0u},
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR Pong::Pong(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct PongDefaultTypeInternal {
PROTOBUF_CONSTEXPR PongDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR PongDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~PongDefaultTypeInternal() {}
union {
Pong _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PongDefaultTypeInternal _Pong_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PongDefaultTypeInternal _Pong_default_instance_;
} // namespace pong
} // namespace messages
static ::_pb::Metadata file_level_metadata_pong_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_pong_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_pong_2eproto = nullptr;
const uint32_t TableStruct_pong_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_pong_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_pong_2eproto = nullptr;
const ::uint32_t
TableStruct_pong_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::messages::pong::Pong, _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(::messages::pong::Pong, _impl_.port_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::messages::pong::Pong)},
static const ::_pbi::MigrationSchema
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::messages::pong::Pong)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::messages::pong::_Pong_default_instance_._instance,
};
const char descriptor_table_protodef_pong_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
const char descriptor_table_protodef_pong_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
"\n\npong.proto\022\rmessages.pong\"\024\n\004Pong\022\014\n\004p"
"ort\030\001 \001(\rb\006proto3"
;
static ::_pbi::once_flag descriptor_table_pong_2eproto_once;
};
static ::absl::once_flag descriptor_table_pong_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_pong_2eproto = {
false, false, 57, descriptor_table_protodef_pong_2eproto,
false,
false,
57,
descriptor_table_protodef_pong_2eproto,
"pong.proto",
&descriptor_table_pong_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_pong_2eproto::offsets,
file_level_metadata_pong_2eproto, file_level_enum_descriptors_pong_2eproto,
&descriptor_table_pong_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_pong_2eproto::offsets,
file_level_metadata_pong_2eproto,
file_level_enum_descriptors_pong_2eproto,
file_level_service_descriptors_pong_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_pong_2eproto_getter() {
return &descriptor_table_pong_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_pong_2eproto(&descriptor_table_pong_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_pong_2eproto(&descriptor_table_pong_2eproto);
namespace messages {
namespace pong {
// ===================================================================
class Pong::_Internal {
public:
};
Pong::Pong(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
Pong::Pong(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:messages.pong.Pong)
}
Pong::Pong(const Pong& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
Pong* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.port_){}
, /*decltype(_impl_._cached_size_)*/{}};
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_impl_.port_ = from._impl_.port_;
// @@protoc_insertion_point(copy_constructor:messages.pong.Pong)
Pong::Pong(
::google::protobuf::Arena* arena, const Pong& from)
: Pong(arena) {
MergeFrom(from);
}
inline PROTOBUF_NDEBUG_INLINE Pong::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: _cached_size_{0} {}
inline void Pong::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.port_){0u}
, /*decltype(_impl_._cached_size_)*/{}
};
inline void Pong::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.port_ = {};
}
Pong::~Pong() {
// @@protoc_insertion_point(destructor:messages.pong.Pong)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void Pong::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
ABSL_DCHECK(GetArena() == nullptr);
_impl_.~Impl_();
}
void Pong::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
const ::google::protobuf::MessageLite::ClassData*
Pong::GetClassData() const {
PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite::ClassData
_data_ = {
Pong::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
&::google::protobuf::Message::kDescriptorMethods,
PROTOBUF_FIELD_OFFSET(Pong, _impl_._cached_size_),
};
return &_data_;
}
void Pong::Clear() {
PROTOBUF_NOINLINE void Pong::Clear() {
// @@protoc_insertion_point(message_clear_start:messages.pong.Pong)
uint32_t cached_has_bits = 0;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.port_ = 0u;
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* Pong::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// uint32 port = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_impl_.port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
const char* Pong::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* Pong::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<0, 1, 0, 0, 2> Pong::_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
&_Pong_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// uint32 port = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Pong, _impl_.port_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(Pong, _impl_.port_)}},
}}, {{
65535, 65535
}}, {{
// uint32 port = 1;
{PROTOBUF_FIELD_OFFSET(Pong, _impl_.port_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
}},
// no aux_entries
{{
}},
};
::uint8_t* Pong::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:messages.pong.Pong)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint32 port = 1;
if (this->_internal_port() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_port(), target);
target = ::_pbi::WireFormatLite::WriteUInt32ToArray(
1, this->_internal_port(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
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:messages.pong.Pong)
return target;
}
size_t Pong::ByteSizeLong() const {
::size_t Pong::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:messages.pong.Pong)
size_t total_size = 0;
::size_t total_size = 0;
uint32_t cached_has_bits = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// uint32 port = 1;
if (this->_internal_port() != 0) {
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_port());
total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(
this->_internal_port());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Pong::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
Pong::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Pong::GetClassData() const { return &_class_data_; }
void Pong::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
void Pong::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<Pong*>(&to_msg);
auto& from = static_cast<const Pong&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:messages.pong.Pong)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_port() != 0) {
_this->_internal_set_port(from._internal_port());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void Pong::CopyFrom(const Pong& from) {
@@ -242,31 +269,27 @@ void Pong::CopyFrom(const Pong& from) {
MergeFrom(from);
}
bool Pong::IsInitialized() const {
PROTOBUF_NOINLINE bool Pong::IsInitialized() const {
return true;
}
void Pong::InternalSwap(Pong* other) {
void Pong::InternalSwap(Pong* PROTOBUF_RESTRICT other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.port_, other->_impl_.port_);
}
::PROTOBUF_NAMESPACE_ID::Metadata Pong::GetMetadata() const {
::google::protobuf::Metadata Pong::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_pong_2eproto_getter, &descriptor_table_pong_2eproto_once,
file_level_metadata_pong_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pong
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::messages::pong::Pong*
Arena::CreateMaybeMessage< ::messages::pong::Pong >(Arena* arena) {
return Arena::CreateMessageInternal< ::messages::pong::Pong >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#include "google/protobuf/port_undef.inc"

View File

@@ -1,49 +1,60 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: pong.proto
// Protobuf C++ Version: 4.24.0-main
#ifndef GOOGLE_PROTOBUF_INCLUDED_pong_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_pong_2eproto
#ifndef GOOGLE_PROTOBUF_INCLUDED_pong_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_pong_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4025000
#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
#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_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>
#if 4025000 < 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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_pong_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_pong_2eproto {
static const uint32_t offsets[];
static const ::uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_pong_2eproto;
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_pong_2eproto;
namespace messages {
namespace pong {
class Pong;
@@ -51,22 +62,29 @@ struct PongDefaultTypeInternal;
extern PongDefaultTypeInternal _Pong_default_instance_;
} // namespace pong
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::pong::Pong* Arena::CreateMaybeMessage<::messages::pong::Pong>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
namespace messages {
namespace pong {
// ===================================================================
// -------------------------------------------------------------------
class Pong final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.pong.Pong) */ {
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:messages.pong.Pong) */ {
public:
inline Pong() : Pong(nullptr) {}
~Pong() override;
explicit PROTOBUF_CONSTEXPR Pong(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
template<typename = void>
explicit PROTOBUF_CONSTEXPR Pong(::google::protobuf::internal::ConstantInitialized);
Pong(const Pong& from);
inline Pong(const Pong& from)
: Pong(nullptr, from) {}
Pong(Pong&& from) noexcept
: Pong() {
*this = ::std::move(from);
@@ -78,9 +96,9 @@ class Pong final :
}
inline Pong& operator=(Pong&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
@@ -90,13 +108,22 @@ class Pong final :
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const Pong& default_instance() {
@@ -115,65 +142,62 @@ class Pong final :
inline void Swap(Pong* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Pong* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
Pong* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
Pong* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<Pong>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const Pong& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const Pong& from) {
Pong::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
::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 { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Pong* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "messages.pong.Pong";
}
protected:
explicit Pong(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
explicit Pong(::google::protobuf::Arena* arena);
Pong(::google::protobuf::Arena* arena, const Pong& from);
const ::google::protobuf::MessageLite::ClassData* GetClassData() const final;
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -183,69 +207,96 @@ class Pong final :
kPortFieldNumber = 1,
};
// uint32 port = 1;
void clear_port();
uint32_t port() const;
void set_port(uint32_t value);
private:
uint32_t _internal_port() const;
void _internal_set_port(uint32_t value);
public:
void clear_port() ;
::uint32_t port() const;
void set_port(::uint32_t value);
private:
::uint32_t _internal_port() const;
void _internal_set_port(::uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.pong.Pong)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
0, 1, 0,
0, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
uint32_t port_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::uint32_t port_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_pong_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// Pong
// uint32 port = 1;
inline void Pong::clear_port() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.port_ = 0u;
}
inline uint32_t Pong::_internal_port() const {
return _impl_.port_;
}
inline uint32_t Pong::port() const {
inline ::uint32_t Pong::port() const {
// @@protoc_insertion_point(field_get:messages.pong.Pong.port)
return _internal_port();
}
inline void Pong::_internal_set_port(uint32_t value) {
_impl_.port_ = value;
}
inline void Pong::set_port(uint32_t value) {
inline void Pong::set_port(::uint32_t value) {
_internal_set_port(value);
// @@protoc_insertion_point(field_set:messages.pong.Pong.port)
}
inline ::uint32_t Pong::_internal_port() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.port_;
}
inline void Pong::_internal_set_port(::uint32_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.port_ = value;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pong
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_pong_2eproto
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_pong_2eproto_2epb_2eh

View File

@@ -4,255 +4,282 @@
#include "stringData.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/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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace messages {
namespace stringData {
PROTOBUF_CONSTEXPR StringData::StringData(
::_pbi::ConstantInitialized): _impl_{
/*decltype(_impl_.data_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
, /*decltype(_impl_._cached_size_)*/{}} {}
inline constexpr StringData::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: data_(
&::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()),
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR StringData::StringData(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct StringDataDefaultTypeInternal {
PROTOBUF_CONSTEXPR StringDataDefaultTypeInternal()
: _instance(::_pbi::ConstantInitialized{}) {}
PROTOBUF_CONSTEXPR StringDataDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~StringDataDefaultTypeInternal() {}
union {
StringData _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StringDataDefaultTypeInternal _StringData_default_instance_;
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StringDataDefaultTypeInternal _StringData_default_instance_;
} // namespace stringData
} // namespace messages
static ::_pb::Metadata file_level_metadata_stringData_2eproto[1];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_stringData_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_stringData_2eproto = nullptr;
const uint32_t TableStruct_stringData_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
static constexpr const ::_pb::EnumDescriptor**
file_level_enum_descriptors_stringData_2eproto = nullptr;
static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_stringData_2eproto = nullptr;
const ::uint32_t
TableStruct_stringData_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::messages::stringData::StringData, _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(::messages::stringData::StringData, _impl_.data_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, -1, sizeof(::messages::stringData::StringData)},
static const ::_pbi::MigrationSchema
schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::messages::stringData::StringData)},
};
static const ::_pb::Message* const file_default_instances[] = {
&::messages::stringData::_StringData_default_instance_._instance,
};
const char descriptor_table_protodef_stringData_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
const char descriptor_table_protodef_stringData_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE(
protodesc_cold) = {
"\n\020stringData.proto\022\023messages.stringData\""
"\032\n\nStringData\022\014\n\004data\030\001 \001(\tb\006proto3"
;
static ::_pbi::once_flag descriptor_table_stringData_2eproto_once;
};
static ::absl::once_flag descriptor_table_stringData_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_stringData_2eproto = {
false, false, 75, descriptor_table_protodef_stringData_2eproto,
false,
false,
75,
descriptor_table_protodef_stringData_2eproto,
"stringData.proto",
&descriptor_table_stringData_2eproto_once, nullptr, 0, 1,
schemas, file_default_instances, TableStruct_stringData_2eproto::offsets,
file_level_metadata_stringData_2eproto, file_level_enum_descriptors_stringData_2eproto,
&descriptor_table_stringData_2eproto_once,
nullptr,
0,
1,
schemas,
file_default_instances,
TableStruct_stringData_2eproto::offsets,
file_level_metadata_stringData_2eproto,
file_level_enum_descriptors_stringData_2eproto,
file_level_service_descriptors_stringData_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_stringData_2eproto_getter() {
return &descriptor_table_stringData_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_stringData_2eproto(&descriptor_table_stringData_2eproto);
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2
static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_stringData_2eproto(&descriptor_table_stringData_2eproto);
namespace messages {
namespace stringData {
// ===================================================================
class StringData::_Internal {
public:
};
StringData::StringData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned)
: ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
SharedCtor(arena, is_message_owned);
StringData::StringData(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:messages.stringData.StringData)
}
StringData::StringData(const StringData& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
StringData* const _this = this; (void)_this;
new (&_impl_) Impl_{
decltype(_impl_.data_){}
, /*decltype(_impl_._cached_size_)*/{}};
inline PROTOBUF_NDEBUG_INLINE StringData::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from)
: data_(arena, from.data_),
_cached_size_{0} {}
StringData::StringData(
::google::protobuf::Arena* arena,
const StringData& from)
: ::google::protobuf::Message(arena) {
StringData* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_impl_.data_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.data_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_data().empty()) {
_this->_impl_.data_.Set(from._internal_data(),
_this->GetArenaForAllocation());
}
// @@protoc_insertion_point(copy_constructor:messages.stringData.StringData)
}
inline PROTOBUF_NDEBUG_INLINE StringData::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: data_(arena),
_cached_size_{0} {}
inline void StringData::SharedCtor(
::_pb::Arena* arena, bool is_message_owned) {
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.data_){}
, /*decltype(_impl_._cached_size_)*/{}
};
_impl_.data_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
_impl_.data_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void StringData::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
}
StringData::~StringData() {
// @@protoc_insertion_point(destructor:messages.stringData.StringData)
if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
(void)arena;
return;
}
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void StringData::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
ABSL_DCHECK(GetArena() == nullptr);
_impl_.data_.Destroy();
_impl_.~Impl_();
}
void StringData::SetCachedSize(int size) const {
_impl_._cached_size_.Set(size);
const ::google::protobuf::MessageLite::ClassData*
StringData::GetClassData() const {
PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite::ClassData
_data_ = {
StringData::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
&::google::protobuf::Message::kDescriptorMethods,
PROTOBUF_FIELD_OFFSET(StringData, _impl_._cached_size_),
};
return &_data_;
}
void StringData::Clear() {
PROTOBUF_NOINLINE void StringData::Clear() {
// @@protoc_insertion_point(message_clear_start:messages.stringData.StringData)
uint32_t cached_has_bits = 0;
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.data_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* StringData::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
uint32_t tag;
ptr = ::_pbi::ReadTag(ptr, &tag);
switch (tag >> 3) {
// string data = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
auto str = _internal_mutable_data();
ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
CHK_(ptr);
CHK_(::_pbi::VerifyUTF8(str, "messages.stringData.StringData.data"));
} else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4)) {
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
} // while
message_done:
const char* StringData::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}
uint8_t* StringData::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<0, 1, 0, 43, 2> StringData::_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
&_StringData_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// string data = 1;
{::_pbi::TcParser::FastUS1,
{10, 63, 0, PROTOBUF_FIELD_OFFSET(StringData, _impl_.data_)}},
}}, {{
65535, 65535
}}, {{
// string data = 1;
{PROTOBUF_FIELD_OFFSET(StringData, _impl_.data_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
}},
// no aux_entries
{{
"\36\4\0\0\0\0\0\0"
"messages.stringData.StringData"
"data"
}},
};
::uint8_t* StringData::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:messages.stringData.StringData)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// string data = 1;
if (!this->_internal_data().empty()) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_data().data(), static_cast<int>(this->_internal_data().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"messages.stringData.StringData.data");
target = stream->WriteStringMaybeAliased(
1, this->_internal_data(), target);
const std::string& _s = this->_internal_data();
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
_s.data(), static_cast<int>(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "messages.stringData.StringData.data");
target = stream->WriteStringMaybeAliased(1, _s, target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
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:messages.stringData.StringData)
return target;
}
size_t StringData::ByteSizeLong() const {
::size_t StringData::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:messages.stringData.StringData)
size_t total_size = 0;
::size_t total_size = 0;
uint32_t cached_has_bits = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string data = 1;
if (!this->_internal_data().empty()) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
this->_internal_data());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData StringData::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
StringData::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*StringData::GetClassData() const { return &_class_data_; }
void StringData::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
void StringData::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<StringData*>(&to_msg);
auto& from = static_cast<const StringData&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:messages.stringData.StringData)
GOOGLE_DCHECK_NE(&from, _this);
uint32_t cached_has_bits = 0;
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (!from._internal_data().empty()) {
_this->_internal_set_data(from._internal_data());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void StringData::CopyFrom(const StringData& from) {
@@ -262,36 +289,29 @@ void StringData::CopyFrom(const StringData& from) {
MergeFrom(from);
}
bool StringData::IsInitialized() const {
PROTOBUF_NOINLINE bool StringData::IsInitialized() const {
return true;
}
void StringData::InternalSwap(StringData* other) {
void StringData::InternalSwap(StringData* PROTOBUF_RESTRICT other) {
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
auto* arena = GetArena();
ABSL_DCHECK_EQ(arena, other->GetArena());
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&_impl_.data_, lhs_arena,
&other->_impl_.data_, rhs_arena
);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.data_, &other->_impl_.data_, arena);
}
::PROTOBUF_NAMESPACE_ID::Metadata StringData::GetMetadata() const {
::google::protobuf::Metadata StringData::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_stringData_2eproto_getter, &descriptor_table_stringData_2eproto_once,
file_level_metadata_stringData_2eproto[0]);
}
// @@protoc_insertion_point(namespace_scope)
} // namespace stringData
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::messages::stringData::StringData*
Arena::CreateMaybeMessage< ::messages::stringData::StringData >(Arena* arena) {
return Arena::CreateMessageInternal< ::messages::stringData::StringData >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#include "google/protobuf/port_undef.inc"

View File

@@ -1,49 +1,60 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: stringData.proto
// Protobuf C++ Version: 4.24.0-main
#ifndef GOOGLE_PROTOBUF_INCLUDED_stringData_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_stringData_2eproto
#ifndef GOOGLE_PROTOBUF_INCLUDED_stringData_2eproto_2epb_2eh
#define GOOGLE_PROTOBUF_INCLUDED_stringData_2eproto_2epb_2eh
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include "google/protobuf/port_def.inc"
#if PROTOBUF_VERSION < 4025000
#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
#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_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>
#if 4025000 < 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)
#include <google/protobuf/port_def.inc>
// Must be included last.
#include "google/protobuf/port_def.inc"
#define PROTOBUF_INTERNAL_EXPORT_stringData_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace google {
namespace protobuf {
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
} // namespace protobuf
} // namespace google
// Internal implementation detail -- do not use these members.
struct TableStruct_stringData_2eproto {
static const uint32_t offsets[];
static const ::uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_stringData_2eproto;
extern const ::google::protobuf::internal::DescriptorTable
descriptor_table_stringData_2eproto;
namespace messages {
namespace stringData {
class StringData;
@@ -51,22 +62,29 @@ struct StringDataDefaultTypeInternal;
extern StringDataDefaultTypeInternal _StringData_default_instance_;
} // namespace stringData
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::stringData::StringData* Arena::CreateMaybeMessage<::messages::stringData::StringData>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace google {
namespace protobuf {
} // namespace protobuf
} // namespace google
namespace messages {
namespace stringData {
// ===================================================================
// -------------------------------------------------------------------
class StringData final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.stringData.StringData) */ {
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:messages.stringData.StringData) */ {
public:
inline StringData() : StringData(nullptr) {}
~StringData() override;
explicit PROTOBUF_CONSTEXPR StringData(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
template<typename = void>
explicit PROTOBUF_CONSTEXPR StringData(::google::protobuf::internal::ConstantInitialized);
StringData(const StringData& from);
inline StringData(const StringData& from)
: StringData(nullptr, from) {}
StringData(StringData&& from) noexcept
: StringData() {
*this = ::std::move(from);
@@ -78,9 +96,9 @@ class StringData final :
}
inline StringData& operator=(StringData&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
@@ -90,13 +108,22 @@ class StringData final :
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const StringData& default_instance() {
@@ -115,65 +142,62 @@ class StringData final :
inline void Swap(StringData* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(StringData* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
StringData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
StringData* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<StringData>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const StringData& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const StringData& from) {
StringData::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
ABSL_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
::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 { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(StringData* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "messages.stringData.StringData";
}
protected:
explicit StringData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
explicit StringData(::google::protobuf::Arena* arena);
StringData(::google::protobuf::Arena* arena, const StringData& from);
const ::google::protobuf::MessageLite::ClassData* GetClassData() const final;
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
@@ -183,104 +207,132 @@ class StringData final :
kDataFieldNumber = 1,
};
// string data = 1;
void clear_data();
void clear_data() ;
const std::string& data() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_data(ArgT0&& arg0, ArgT... args);
template <typename Arg_ = const std::string&, typename... Args_>
void set_data(Arg_&& arg, Args_... args);
std::string* mutable_data();
PROTOBUF_NODISCARD std::string* release_data();
void set_allocated_data(std::string* data);
void set_allocated_data(std::string* value);
private:
const std::string& _internal_data() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(const std::string& value);
inline PROTOBUF_ALWAYS_INLINE void _internal_set_data(
const std::string& value);
std::string* _internal_mutable_data();
public:
public:
// @@protoc_insertion_point(class_scope:messages.stringData.StringData)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
0, 1, 0,
43, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr data_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::google::protobuf::internal::ArenaStringPtr data_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_stringData_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// -------------------------------------------------------------------
// StringData
// string data = 1;
inline void StringData::clear_data() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.data_.ClearToEmpty();
}
inline const std::string& StringData::data() const {
inline const std::string& StringData::data() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:messages.stringData.StringData.data)
return _internal_data();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void StringData::set_data(ArgT0&& arg0, ArgT... args) {
_impl_.data_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
template <typename Arg_, typename... Args_>
inline PROTOBUF_ALWAYS_INLINE void StringData::set_data(Arg_&& arg,
Args_... args) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.data_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
// @@protoc_insertion_point(field_set:messages.stringData.StringData.data)
}
inline std::string* StringData::mutable_data() {
inline std::string* StringData::mutable_data() ABSL_ATTRIBUTE_LIFETIME_BOUND {
std::string* _s = _internal_mutable_data();
// @@protoc_insertion_point(field_mutable:messages.stringData.StringData.data)
return _s;
}
inline const std::string& StringData::_internal_data() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.data_.Get();
}
inline void StringData::_internal_set_data(const std::string& value) {
_impl_.data_.Set(value, GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
_impl_.data_.Set(value, GetArena());
}
inline std::string* StringData::_internal_mutable_data() {
return _impl_.data_.Mutable(GetArenaForAllocation());
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
;
return _impl_.data_.Mutable( GetArena());
}
inline std::string* StringData::release_data() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:messages.stringData.StringData.data)
return _impl_.data_.Release();
}
inline void StringData::set_allocated_data(std::string* data) {
if (data != nullptr) {
} else {
}
_impl_.data_.SetAllocated(data, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
inline void StringData::set_allocated_data(std::string* value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.data_.SetAllocated(value, GetArena());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.data_.IsDefault()) {
_impl_.data_.Set("", GetArenaForAllocation());
_impl_.data_.Set("", GetArena());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:messages.stringData.StringData.data)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace stringData
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_stringData_2eproto
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_INCLUDED_stringData_2eproto_2epb_2eh

1
libs/cppzmq Submodule

Submodule libs/cppzmq added at 6164cf7dbc

View File

@@ -1,53 +0,0 @@
BasedOnStyle: LLVM
IndentWidth: 4
UseTab: Never
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: false
IndentBraces: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: true
BinPackArguments: true
BinPackParameters: false
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakTemplateDeclarations: false
ColumnLimit: 85
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
ContinuationIndentWidth: 2
PointerAlignment: Right
ReflowComments: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
SortIncludes: false
FixNamespaceComments: false
BreakBeforeBinaryOperators: NonAssignment
SpaceAfterTemplateKeyword: false
AlignAfterOpenBracket: Align
AlignOperands: true
BreakConstructorInitializers: AfterColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
SpaceAfterCStyleCast: true
BreakBeforeTernaryOperators: true

View File

@@ -1,195 +0,0 @@
name: CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
cppstd: ["98", "11", "20"]
cc: ["gcc-10"]
cxx: ["g++-10"]
drafts: ["ON"]
libzmq: ["4.3.4"]
libzmqbuild: ["cmake"]
include:
# older libzmq and gcc without draft
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-7"
cxx: "g++-7"
drafts: "OFF"
libzmq: "4.2.0"
libzmqbuild: "pkgconfig"
# gcc 4.8
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-4.8"
cxx: "g++-4.8"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
aptinstall: "gcc-4.8 g++-4.8"
# gcc 5
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-5"
cxx: "g++-5"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
aptinstall: "gcc-5 g++-5"
# without draft
- os: "ubuntu-latest"
cppstd: "20"
cc: "gcc-10"
cxx: "g++-10"
drafts: "OFF"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# coverage (gcc version should match gcov version)
- os: "ubuntu-latest"
cppstd: "17"
cc: "gcc-9"
cxx: "g++-9"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
coverage: "-DCOVERAGE=ON"
aptinstall: "lcov"
# clang
- os: "ubuntu-latest"
cppstd: "17"
cc: "clang-12"
cxx: "clang++-12"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# macos
- os: "macos-latest"
cppstd: "17"
cc: "clang"
cxx: "clang++"
drafts: "OFF"
libzmq: "4.3.4"
libzmqbuild: false
brewinstall: "zeromq"
# windows
- os: "windows-2019"
cppstd: "14"
cc: "msbuild"
cxx: "msbuild"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
platform: "-Ax64"
- os: "windows-latest"
cppstd: "20"
cc: "msbuild"
cxx: "msbuild"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
platform: "-Ax64"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
VERBOSE: 1
THREADS: 2
BUILDTYPE: "Debug"
steps:
- uses: actions/checkout@v2
- name: install_deps
run: |
if [ ! -z "${{ matrix.aptinstall }}" ]; then
sudo apt install -y ${{ matrix.aptinstall }}
fi
if [ ! -z "${{ matrix.brewinstall }}" ]; then
brew install ${{ matrix.brewinstall }}
fi
- name: get_libzmq
run: |
curl -L https://github.com/zeromq/libzmq/archive/v${{ matrix.libzmq }}.tar.gz \
>zeromq.tar.gz
tar -xvzf zeromq.tar.gz
- name: build_libzmq_cmake
if: ${{ matrix.libzmqbuild == 'cmake' }}
run: |
cmake -Hlibzmq-${{ matrix.libzmq }} -Blibzmq-build ${{ matrix.platform}} \
-DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_DRAFTS=${{ matrix.drafts }}
cmake --build libzmq-build --config ${BUILDTYPE} -j ${THREADS}
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build_libzmq_pkgconfig
if: ${{ matrix.libzmqbuild == 'pkgconfig' }}
working-directory: libzmq-${{ matrix.libzmq }}
run: |
./autogen.sh &&
./configure --prefix=${PWD}/libzmq-build &&
make -j ${THREADS}
make install
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}
run: |
cmake -H. -Bbuild ${{ matrix.platform}} ${{ matrix.coverage }} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DENABLE_DRAFTS=${{ matrix.drafts }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE} -j ${THREADS}
echo "CPPZMQ=${PWD}/build" >> ${GITHUB_ENV}
- name: test
# for unknown reason no tests are found and run on windows
# could be something to do with catch_discover_tests not working?
run: |
cd ${{ env.CPPZMQ }}
ctest -V -C ${BUILDTYPE}
- name: demo
# probably need to install libzmq and cppzmq for this to work on windows
if: ${{ matrix.os == 'ubuntu*' }}
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}:${{ env.CPPZMQ }}
run: |
cd demo
cmake -H. -Bbuild ${{ matrix.platform}} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE}
cd build
ctest -V -C ${BUILDTYPE}
- name: lcov
if: ${{ matrix.coverage && success() }}
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info -o coverage_filtered.info \
'/usr/include/*' \
'/usr/local/include/*' \
${PWD}'/tests/*' \
${PWD}'/build/*'
# to generate local html: genhtml coverage_filtered.info --output-directory .
- name: coveralls_upload
if: ${{ matrix.coverage && success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage_filtered.info

View File

@@ -1,5 +0,0 @@
# Vim tmp files
*.swp
# Build directory
*build/

View File

@@ -1,112 +0,0 @@
cmake_minimum_required(VERSION 3.11)
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include (DetectCPPZMQVersion)
project(cppzmq VERSION ${DETECTED_CPPZMQ_VERSION})
if (NOT TARGET libzmq AND NOT TARGET libzmq-static)
find_package(ZeroMQ QUIET)
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ REQUIRED)
endif()
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
endif()
if (ZeroMQ_FOUND AND NOT (TARGET libzmq OR TARGET libzmq-static))
message(FATAL_ERROR "ZeroMQ version not supported!")
endif()
endif()
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON)
else ()
OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF)
endif ()
if (ENABLE_DRAFTS)
ADD_DEFINITIONS (-DZMQ_BUILD_DRAFT_API)
set (pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1")
else (ENABLE_DRAFTS)
set (pkg_config_defines "")
endif (ENABLE_DRAFTS)
message(STATUS "cppzmq v${cppzmq_VERSION}")
set(CPPZMQ_HEADERS
zmq.hpp
zmq_addon.hpp
)
foreach (target cppzmq cppzmq-static)
add_library(${target} INTERFACE)
target_include_directories(${target} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
endforeach()
target_link_libraries(cppzmq INTERFACE libzmq)
target_link_libraries(cppzmq-static INTERFACE libzmq-static)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
install(TARGETS cppzmq cppzmq-static
EXPORT ${PROJECT_NAME}-targets)
install(FILES ${CPPZMQ_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
set(CPPZMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for cppzmqConfig.cmake")
configure_file(libzmq-pkg-config/FindZeroMQ.cmake
libzmq-pkg-config/FindZeroMQ.cmake
COPYONLY)
export(EXPORT ${PROJECT_NAME}-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR})
# Workaround until ARCH_INDEPENDENT flag can be used with cmake 3.14.
# The ConigVersion.cmake file contains checks for the architecture is was
# generated on, which can cause problems for header only libraries
# used with e.g. the Conan package manager. Since it is header only we
# can/should omit those checks.
set(CPPZMQ_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
set(CMAKE_SIZEOF_VOID_P "") # a simple unset is not sufficient
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${CPPZMQ_VERSION}
COMPATIBILITY AnyNewerVersion)
set(CMAKE_SIZEOF_VOID_P ${CPPZMQ_SIZEOF_VOID_P})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cppzmq.pc.in
${CMAKE_CURRENT_BINARY_DIR}/cppzmq.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppzmq.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake
DESTINATION ${CPPZMQ_CMAKECONFIG_INSTALL_DIR}/libzmq-pkg-config)
option(CPPZMQ_BUILD_TESTS "Whether or not to build the tests" ON)
if (CPPZMQ_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
if (CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD EQUAL 98 AND CMAKE_CXX_STANDARD GREATER_EQUAL 11)
add_subdirectory(examples)
endif()
endif()

View File

@@ -1,17 +0,0 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View File

@@ -1,196 +0,0 @@
[![CI](https://github.com/zeromq/cppzmq/actions/workflows/ci.yml/badge.svg)](https://github.com/zeromq/cppzmq/actions)
[![Coverage Status](https://coveralls.io/repos/github/zeromq/cppzmq/badge.svg?branch=master)](https://coveralls.io/github/zeromq/cppzmq?branch=master)
[![License](https://img.shields.io/github/license/zeromq/cppzmq.svg)](https://github.com/zeromq/cppzmq/blob/master/LICENSE)
Introduction & Design Goals
===========================
cppzmq is a C++ binding for libzmq. It has the following design goals:
- cppzmq maps the libzmq C API to C++ concepts. In particular:
- it is type-safe (the libzmq C API exposes various class-like concepts as void*)
- it provides exception-based error handling (the libzmq C API provides errno-based error handling)
- it provides RAII-style classes that automate resource management (the libzmq C API requires the user to take care to free resources explicitly)
- cppzmq is a light-weight, header-only binding. You only need to include the header file zmq.hpp (and maybe zmq_addon.hpp) to use it.
- zmq.hpp is meant to contain direct mappings of the abstractions provided by the libzmq C API, while zmq_addon.hpp provides additional higher-level abstractions.
There are other C++ bindings for ZeroMQ with different design goals. In particular, none of the following bindings are header-only:
- [zmqpp](https://github.com/zeromq/zmqpp) is a high-level binding to libzmq.
- [czmqpp](https://github.com/zeromq/czmqpp) is a binding based on the high-level czmq API.
- [fbzmq](https://github.com/facebook/fbzmq) is a binding that integrates with Apache Thrift and provides higher-level abstractions in addition. It requires C++14.
Supported platforms
===================
- Only a subset of the platforms that are supported by libzmq itself are supported. Some features already require a compiler supporting C++11. In the future, probably all features will require C++11. To build and run the tests, CMake and Catch are required.
- Any libzmq 4.x version is expected to work. DRAFT features may only work for the most recent tested version. Currently explicitly tested libzmq versions are
- 4.2.0 (without DRAFT API)
- 4.3.4 (with and without DRAFT API)
- Platforms with full support (i.e. CI executing build and tests)
- Ubuntu 18.04 x64 (with gcc 4.8.5, 5.5.0, 7.5.0)
- Ubuntu 20.04 x64 (with gcc 9.3.0, 10.3.0 and clang 12)
- Visual Studio 2017 x64
- Visual Studio 2019 x64
- macOS 10.15 (with clang 12, without DRAFT API)
- Additional platforms that are known to work:
- We have no current reports on additional platforms that are known to work yet. Please add your platform here. If CI can be provided for them with a cloud-based CI service working with GitHub, you are invited to add CI, and make it possible to be included in the list above.
- Additional platforms that probably work:
- Any platform supported by libzmq that provides a sufficiently recent gcc (4.8.1 or newer) or clang (3.4.1 or newer)
- Visual Studio 2012+ x86/x64
Examples
========
These examples require at least C++11.
```c++
#include <zmq.hpp>
int main()
{
zmq::context_t ctx;
zmq::socket_t sock(ctx, zmq::socket_type::push);
sock.bind("inproc://test");
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
}
```
This a more complex example where we send and receive multi-part messages over TCP with a wildcard port.
```c++
#include <iostream>
#include <zmq_addon.hpp>
int main()
{
zmq::context_t ctx;
zmq::socket_t sock1(ctx, zmq::socket_type::push);
zmq::socket_t sock2(ctx, zmq::socket_type::pull);
sock1.bind("tcp://127.0.0.1:*");
const std::string last_endpoint =
sock1.get(zmq::sockopt::last_endpoint);
std::cout << "Connecting to "
<< last_endpoint << std::endl;
sock2.connect(last_endpoint);
std::array<zmq::const_buffer, 2> send_msgs = {
zmq::str_buffer("foo"),
zmq::str_buffer("bar!")
};
if (!zmq::send_multipart(sock1, send_msgs))
return 1;
std::vector<zmq::message_t> recv_msgs;
const auto ret = zmq::recv_multipart(
sock2, std::back_inserter(recv_msgs));
if (!ret)
return 1;
std::cout << "Got " << *ret
<< " messages" << std::endl;
return 0;
}
```
See the `examples` directory for more examples. When the project is compiled with tests enabled, each example gets compiled to an executable.
API Overview
============
For an extensive overview of the `zmq.hpp` API in use, see this [Tour of CPPZMQ by @brettviren](https://brettviren.github.io/cppzmq-tour/index.html).
Bindings for libzmq in `zmq.hpp`:
Types:
* class `zmq::context_t`
* enum `zmq::ctxopt`
* class `zmq::socket_t`
* class `zmq::socket_ref`
* enum `zmq::socket_type`
* enum `zmq::sockopt`
* enum `zmq::send_flags`
* enum `zmq::recv_flags`
* class `zmq::message_t`
* class `zmq::const_buffer`
* class `zmq::mutable_buffer`
* struct `zmq::recv_buffer_size`
* alias `zmq::send_result_t`
* alias `zmq::recv_result_t`
* alias `zmq::recv_buffer_result_t`
* class `zmq::error_t`
* class `zmq::monitor_t`
* struct `zmq_event_t`,
* alias `zmq::free_fn`,
* alias `zmq::pollitem_t`,
* alias `zmq::fd_t`
* class `zmq::poller_t` DRAFT
* enum `zmq::event_flags` DRAFT
* enum `zmq::poller_event` DRAFT
Functions:
* `zmq::version`
* `zmq::poll`
* `zmq::proxy`
* `zmq::proxy_steerable`
* `zmq::buffer`
* `zmq::str_buffer`
Extra high-level types and functions `zmq_addon.hpp`:
Types:
* class `zmq::multipart_t`
* class `zmq::active_poller_t` DRAFT
Functions:
* `zmq::recv_multipart`
* `zmq::send_multipart`
* `zmq::send_multipart_n`
* `zmq::encode`
* `zmq::decode`
Compatibility Guidelines
========================
The users of cppzmq are expected to follow the guidelines below to ensure not to break when upgrading cppzmq to newer versions (non-exhaustive list):
* Do not depend on any macros defined in cppzmq unless explicitly declared public here.
The following macros may be used by consumers of cppzmq: `CPPZMQ_VERSION`, `CPPZMQ_VERSION_MAJOR`, `CPPZMQ_VERSION_MINOR`, `CPPZMQ_VERSION_PATCH`.
Contribution policy
===================
The contribution policy is at: http://rfc.zeromq.org/spec:22
Build instructions
==================
Build steps:
1. Build [libzmq](https://github.com/zeromq/libzmq) via cmake. This does an out of source build and installs the build files
- download and unzip the lib, cd to directory
- mkdir build
- cd build
- cmake ..
- sudo make -j4 install
2. Build cppzmq via cmake. This does an out of source build and installs the build files
- download and unzip the lib, cd to directory
- mkdir build
- cd build
- cmake ..
- sudo make -j4 install
3. Build cppzmq via [vcpkg](https://github.com/Microsoft/vcpkg/). This does an out of source build and installs the build files
- git clone https://github.com/Microsoft/vcpkg.git
- cd vcpkg
- ./bootstrap-vcpkg.sh # bootstrap-vcpkg.bat for Powershell
- ./vcpkg integrate install
- ./vcpkg install cppzmq
Using this:
A cmake find package scripts is provided for you to easily include this library.
Add these lines in your CMakeLists.txt to include the headers and library files of
cpp zmq (which will also include libzmq for you).
```
#find cppzmq wrapper, installed by make of cppzmq
find_package(cppzmq)
target_link_libraries(*Your Project Name* cppzmq)
```

View File

@@ -1,8 +0,0 @@
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/zmq.hpp" _CPPZMQ_H_CONTENTS)
string(REGEX REPLACE ".*#define CPPZMQ_VERSION_MAJOR ([0-9]+).*" "\\1" DETECTED_CPPZMQ_VERSION_MAJOR "${_CPPZMQ_H_CONTENTS}")
string(REGEX REPLACE ".*#define CPPZMQ_VERSION_MINOR ([0-9]+).*" "\\1" DETECTED_CPPZMQ_VERSION_MINOR "${_CPPZMQ_H_CONTENTS}")
string(REGEX REPLACE ".*#define CPPZMQ_VERSION_PATCH ([0-9]+).*" "\\1" DETECTED_CPPZMQ_VERSION_PATCH "${_CPPZMQ_H_CONTENTS}")
set(DETECTED_CPPZMQ_VERSION "${DETECTED_CPPZMQ_VERSION_MAJOR}.${DETECTED_CPPZMQ_VERSION_MINOR}.${DETECTED_CPPZMQ_VERSION_PATCH}")
message(STATUS "Detected CPPZMQ Version - ${DETECTED_CPPZMQ_VERSION}")

View File

@@ -1,9 +0,0 @@
prefix="@CMAKE_INSTALL_PREFIX@"
includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@"
Name: @PROJECT_NAME@
Description: C++ binding for libzmq
URL: https://github.com/zeromq/cppzmq
Version: @PROJECT_VERSION@
Requires: libzmq
Cflags: -I"${includedir}" @pkg_config_defines@

View File

@@ -1,36 +0,0 @@
# cppzmq cmake module
#
# The following import targets are created
#
# ::
#
# cppzmq-static
# cppzmq
#
# This module sets the following variables in your project::
#
# cppzmq_FOUND - true if cppzmq found on the system
# cppzmq_INCLUDE_DIR - the directory containing cppzmq headers
# cppzmq_LIBRARY - the ZeroMQ library for dynamic linking
# cppzmq_STATIC_LIBRARY - the ZeroMQ library for static linking
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_package(ZeroMQ QUIET)
# libzmq autotools install: fallback to pkg-config
if(NOT ZeroMQ_FOUND)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
find_package(ZeroMQ REQUIRED)
endif()
if(NOT ZeroMQ_FOUND)
message(FATAL_ERROR "ZeroMQ was NOT found!")
endif()
if(NOT TARGET @PROJECT_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
get_target_property(@PROJECT_NAME@_INCLUDE_DIR cppzmq INTERFACE_INCLUDE_DIRECTORIES)
endif()

View File

@@ -1,23 +0,0 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(cppzmq-demo CXX)
find_package(cppzmq)
enable_testing()
add_executable(
demo
main.cpp
)
target_link_libraries(
demo
cppzmq
)
add_test(
NAME
demo
COMMAND
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/demo
)

View File

@@ -1,7 +0,0 @@
#include <zmq.hpp>
int main(int argc, char **argv)
{
zmq::context_t context;
return 0;
}

View File

@@ -1,40 +0,0 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(cppzmq-examples CXX)
# place binaries and libraries according to GNU standards
include(GNUInstallDirs)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
find_package(Threads)
find_package(cppzmq)
add_executable(
pubsub_multithread_inproc
pubsub_multithread_inproc.cpp
)
target_link_libraries(
pubsub_multithread_inproc
PRIVATE cppzmq ${CMAKE_THREAD_LIBS_INIT}
)
add_executable(
hello_world
hello_world.cpp
)
target_link_libraries(
hello_world
PRIVATE cppzmq ${CMAKE_THREAD_LIBS_INIT}
)
add_executable(
multipart_messages
multipart_messages.cpp
)
target_link_libraries(
multipart_messages
PRIVATE cppzmq ${CMAKE_THREAD_LIBS_INIT}
)

View File

@@ -1,9 +0,0 @@
#include <zmq.hpp>
int main()
{
zmq::context_t ctx;
zmq::socket_t sock(ctx, zmq::socket_type::push);
sock.bind("inproc://test");
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
}

View File

@@ -1,31 +0,0 @@
#include <iostream>
#include <zmq_addon.hpp>
int main()
{
zmq::context_t ctx;
zmq::socket_t sock1(ctx, zmq::socket_type::push);
zmq::socket_t sock2(ctx, zmq::socket_type::pull);
sock1.bind("tcp://127.0.0.1:*");
const std::string last_endpoint =
sock1.get(zmq::sockopt::last_endpoint);
std::cout << "Connecting to "
<< last_endpoint << std::endl;
sock2.connect(last_endpoint);
std::array<zmq::const_buffer, 2> send_msgs = {
zmq::str_buffer("foo"),
zmq::str_buffer("bar!")
};
if (!zmq::send_multipart(sock1, send_msgs))
return 1;
std::vector<zmq::message_t> recv_msgs;
const auto ret = zmq::recv_multipart(
sock2, std::back_inserter(recv_msgs));
if (!ret)
return 1;
std::cout << "Got " << *ret
<< " messages" << std::endl;
return 0;
}

View File

@@ -1,102 +0,0 @@
#include <future>
#include <iostream>
#include <string>
#include <thread>
#include "zmq.hpp"
#include "zmq_addon.hpp"
void PublisherThread(zmq::context_t *ctx) {
// Prepare publisher
zmq::socket_t publisher(*ctx, zmq::socket_type::pub);
publisher.bind("inproc://#1");
// Give the subscribers a chance to connect, so they don't lose any messages
std::this_thread::sleep_for(std::chrono::milliseconds(20));
while (true) {
// Write three messages, each with an envelope and content
publisher.send(zmq::str_buffer("A"), zmq::send_flags::sndmore);
publisher.send(zmq::str_buffer("Message in A envelope"));
publisher.send(zmq::str_buffer("B"), zmq::send_flags::sndmore);
publisher.send(zmq::str_buffer("Message in B envelope"));
publisher.send(zmq::str_buffer("C"), zmq::send_flags::sndmore);
publisher.send(zmq::str_buffer("Message in C envelope"));
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
void SubscriberThread1(zmq::context_t *ctx) {
// Prepare subscriber
zmq::socket_t subscriber(*ctx, zmq::socket_type::sub);
subscriber.connect("inproc://#1");
// Thread2 opens "A" and "B" envelopes
subscriber.set(zmq::sockopt::subscribe, "A");
subscriber.set(zmq::sockopt::subscribe, "B");
while (1) {
// Receive all parts of the message
std::vector<zmq::message_t> recv_msgs;
zmq::recv_result_t result =
zmq::recv_multipart(subscriber, std::back_inserter(recv_msgs));
assert(result && "recv failed");
assert(*result == 2);
std::cout << "Thread2: [" << recv_msgs[0].to_string() << "] "
<< recv_msgs[1].to_string() << std::endl;
}
}
void SubscriberThread2(zmq::context_t *ctx) {
// Prepare our context and subscriber
zmq::socket_t subscriber(*ctx, zmq::socket_type::sub);
subscriber.connect("inproc://#1");
// Thread3 opens ALL envelopes
subscriber.set(zmq::sockopt::subscribe, "");
while (1) {
// Receive all parts of the message
std::vector<zmq::message_t> recv_msgs;
zmq::recv_result_t result =
zmq::recv_multipart(subscriber, std::back_inserter(recv_msgs));
assert(result && "recv failed");
assert(*result == 2);
std::cout << "Thread3: [" << recv_msgs[0].to_string() << "] "
<< recv_msgs[1].to_string() << std::endl;
}
}
int main() {
/*
* No I/O threads are involved in passing messages using the inproc transport.
* Therefore, if you are using a ØMQ context for in-process messaging only you
* can initialise the context with zero I/O threads.
*
* Source: http://api.zeromq.org/4-3:zmq-inproc
*/
zmq::context_t ctx(0);
auto thread1 = std::async(std::launch::async, PublisherThread, &ctx);
// Give the publisher a chance to bind, since inproc requires it
std::this_thread::sleep_for(std::chrono::milliseconds(10));
auto thread2 = std::async(std::launch::async, SubscriberThread1, &ctx);
auto thread3 = std::async(std::launch::async, SubscriberThread2, &ctx);
thread1.wait();
thread2.wait();
thread3.wait();
/*
* Output:
* An infinite loop of a mix of:
* Thread2: [A] Message in A envelope
* Thread2: [B] Message in B envelope
* Thread3: [A] Message in A envelope
* Thread3: [B] Message in B envelope
* Thread3: [C] Message in C envelope
*/
}

View File

@@ -1,34 +0,0 @@
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
find_package(PkgConfig)
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
find_path(ZeroMQ_INCLUDE_DIR zmq.h
PATHS ${ZeroMQ_DIR}/include
${PC_LIBZMQ_INCLUDE_DIRS})
find_library(ZeroMQ_LIBRARY
NAMES zmq
PATHS ${ZeroMQ_DIR}/lib
${PC_LIBZMQ_LIBDIR}
${PC_LIBZMQ_LIBRARY_DIRS})
if(ZeroMQ_LIBRARY)
set(ZeroMQ_FOUND ON)
endif()
set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} )
set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} )
if(NOT TARGET libzmq)
add_library(libzmq UNKNOWN IMPORTED)
set_target_properties(libzmq PROPERTIES
IMPORTED_LOCATION ${ZeroMQ_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS})
endif()
include ( FindPackageHandleStandardArgs )
# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS )

View File

@@ -1,53 +0,0 @@
find_package(Threads)
find_package(Catch2 QUIET)
if (NOT Catch2_FOUND)
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9)
FetchContent_MakeAvailable(Catch2)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/contrib)
endif()
add_executable(
unit_tests
buffer.cpp
message.cpp
context.cpp
socket.cpp
socket_ref.cpp
poller.cpp
active_poller.cpp
multipart.cpp
recv_multipart.cpp
send_multipart.cpp
codec_multipart.cpp
monitor.cpp
utilities.cpp
)
target_include_directories(unit_tests PUBLIC ${CATCH_MODULE_PATH})
target_link_libraries(
unit_tests
PRIVATE Catch2::Catch2
PRIVATE cppzmq
PRIVATE ${CMAKE_THREAD_LIBS_INIT}
)
OPTION (COVERAGE "Enable gcda file generation needed by lcov" OFF)
if (COVERAGE)
target_compile_options(unit_tests PRIVATE --coverage)
target_link_options(unit_tests PRIVATE --coverage)
message(STATUS "Coverage enabled")
endif()
include(CTest)
include(Catch)
catch_discover_tests(unit_tests)

View File

@@ -1,446 +0,0 @@
#include <zmq_addon.hpp>
#include "testutil.hpp"
#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL) && defined(ZMQ_BUILD_DRAFT_API)
#include <array>
#include <memory>
TEST_CASE("create destroy", "[active_poller]")
{
zmq::active_poller_t active_poller;
CHECK(active_poller.empty());
}
static_assert(!std::is_copy_constructible<zmq::active_poller_t>::value,
"active_poller_t should not be copy-constructible");
static_assert(!std::is_copy_assignable<zmq::active_poller_t>::value,
"active_poller_t should not be copy-assignable");
static const zmq::active_poller_t::handler_type no_op_handler =
[](zmq::event_flags) {};
TEST_CASE("move construct empty", "[active_poller]")
{
zmq::active_poller_t a;
CHECK(a.empty());
zmq::active_poller_t b = std::move(a);
CHECK(b.empty());
CHECK(0u == a.size());
CHECK(0u == b.size());
}
TEST_CASE("move assign empty", "[active_poller]")
{
zmq::active_poller_t a;
CHECK(a.empty());
zmq::active_poller_t b;
CHECK(b.empty());
b = std::move(a);
CHECK(0u == a.size());
CHECK(0u == b.size());
CHECK(a.empty());
CHECK(b.empty());
}
TEST_CASE("move construct non empty", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t a;
a.add(socket, zmq::event_flags::pollin, [](zmq::event_flags) {});
CHECK_FALSE(a.empty());
CHECK(1u == a.size());
zmq::active_poller_t b = std::move(a);
CHECK(a.empty());
CHECK(0u == a.size());
CHECK_FALSE(b.empty());
CHECK(1u == b.size());
}
TEST_CASE("move assign non empty", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t a;
a.add(socket, zmq::event_flags::pollin, no_op_handler);
CHECK_FALSE(a.empty());
CHECK(1u == a.size());
zmq::active_poller_t b;
b = std::move(a);
CHECK(a.empty());
CHECK(0u == a.size());
CHECK_FALSE(b.empty());
CHECK(1u == b.size());
}
TEST_CASE("add handler", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
CHECK_NOTHROW(
active_poller.add(socket, zmq::event_flags::pollin, no_op_handler));
}
TEST_CASE("add null handler fails", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
zmq::active_poller_t::handler_type handler;
CHECK_THROWS_AS(active_poller.add(socket, zmq::event_flags::pollin, handler),
std::invalid_argument);
}
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 0)
// this behaviour was added by https://github.com/zeromq/libzmq/pull/3100
TEST_CASE("add handler invalid events type", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
short invalid_events_type = 2 << 10;
CHECK_THROWS_AS(
active_poller.add(socket, static_cast<zmq::event_flags>(invalid_events_type),
no_op_handler),
zmq::error_t);
CHECK(active_poller.empty());
CHECK(0u == active_poller.size());
}
#endif
TEST_CASE("add handler twice throws", "[active_poller]")
{
common_server_client_setup s;
CHECK(s.client.send(zmq::message_t{}, zmq::send_flags::none));
zmq::active_poller_t active_poller;
bool message_received = false;
active_poller.add(
s.server, zmq::event_flags::pollin,
[&message_received](zmq::event_flags) { message_received = true; });
CHECK_THROWS_ZMQ_ERROR(
EINVAL, active_poller.add(s.server, zmq::event_flags::pollin, no_op_handler));
CHECK(1 == active_poller.wait(std::chrono::milliseconds{-1}));
CHECK(message_received); // handler unmodified
}
TEST_CASE("wait with no handlers throws", "[active_poller]")
{
zmq::active_poller_t active_poller;
CHECK_THROWS_ZMQ_ERROR(EFAULT,
active_poller.wait(std::chrono::milliseconds{10}));
}
TEST_CASE("remove unregistered throws", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
CHECK_THROWS_ZMQ_ERROR(EINVAL, active_poller.remove(socket));
}
TEST_CASE("remove registered empty", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
active_poller.add(socket, zmq::event_flags::pollin, no_op_handler);
CHECK_NOTHROW(active_poller.remove(socket));
}
TEST_CASE("remove registered non empty", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
active_poller.add(socket, zmq::event_flags::pollin, no_op_handler);
CHECK_NOTHROW(active_poller.remove(socket));
}
namespace
{
struct server_client_setup : common_server_client_setup
{
zmq::active_poller_t::handler_type handler = [&](zmq::event_flags e) {
events = e;
};
zmq::event_flags events = zmq::event_flags::none;
};
const std::string hi_str = "Hi";
}
TEST_CASE("poll basic", "[active_poller]")
{
server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::active_poller_t active_poller;
bool message_received = false;
zmq::active_poller_t::handler_type handler =
[&message_received](zmq::event_flags events) {
CHECK(zmq::event_flags::none != (events & zmq::event_flags::pollin));
message_received = true;
};
CHECK_NOTHROW(active_poller.add(s.server, zmq::event_flags::pollin, handler));
CHECK(1 == active_poller.wait(std::chrono::milliseconds{-1}));
CHECK(message_received);
}
/// \todo this contains multiple test cases that should be split up
TEST_CASE("client server", "[active_poller]")
{
const std::string send_msg = hi_str;
// Setup server and client
server_client_setup s;
// Setup active_poller
zmq::active_poller_t active_poller;
zmq::event_flags events;
zmq::active_poller_t::handler_type handler = [&](zmq::event_flags e) {
if (zmq::event_flags::none != (e & zmq::event_flags::pollin)) {
zmq::message_t zmq_msg;
CHECK_NOTHROW(s.server.recv(zmq_msg)); // get message
std::string recv_msg(zmq_msg.data<char>(), zmq_msg.size());
CHECK(send_msg == recv_msg);
} else if (zmq::event_flags::none != (e & ~zmq::event_flags::pollout)) {
INFO("Unexpected event type " << static_cast<short>(events));
REQUIRE(false);
}
events = e;
};
CHECK_NOTHROW(active_poller.add(s.server, zmq::event_flags::pollin, handler));
// client sends message
CHECK_NOTHROW(s.client.send(zmq::message_t{send_msg}, zmq::send_flags::none));
CHECK(1 == active_poller.wait(std::chrono::milliseconds{-1}));
CHECK(events == zmq::event_flags::pollin);
// Re-add server socket with pollout flag
CHECK_NOTHROW(active_poller.remove(s.server));
CHECK_NOTHROW(active_poller.add(
s.server, zmq::event_flags::pollin | zmq::event_flags::pollout, handler));
CHECK(1 == active_poller.wait(std::chrono::milliseconds{-1}));
CHECK(events == zmq::event_flags::pollout);
}
TEST_CASE("add invalid socket throws", "[active_poller]")
{
zmq::context_t context;
zmq::active_poller_t active_poller;
zmq::socket_t a{context, zmq::socket_type::router};
zmq::socket_t b{std::move(a)};
CHECK_THROWS_AS(active_poller.add(a, zmq::event_flags::pollin, no_op_handler),
zmq::error_t);
}
TEST_CASE("remove invalid socket throws", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::active_poller_t active_poller;
CHECK_NOTHROW(
active_poller.add(socket, zmq::event_flags::pollin, no_op_handler));
CHECK(1u == active_poller.size());
std::vector<zmq::socket_t> sockets;
sockets.emplace_back(std::move(socket));
CHECK_THROWS_AS(active_poller.remove(socket), zmq::error_t);
CHECK(1u == active_poller.size());
}
TEST_CASE("wait on added empty handler", "[active_poller]")
{
server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::active_poller_t active_poller;
CHECK_NOTHROW(
active_poller.add(s.server, zmq::event_flags::pollin, no_op_handler));
CHECK_NOTHROW(active_poller.wait(std::chrono::milliseconds{-1}));
}
TEST_CASE("modify empty throws", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::push};
zmq::active_poller_t active_poller;
CHECK_THROWS_AS(active_poller.modify(socket, zmq::event_flags::pollin),
zmq::error_t);
}
TEST_CASE("modify invalid socket throws", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t a{context, zmq::socket_type::push};
zmq::socket_t b{std::move(a)};
zmq::active_poller_t active_poller;
CHECK_THROWS_AS(active_poller.modify(a, zmq::event_flags::pollin),
zmq::error_t);
}
TEST_CASE("modify not added throws", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t a{context, zmq::socket_type::push};
zmq::socket_t b{context, zmq::socket_type::push};
zmq::active_poller_t active_poller;
CHECK_NOTHROW(active_poller.add(a, zmq::event_flags::pollin, no_op_handler));
CHECK_THROWS_AS(active_poller.modify(b, zmq::event_flags::pollin),
zmq::error_t);
}
TEST_CASE("modify simple", "[active_poller]")
{
zmq::context_t context;
zmq::socket_t a{context, zmq::socket_type::push};
zmq::active_poller_t active_poller;
CHECK_NOTHROW(active_poller.add(a, zmq::event_flags::pollin, no_op_handler));
CHECK_NOTHROW(
active_poller.modify(a, zmq::event_flags::pollin | zmq::event_flags::pollout));
}
TEST_CASE("poll client server", "[active_poller]")
{
// Setup server and client
server_client_setup s;
// Setup active_poller
zmq::active_poller_t active_poller;
CHECK_NOTHROW(active_poller.add(s.server, zmq::event_flags::pollin, s.handler));
// client sends message
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
// wait for message and verify events
CHECK_NOTHROW(active_poller.wait(std::chrono::milliseconds{500}));
CHECK(s.events == zmq::event_flags::pollin);
// Modify server socket with pollout flag
CHECK_NOTHROW(active_poller.modify(s.server, zmq::event_flags::pollin
| zmq::event_flags::pollout));
CHECK(1 == active_poller.wait(std::chrono::milliseconds{500}));
CHECK(s.events == (zmq::event_flags::pollin | zmq::event_flags::pollout));
}
TEST_CASE("wait one return", "[active_poller]")
{
// Setup server and client
server_client_setup s;
int count = 0;
// Setup active_poller
zmq::active_poller_t active_poller;
CHECK_NOTHROW(active_poller.add(s.server, zmq::event_flags::pollin,
[&count](zmq::event_flags) { ++count; }));
// client sends message
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
// wait for message and verify events
CHECK(1 == active_poller.wait(std::chrono::milliseconds{500}));
CHECK(1u == count);
}
TEST_CASE("wait on move constructed active_poller", "[active_poller]")
{
server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::active_poller_t a;
CHECK_NOTHROW(a.add(s.server, zmq::event_flags::pollin, no_op_handler));
zmq::active_poller_t b{std::move(a)};
CHECK(1u == b.size());
CHECK(0u == a.size());
CHECK_THROWS_ZMQ_ERROR(EFAULT, a.wait(std::chrono::milliseconds{10}));
CHECK(b.wait(std::chrono::milliseconds{-1}));
}
TEST_CASE("wait on move assigned active_poller", "[active_poller]")
{
server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::active_poller_t a;
CHECK_NOTHROW(a.add(s.server, zmq::event_flags::pollin, no_op_handler));
zmq::active_poller_t b;
b = {std::move(a)};
CHECK(1u == b.size());
CHECK(0u == a.size());
CHECK_THROWS_ZMQ_ERROR(EFAULT, a.wait(std::chrono::milliseconds{10}));
CHECK(b.wait(std::chrono::milliseconds{-1}));
}
TEST_CASE("received on move constructed active_poller", "[active_poller]")
{
// Setup server and client
server_client_setup s;
int count = 0;
// Setup active_poller a
zmq::active_poller_t a;
CHECK_NOTHROW(a.add(s.server, zmq::event_flags::pollin,
[&count](zmq::event_flags) { ++count; }));
// client sends message
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
// wait for message and verify it is received
CHECK(1 == a.wait(std::chrono::milliseconds{500}));
CHECK(1u == count);
// Move construct active_poller b
zmq::active_poller_t b{std::move(a)};
// client sends message again
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
// wait for message and verify it is received
CHECK(1 == b.wait(std::chrono::milliseconds{500}));
CHECK(2u == count);
}
TEST_CASE("remove from handler", "[active_poller]")
{
constexpr size_t ITER_NO = 10;
// Setup servers and clients
std::vector<server_client_setup> setup_list;
for (size_t i = 0; i < ITER_NO; ++i)
setup_list.emplace_back(server_client_setup{});
// Setup active_poller
zmq::active_poller_t active_poller;
int count = 0;
for (size_t i = 0; i < ITER_NO; ++i) {
CHECK_NOTHROW(active_poller.add(
setup_list[i].server, zmq::event_flags::pollin,
[&, i](zmq::event_flags events) {
CHECK(events == zmq::event_flags::pollin);
active_poller.remove(setup_list[ITER_NO - i - 1].server);
CHECK((ITER_NO - i - 1) == active_poller.size());
}));
++count;
}
CHECK(ITER_NO == active_poller.size());
// Clients send messages
for (auto &s : setup_list) {
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
}
// Wait for all servers to receive a message
for (auto &s : setup_list) {
zmq::pollitem_t items[] = {{s.server, 0, ZMQ_POLLIN, 0}};
zmq::poll(&items[0], 1);
}
// Fire all handlers in one wait
CHECK(ITER_NO == active_poller.wait(std::chrono::milliseconds{-1}));
CHECK(ITER_NO == count);
}
#endif

View File

@@ -1,306 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq.hpp>
#ifdef ZMQ_CPP17
static_assert(std::is_nothrow_swappable_v<zmq::const_buffer>);
static_assert(std::is_nothrow_swappable_v<zmq::mutable_buffer>);
static_assert(std::is_trivially_copyable_v<zmq::const_buffer>);
static_assert(std::is_trivially_copyable_v<zmq::mutable_buffer>);
#endif
#ifdef ZMQ_CPP11
using BT = int16_t;
TEST_CASE("buffer default ctor", "[buffer]")
{
constexpr zmq::mutable_buffer mb;
constexpr zmq::const_buffer cb;
CHECK(mb.size() == 0);
CHECK(mb.data() == nullptr);
CHECK(cb.size() == 0);
CHECK(cb.data() == nullptr);
}
TEST_CASE("buffer data ctor", "[buffer]")
{
std::vector<BT> v(10);
zmq::const_buffer cb(v.data(), v.size() * sizeof(BT));
CHECK(cb.size() == v.size() * sizeof(BT));
CHECK(cb.data() == v.data());
zmq::mutable_buffer mb(v.data(), v.size() * sizeof(BT));
CHECK(mb.size() == v.size() * sizeof(BT));
CHECK(mb.data() == v.data());
zmq::const_buffer from_mut = mb;
CHECK(mb.size() == from_mut.size());
CHECK(mb.data() == from_mut.data());
const auto cmb = mb;
static_assert(std::is_same<decltype(cmb.data()), void *>::value, "");
constexpr const void *cp = nullptr;
constexpr void *p = nullptr;
constexpr zmq::const_buffer cecb = zmq::buffer(p, 0);
constexpr zmq::mutable_buffer cemb = zmq::buffer(p, 0);
CHECK(cecb.data() == nullptr);
CHECK(cemb.data() == nullptr);
}
TEST_CASE("const_buffer operator+", "[buffer]")
{
std::vector<BT> v(10);
zmq::const_buffer cb(v.data(), v.size() * sizeof(BT));
const size_t shift = 4;
auto shifted = cb + shift;
CHECK(shifted.size() == v.size() * sizeof(BT) - shift);
CHECK(shifted.data() == v.data() + shift / sizeof(BT));
auto shifted2 = shift + cb;
CHECK(shifted.size() == shifted2.size());
CHECK(shifted.data() == shifted2.data());
auto cbinp = cb;
cbinp += shift;
CHECK(shifted.size() == cbinp.size());
CHECK(shifted.data() == cbinp.data());
}
TEST_CASE("mutable_buffer operator+", "[buffer]")
{
std::vector<BT> v(10);
zmq::mutable_buffer mb(v.data(), v.size() * sizeof(BT));
const size_t shift = 4;
auto shifted = mb + shift;
CHECK(shifted.size() == v.size() * sizeof(BT) - shift);
CHECK(shifted.data() == v.data() + shift / sizeof(BT));
auto shifted2 = shift + mb;
CHECK(shifted.size() == shifted2.size());
CHECK(shifted.data() == shifted2.data());
auto mbinp = mb;
mbinp += shift;
CHECK(shifted.size() == mbinp.size());
CHECK(shifted.data() == mbinp.data());
}
TEST_CASE("mutable_buffer creation basic", "[buffer]")
{
std::vector<BT> v(10);
zmq::mutable_buffer mb(v.data(), v.size() * sizeof(BT));
zmq::mutable_buffer mb2 = zmq::buffer(v.data(), v.size() * sizeof(BT));
CHECK(mb.data() == mb2.data());
CHECK(mb.size() == mb2.size());
zmq::mutable_buffer mb3 = zmq::buffer(mb);
CHECK(mb.data() == mb3.data());
CHECK(mb.size() == mb3.size());
zmq::mutable_buffer mb4 = zmq::buffer(mb, 10 * v.size() * sizeof(BT));
CHECK(mb.data() == mb4.data());
CHECK(mb.size() == mb4.size());
zmq::mutable_buffer mb5 = zmq::buffer(mb, 4);
CHECK(mb.data() == mb5.data());
CHECK(4 == mb5.size());
}
TEST_CASE("const_buffer creation basic", "[buffer]")
{
const std::vector<BT> v(10);
zmq::const_buffer cb(v.data(), v.size() * sizeof(BT));
zmq::const_buffer cb2 = zmq::buffer(v.data(), v.size() * sizeof(BT));
CHECK(cb.data() == cb2.data());
CHECK(cb.size() == cb2.size());
zmq::const_buffer cb3 = zmq::buffer(cb);
CHECK(cb.data() == cb3.data());
CHECK(cb.size() == cb3.size());
zmq::const_buffer cb4 = zmq::buffer(cb, 10 * v.size() * sizeof(BT));
CHECK(cb.data() == cb4.data());
CHECK(cb.size() == cb4.size());
zmq::const_buffer cb5 = zmq::buffer(cb, 4);
CHECK(cb.data() == cb5.data());
CHECK(4 == cb5.size());
}
TEST_CASE("mutable_buffer creation C array", "[buffer]")
{
BT d[10] = {};
zmq::mutable_buffer b = zmq::buffer(d);
CHECK(b.size() == 10 * sizeof(BT));
CHECK(b.data() == static_cast<BT*>(d));
zmq::const_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == static_cast<BT*>(d));
}
TEST_CASE("const_buffer creation C array", "[buffer]")
{
const BT d[10] = {};
zmq::const_buffer b = zmq::buffer(d);
CHECK(b.size() == 10 * sizeof(BT));
CHECK(b.data() == static_cast<const BT*>(d));
zmq::const_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == static_cast<const BT*>(d));
}
TEST_CASE("mutable_buffer creation array", "[buffer]")
{
std::array<BT, 10> d = {};
zmq::mutable_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(BT));
CHECK(b.data() == d.data());
zmq::mutable_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
}
TEST_CASE("const_buffer creation array", "[buffer]")
{
const std::array<BT, 10> d = {};
zmq::const_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(BT));
CHECK(b.data() == d.data());
zmq::const_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
}
TEST_CASE("const_buffer creation array 2", "[buffer]")
{
std::array<const BT, 10> d = {{}};
zmq::const_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(BT));
CHECK(b.data() == d.data());
zmq::const_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
}
TEST_CASE("mutable_buffer creation vector", "[buffer]")
{
std::vector<BT> d(10);
zmq::mutable_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(BT));
CHECK(b.data() == d.data());
zmq::mutable_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
d.clear();
b = zmq::buffer(d);
CHECK(b.size() == 0);
CHECK(b.data() == nullptr);
}
TEST_CASE("const_buffer creation vector", "[buffer]")
{
std::vector<BT> d(10);
zmq::const_buffer b = zmq::buffer(static_cast<const std::vector<BT> &>(d));
CHECK(b.size() == d.size() * sizeof(BT));
CHECK(b.data() == d.data());
zmq::const_buffer b2 = zmq::buffer(static_cast<const std::vector<BT> &>(d), 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
d.clear();
b = zmq::buffer(static_cast<const std::vector<BT> &>(d));
CHECK(b.size() == 0);
CHECK(b.data() == nullptr);
}
TEST_CASE("const_buffer creation string", "[buffer]")
{
const std::wstring d(10, L'a');
zmq::const_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(wchar_t));
CHECK(b.data() == d.data());
zmq::const_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
}
TEST_CASE("mutable_buffer creation string", "[buffer]")
{
std::wstring d(10, L'a');
zmq::mutable_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(wchar_t));
CHECK(b.data() == d.data());
zmq::mutable_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
}
#if CPPZMQ_HAS_STRING_VIEW
TEST_CASE("const_buffer creation string_view", "[buffer]")
{
std::wstring dstr(10, L'a');
std::wstring_view d = dstr;
zmq::const_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(wchar_t));
CHECK(b.data() == d.data());
zmq::const_buffer b2 = zmq::buffer(d, 4);
CHECK(b2.size() == 4);
CHECK(b2.data() == d.data());
}
#endif
TEST_CASE("const_buffer creation with str_buffer", "[buffer]")
{
const wchar_t wd[10] = {};
zmq::const_buffer b = zmq::str_buffer(wd);
CHECK(b.size() == 9 * sizeof(wchar_t));
CHECK(b.data() == static_cast<const wchar_t*>(wd));
zmq::const_buffer b2_null = zmq::buffer("hello");
constexpr zmq::const_buffer b2 = zmq::str_buffer("hello");
CHECK(b2_null.size() == 6);
CHECK(b2.size() == 5);
CHECK(std::string(static_cast<const char*>(b2.data()), b2.size()) == "hello");
}
TEST_CASE("const_buffer creation with zbuf string literal char", "[buffer]")
{
using namespace zmq::literals;
constexpr zmq::const_buffer b = "hello"_zbuf;
CHECK(b.size() == 5);
CHECK(std::memcmp(b.data(), "hello", b.size()) == 0);
}
TEST_CASE("const_buffer creation with zbuf string literal wchar_t", "[buffer]")
{
using namespace zmq::literals;
constexpr zmq::const_buffer b = L"hello"_zbuf;
CHECK(b.size() == 5 * sizeof(wchar_t));
CHECK(std::memcmp(b.data(), L"hello", b.size()) == 0);
}
TEST_CASE("const_buffer creation with zbuf string literal char16_t", "[buffer]")
{
using namespace zmq::literals;
constexpr zmq::const_buffer b = u"hello"_zbuf;
CHECK(b.size() == 5 * sizeof(char16_t));
CHECK(std::memcmp(b.data(), u"hello", b.size()) == 0);
}
TEST_CASE("const_buffer creation with zbuf string literal char32_t", "[buffer]")
{
using namespace zmq::literals;
constexpr zmq::const_buffer b = U"hello"_zbuf;
CHECK(b.size() == 5 * sizeof(char32_t));
CHECK(std::memcmp(b.data(), U"hello", b.size()) == 0);
}
TEST_CASE("buffer of structs", "[buffer]")
{
struct some_pod
{
int64_t val;
char arr[8];
};
struct some_non_pod
{
int64_t val;
char arr[8];
std::vector<int> s; // not trivially copyable
};
static_assert(zmq::detail::is_pod_like<some_pod>::value, "");
static_assert(!zmq::detail::is_pod_like<some_non_pod>::value, "");
std::array<some_pod, 1> d;
zmq::mutable_buffer b = zmq::buffer(d);
CHECK(b.size() == d.size() * sizeof(some_pod));
CHECK(b.data() == d.data());
}
#endif

View File

@@ -1,210 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq_addon.hpp>
#ifdef ZMQ_CPP11
TEST_CASE("multipart codec empty", "[codec_multipart]")
{
using namespace zmq;
multipart_t mmsg;
message_t msg = mmsg.encode();
CHECK(msg.size() == 0);
multipart_t mmsg2;
mmsg2.decode_append(msg);
CHECK(mmsg2.size() == 0);
}
TEST_CASE("multipart codec small", "[codec_multipart]")
{
using namespace zmq;
multipart_t mmsg;
mmsg.addstr("Hello World");
message_t msg = mmsg.encode();
CHECK(msg.size() == 1 + 11); // small size packing
mmsg.addstr("Second frame");
msg = mmsg.encode();
CHECK(msg.size() == 1 + 11 + 1 + 12);
multipart_t mmsg2;
mmsg2.decode_append(msg);
CHECK(mmsg2.size() == 2);
std::string part0 = mmsg2[0].to_string();
CHECK(part0 == "Hello World");
CHECK(mmsg2[1].to_string() == "Second frame");
}
TEST_CASE("multipart codec big", "[codec_multipart]")
{
using namespace zmq;
message_t big(495); // large size packing
big.data<char>()[0] = 'X';
multipart_t mmsg;
mmsg.pushmem(big.data(), big.size());
message_t msg = mmsg.encode();
CHECK(msg.size() == 5 + 495);
CHECK(msg.data<unsigned char>()[0] == std::numeric_limits<uint8_t>::max());
CHECK(msg.data<unsigned char>()[5] == 'X');
CHECK(mmsg.size() == 1);
mmsg.decode_append(msg);
CHECK(mmsg.size() == 2);
CHECK(mmsg[0].data<char>()[0] == 'X');
}
TEST_CASE("multipart codec decode bad data overflow", "[codec_multipart]")
{
using namespace zmq;
char bad_data[3] = {5, 'h', 'i'};
message_t wrong_size(bad_data, 3);
CHECK(wrong_size.size() == 3);
CHECK(wrong_size.data<char>()[0] == 5);
CHECK_THROWS_AS(
multipart_t::decode(wrong_size),
std::out_of_range);
}
TEST_CASE("multipart codec decode bad data extra data", "[codec_multipart]")
{
using namespace zmq;
char bad_data[3] = {1, 'h', 'i'};
message_t wrong_size(bad_data, 3);
CHECK(wrong_size.size() == 3);
CHECK(wrong_size.data<char>()[0] == 1);
CHECK_THROWS_AS(
multipart_t::decode(wrong_size),
std::out_of_range);
}
// After exercising it, this test is disabled over concern of running
// on hosts which lack enough free memory to allow the absurdly large
// message part to be allocated.
#if 0
TEST_CASE("multipart codec encode too big", "[codec_multipart]")
{
using namespace zmq;
const size_t too_big_size = 1L + std::numeric_limits<uint32_t>::max();
CHECK(too_big_size > std::numeric_limits<uint32_t>::max());
char* too_big_data = new char[too_big_size];
multipart_t mmsg(too_big_data, too_big_size);
delete [] too_big_data;
CHECK(mmsg.size() == 1);
CHECK(mmsg[0].size() > std::numeric_limits<uint32_t>::max());
CHECK_THROWS_AS(
mmsg.encode(),
std::range_error);
}
#endif
TEST_CASE("multipart codec free function with vector of message_t", "[codec_multipart]")
{
using namespace zmq;
std::vector<message_t> parts;
parts.emplace_back("Hello", 5);
parts.emplace_back("World",5);
auto msg = encode(parts);
CHECK(msg.size() == 1 + 5 + 1 + 5 );
CHECK(msg.data<unsigned char>()[0] == 5);
CHECK(msg.data<unsigned char>()[1] == 'H');
CHECK(msg.data<unsigned char>()[6] == 5);
CHECK(msg.data<unsigned char>()[7] == 'W');
std::vector<message_t> parts2;
decode(msg, std::back_inserter(parts2));
CHECK(parts.size() == 2);
CHECK(parts[0].size() == 5);
CHECK(parts[1].size() == 5);
}
TEST_CASE("multipart codec free function with vector of const_buffer", "[codec_multipart]")
{
using namespace zmq;
std::vector<const_buffer> parts;
parts.emplace_back("Hello", 5);
parts.emplace_back("World",5);
auto msg = encode(parts);
CHECK(msg.size() == 1 + 5 + 1 + 5 );
CHECK(msg.data<unsigned char>()[0] == 5);
CHECK(msg.data<unsigned char>()[1] == 'H');
CHECK(msg.data<unsigned char>()[6] == 5);
CHECK(msg.data<unsigned char>()[7] == 'W');
std::vector<message_t> parts2;
decode(msg, std::back_inserter(parts2));
CHECK(parts.size() == 2);
CHECK(parts[0].size() == 5);
CHECK(parts[1].size() == 5);
}
TEST_CASE("multipart codec free function with vector of mutable_buffer", "[codec_multipart]")
{
using namespace zmq;
std::vector<mutable_buffer> parts;
char hello[6] = "Hello";
parts.emplace_back(hello, 5);
char world[6] = "World";
parts.emplace_back(world,5);
auto msg = encode(parts);
CHECK(msg.size() == 1 + 5 + 1 + 5 );
CHECK(msg.data<unsigned char>()[0] == 5);
CHECK(msg.data<unsigned char>()[1] == 'H');
CHECK(msg.data<unsigned char>()[6] == 5);
CHECK(msg.data<unsigned char>()[7] == 'W');
std::vector<message_t> parts2;
decode(msg, std::back_inserter(parts2));
CHECK(parts.size() == 2);
CHECK(parts[0].size() == 5);
CHECK(parts[1].size() == 5);
}
TEST_CASE("multipart codec free function with multipart_t", "[codec_multipart]")
{
using namespace zmq;
multipart_t mmsg;
mmsg.addstr("Hello");
mmsg.addstr("World");
auto msg = encode(mmsg);
CHECK(msg.size() == 1 + 5 + 1 + 5);
CHECK(msg.data<unsigned char>()[0] == 5);
CHECK(msg.data<unsigned char>()[1] == 'H');
CHECK(msg.data<unsigned char>()[6] == 5);
CHECK(msg.data<unsigned char>()[7] == 'W');
multipart_t mmsg2;
decode(msg, std::back_inserter(mmsg2));
CHECK(mmsg2.size() == 2);
CHECK(mmsg2[0].size() == 5);
CHECK(mmsg2[1].size() == 5);
}
TEST_CASE("multipart codec static method decode to multipart_t", "[codec_multipart]")
{
using namespace zmq;
multipart_t mmsg;
mmsg.addstr("Hello");
mmsg.addstr("World");
auto msg = encode(mmsg);
auto mmsg2 = multipart_t::decode(msg);
CHECK(mmsg2.size() == 2);
CHECK(mmsg2[0].size() == 5);
CHECK(mmsg2[1].size() == 5);
}
#endif

View File

@@ -1,84 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq.hpp>
#if (__cplusplus >= 201703L)
static_assert(std::is_nothrow_swappable<zmq::context_t>::value,
"context_t should be nothrow swappable");
#endif
TEST_CASE("context construct default and destroy", "[context]")
{
zmq::context_t context;
}
TEST_CASE("context create, close and destroy", "[context]")
{
zmq::context_t context;
context.close();
CHECK(NULL == context.handle());
}
TEST_CASE("context shutdown", "[context]")
{
zmq::context_t context;
context.shutdown();
CHECK(NULL != context.handle());
context.close();
CHECK(NULL == context.handle());
}
TEST_CASE("context shutdown again", "[context]")
{
zmq::context_t context;
context.shutdown();
context.shutdown();
CHECK(NULL != context.handle());
context.close();
CHECK(NULL == context.handle());
}
#ifdef ZMQ_CPP11
TEST_CASE("context swap", "[context]")
{
zmq::context_t context1;
zmq::context_t context2;
using std::swap;
swap(context1, context2);
}
TEST_CASE("context - use socket after shutdown", "[context]")
{
zmq::context_t context;
zmq::socket_t sock(context, zmq::socket_type::rep);
context.shutdown();
try
{
sock.connect("inproc://test");
zmq::message_t msg;
(void)sock.recv(msg, zmq::recv_flags::dontwait);
REQUIRE(false);
}
catch (const zmq::error_t& e)
{
REQUIRE(e.num() == ETERM);
}
}
TEST_CASE("context set/get options", "[context]")
{
zmq::context_t context;
#if defined(ZMQ_BLOCKY) && defined(ZMQ_IO_THREADS)
context.set(zmq::ctxopt::blocky, false);
context.set(zmq::ctxopt::io_threads, 5);
CHECK(context.get(zmq::ctxopt::io_threads) == 5);
#endif
CHECK_THROWS_AS(
context.set(static_cast<zmq::ctxopt>(-42), 5),
zmq::error_t);
CHECK_THROWS_AS(
context.get(static_cast<zmq::ctxopt>(-42)),
zmq::error_t);
}
#endif

View File

@@ -1,246 +0,0 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <zmq.hpp>
#if defined(ZMQ_CPP11)
static_assert(!std::is_copy_constructible<zmq::message_t>::value,
"message_t should not be copy-constructible");
static_assert(!std::is_copy_assignable<zmq::message_t>::value,
"message_t should not be copy-assignable");
#endif
#if (__cplusplus >= 201703L)
static_assert(std::is_nothrow_swappable<zmq::message_t>::value,
"message_t should be nothrow swappable");
#endif
TEST_CASE("message default constructed", "[message]")
{
const zmq::message_t message;
CHECK(0u == message.size());
CHECK(message.empty());
}
#ifdef ZMQ_CPP11
TEST_CASE("message swap", "[message]")
{
const std::string data = "foo";
zmq::message_t message1;
zmq::message_t message2(data.data(), data.size());
using std::swap;
swap(message1, message2);
CHECK(message1.size() == data.size());
CHECK(message2.size() == 0);
swap(message1, message2);
CHECK(message1.size() == 0);
CHECK(message2.size() == data.size());
}
#endif
namespace
{
const char *const data = "Hi";
}
TEST_CASE("message constructor with iterators", "[message]")
{
const std::string hi(data);
const zmq::message_t hi_msg(hi.begin(), hi.end());
CHECK(2u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}
TEST_CASE("message constructor with size", "[message]")
{
const zmq::message_t msg(5);
CHECK(msg.size() == 5);
}
TEST_CASE("message constructor with buffer and size", "[message]")
{
const std::string hi(data);
const zmq::message_t hi_msg(hi.data(), hi.size());
CHECK(2u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}
TEST_CASE("message constructor with char array", "[message]")
{
const zmq::message_t hi_msg(data, strlen(data));
CHECK(2u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}
#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL)
TEST_CASE("message constructor with container - deprecated", "[message]")
{
zmq::message_t hi_msg("Hi"); // deprecated
REQUIRE(3u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 3));
}
TEST_CASE("message constructor with container of trivial data", "[message]")
{
int buf[3] = {1, 2, 3};
zmq::message_t msg(buf);
REQUIRE(sizeof(buf) == msg.size());
CHECK(0 == memcmp(buf, msg.data(), msg.size()));
}
TEST_CASE("message constructor with strings", "[message]")
{
SECTION("string")
{
const std::string hi(data);
zmq::message_t hi_msg(hi);
CHECK(2u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}
#if CPPZMQ_HAS_STRING_VIEW
SECTION("string_view")
{
const std::string_view hi(data);
zmq::message_t hi_msg(hi);
CHECK(2u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}
#endif
}
#endif
#ifdef ZMQ_HAS_RVALUE_REFS
TEST_CASE("message move constructor", "[message]")
{
zmq::message_t hi_msg(zmq::message_t(data, strlen(data)));
}
TEST_CASE("message assign move empty before", "[message]")
{
zmq::message_t hi_msg;
hi_msg = zmq::message_t(data, strlen(data));
CHECK(2u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}
TEST_CASE("message assign move empty after", "[message]")
{
zmq::message_t hi_msg(data, strlen(data));
CHECK(!hi_msg.empty());
hi_msg = zmq::message_t();
CHECK(0u == hi_msg.size());
CHECK(hi_msg.empty());
}
TEST_CASE("message assign move empty before and after", "[message]")
{
zmq::message_t hi_msg;
hi_msg = zmq::message_t();
CHECK(0u == hi_msg.size());
}
#endif
TEST_CASE("message equality self", "[message]")
{
const zmq::message_t hi_msg(data, strlen(data));
CHECK(hi_msg == hi_msg);
}
TEST_CASE("message equality equal", "[message]")
{
const zmq::message_t hi_msg_a(data, strlen(data));
const zmq::message_t hi_msg_b(data, strlen(data));
CHECK(hi_msg_a == hi_msg_b);
}
TEST_CASE("message equality equal empty", "[message]")
{
const zmq::message_t msg_a;
const zmq::message_t msg_b;
CHECK(msg_a == msg_b);
}
TEST_CASE("message equality non equal", "[message]")
{
const zmq::message_t msg_a("Hi", 2);
const zmq::message_t msg_b("Hello", 5);
CHECK(msg_a != msg_b);
}
TEST_CASE("message equality non equal rhs empty", "[message]")
{
const zmq::message_t msg_a("Hi", 2);
const zmq::message_t msg_b;
CHECK(msg_a != msg_b);
}
TEST_CASE("message equality non equal lhs empty", "[message]")
{
const zmq::message_t msg_a;
const zmq::message_t msg_b("Hi", 2);
CHECK(msg_a != msg_b);
}
TEST_CASE("message to string", "[message]")
{
const zmq::message_t a;
const zmq::message_t b("Foo", 3);
CHECK(a.to_string() == "");
CHECK(b.to_string() == "Foo");
#if CPPZMQ_HAS_STRING_VIEW
CHECK(a.to_string_view() == "");
CHECK(b.to_string_view() == "Foo");
#endif
#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL)
const zmq::message_t depr("Foo"); // deprecated
CHECK(depr.to_string() != "Foo");
CHECK(depr.to_string() == std::string("Foo", 4));
#endif
}
#if defined(ZMQ_BUILD_DRAFT_API) && ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 0)
TEST_CASE("message routing id persists", "[message]")
{
zmq::message_t msg;
msg.set_routing_id(123);
CHECK(123u == msg.routing_id());
}
TEST_CASE("message group persists", "[message]")
{
zmq::message_t msg;
msg.set_group("mygroup");
CHECK(std::string(msg.group()) == "mygroup");
}
#endif
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 2, 0)
TEST_CASE("message is not shared", "[message]")
{
zmq::message_t msg;
CHECK(msg.get(ZMQ_SHARED) == 0);
}
TEST_CASE("message is shared", "[message]")
{
size_t msg_sz = 1024; // large enough to be a type_lmsg
zmq::message_t msg1(msg_sz);
zmq::message_t msg2;
msg2.copy(msg1);
CHECK(msg1.get(ZMQ_SHARED) == 1);
CHECK(msg2.get(ZMQ_SHARED) == 1);
CHECK(msg1.size() == msg_sz);
CHECK(msg2.size() == msg_sz);
}
TEST_CASE("message move is not shared", "[message]")
{
size_t msg_sz = 1024; // large enough to be a type_lmsg
zmq::message_t msg1(msg_sz);
zmq::message_t msg2;
msg2.move(msg1);
CHECK(msg1.get(ZMQ_SHARED) == 0);
CHECK(msg2.get(ZMQ_SHARED) == 0);
CHECK(msg2.size() == msg_sz);
CHECK(msg1.size() == 0);
}
#endif

View File

@@ -1,152 +0,0 @@
#include "testutil.hpp"
#ifdef ZMQ_CPP11
#include <thread>
#include <mutex>
#include <condition_variable>
#include <functional>
class mock_monitor_t : public zmq::monitor_t
{
public:
void on_event_connected(const zmq_event_t &, const char *) ZMQ_OVERRIDE
{
++connected;
++total;
}
int total{0};
int connected{0};
};
#endif
TEST_CASE("monitor create destroy", "[monitor]")
{
zmq::monitor_t monitor;
}
#if defined(ZMQ_CPP11)
TEST_CASE("monitor move construct", "[monitor]")
{
zmq::context_t ctx;
zmq::socket_t sock(ctx, ZMQ_DEALER);
SECTION("move ctor empty") {
zmq::monitor_t monitor1;
zmq::monitor_t monitor2 = std::move(monitor1);
}
SECTION("move ctor init") {
zmq::monitor_t monitor1;
monitor1.init(sock, "inproc://monitor-client");
zmq::monitor_t monitor2 = std::move(monitor1);
}
}
TEST_CASE("monitor move assign", "[monitor]")
{
zmq::context_t ctx;
zmq::socket_t sock(ctx, ZMQ_DEALER);
SECTION("move assign empty") {
zmq::monitor_t monitor1;
zmq::monitor_t monitor2;
monitor1 = std::move(monitor2);
}
SECTION("move assign init") {
zmq::monitor_t monitor1;
monitor1.init(sock, "inproc://monitor-client");
zmq::monitor_t monitor2;
monitor2 = std::move(monitor1);
}
SECTION("move assign init both") {
zmq::monitor_t monitor1;
monitor1.init(sock, "inproc://monitor-client");
zmq::monitor_t monitor2;
zmq::socket_t sock2(ctx, ZMQ_DEALER);
monitor2.init(sock2, "inproc://monitor-client2");
monitor2 = std::move(monitor1);
}
}
TEST_CASE("monitor init event count", "[monitor]")
{
common_server_client_setup s{false};
mock_monitor_t monitor;
const int expected_event_count = 1;
monitor.init(s.client, "inproc://foo");
CHECK_FALSE(monitor.check_event(0));
s.init();
while (monitor.check_event(1000) && monitor.total < expected_event_count) {
}
CHECK(monitor.connected == 1);
CHECK(monitor.total == expected_event_count);
}
TEST_CASE("monitor init abort", "[monitor]")
{
class mock_monitor : public mock_monitor_t
{
public:
mock_monitor(std::function<void(void)> handle_connected) :
handle_connected{std::move(handle_connected)}
{
}
void on_event_connected(const zmq_event_t &e, const char *m) ZMQ_OVERRIDE
{
mock_monitor_t::on_event_connected(e, m);
handle_connected();
}
std::function<void(void)> handle_connected;
};
common_server_client_setup s(false);
std::mutex mutex;
std::condition_variable cond_var;
bool done{false};
mock_monitor monitor([&]()
{
std::lock_guard<std::mutex> lock(mutex);
done = true;
cond_var.notify_one();
});
monitor.init(s.client, "inproc://foo");
auto thread = std::thread([&monitor]
{
while (monitor.check_event(-1)) {
}
});
s.init();
{
std::unique_lock<std::mutex> lock(mutex);
CHECK(cond_var.wait_for(lock, std::chrono::seconds(1),
[&done] { return done; }));
}
CHECK(monitor.connected == 1);
monitor.abort();
thread.join();
}
TEST_CASE("monitor from move assigned socket", "[monitor]")
{
zmq::context_t ctx;
zmq::socket_t sock;
sock = std::move([&ctx] {
zmq::socket_t sock(ctx, ZMQ_DEALER);
return sock;
}());
zmq::monitor_t monitor1;
monitor1.init(sock, "inproc://monitor-client");
// On failure, this test might hang indefinitely instead of immediately
// failing
}
#endif

View File

@@ -1,212 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq_addon.hpp>
#ifdef ZMQ_HAS_RVALUE_REFS
#ifdef ZMQ_CPP17
static_assert(std::is_invocable<decltype(&zmq::multipart_t::send),
zmq::multipart_t *,
zmq::socket_ref,
int>::value,
"Can't multipart_t::send with socket_ref");
static_assert(std::is_invocable<decltype(&zmq::multipart_t::recv),
zmq::multipart_t *,
zmq::socket_ref,
int>::value,
"Can't multipart_t::recv with socket_ref");
#endif
static_assert(std::is_constructible<zmq::multipart_t, zmq::socket_ref>::value,
"Can't construct with socket_ref");
/// \todo split this up into separate test cases
///
TEST_CASE("multipart legacy test", "[multipart]")
{
using namespace zmq;
bool ok = true;
(void) ok;
float num = 0;
(void) num;
std::string str = "";
message_t msg;
// Create two PAIR sockets and connect over inproc
context_t context(1);
socket_t output(context, ZMQ_PAIR);
socket_t input(context, ZMQ_PAIR);
output.bind("inproc://multipart.test");
input.connect("inproc://multipart.test");
// Test send and receive of single-frame message
multipart_t multipart;
assert(multipart.empty());
multipart.push(message_t("Hello", 5));
assert(multipart.size() == 1);
ok = multipart.send(output);
assert(multipart.empty());
assert(ok);
ok = multipart.recv(input);
assert(multipart.size() == 1);
assert(ok);
msg = multipart.pop();
assert(multipart.empty());
assert(std::string(msg.data<char>(), msg.size()) == "Hello");
// Test send and receive of multi-frame message
multipart.addstr("A");
multipart.addstr("BB");
multipart.addstr("CCC");
assert(multipart.size() == 3);
multipart_t copy = multipart.clone();
assert(copy.size() == 3);
ok = copy.send(output);
assert(copy.empty());
assert(ok);
ok = copy.recv(input);
assert(copy.size() == 3);
assert(ok);
assert(copy.equal(&multipart));
// Test equality operators
assert(copy == multipart);
assert(multipart == copy);
multipart.pop();
assert(copy != multipart);
assert(multipart != copy);
multipart_t emptyMessage1 {};
multipart_t emptyMessage2 {};
assert(emptyMessage1 == emptyMessage2);
assert(emptyMessage2 == emptyMessage1);
multipart.clear();
assert(multipart.empty());
// Test message frame manipulation
multipart.add(message_t("Frame5", 6));
multipart.addstr("Frame6");
multipart.addstr("Frame7");
multipart.addtyp(8.0f);
multipart.addmem("Frame9", 6);
multipart.push(message_t("Frame4", 6));
multipart.pushstr("Frame3");
multipart.pushstr("Frame2");
multipart.pushtyp(1.0f);
multipart.pushmem("Frame0", 6);
assert(multipart.size() == 10);
const message_t &front_msg = multipart.front();
assert(multipart.size() == 10);
assert(std::string(front_msg.data<char>(), front_msg.size()) == "Frame0");
const message_t &back_msg = multipart.back();
assert(multipart.size() == 10);
assert(std::string(back_msg.data<char>(), back_msg.size()) == "Frame9");
msg = multipart.remove();
assert(multipart.size() == 9);
assert(std::string(msg.data<char>(), msg.size()) == "Frame9");
msg = multipart.pop();
assert(multipart.size() == 8);
assert(std::string(msg.data<char>(), msg.size()) == "Frame0");
num = multipart.poptyp<float>();
assert(multipart.size() == 7);
assert(num == 1.0f);
str = multipart.popstr();
assert(multipart.size() == 6);
assert(str == "Frame2");
str = multipart.popstr();
assert(multipart.size() == 5);
assert(str == "Frame3");
str = multipart.popstr();
assert(multipart.size() == 4);
assert(str == "Frame4");
str = multipart.popstr();
assert(multipart.size() == 3);
assert(str == "Frame5");
str = multipart.popstr();
assert(multipart.size() == 2);
assert(str == "Frame6");
str = multipart.popstr();
assert(multipart.size() == 1);
assert(str == "Frame7");
num = multipart.poptyp<float>();
assert(multipart.empty());
assert(num == 8.0f);
// Test message constructors and concatenation
multipart_t head("One", 3);
head.addstr("Two");
assert(head.size() == 2);
multipart_t tail(std::string("One-hundred"));
tail.pushstr("Ninety-nine");
assert(tail.size() == 2);
multipart_t tmp(message_t("Fifty", 5));
assert(tmp.size() == 1);
multipart_t mid = multipart_t::create(49.0f);
mid.append(std::move(tmp));
assert(mid.size() == 2);
assert(tmp.empty());
multipart_t merged(std::move(mid));
merged.prepend(std::move(head));
merged.append(std::move(tail));
assert(merged.size() == 6);
assert(head.empty());
assert(tail.empty());
ok = merged.send(output);
assert(merged.empty());
assert(ok);
multipart_t received(input);
assert(received.size() == 6);
str = received.popstr();
assert(received.size() == 5);
assert(str == "One");
str = received.popstr();
assert(received.size() == 4);
assert(str == "Two");
num = received.poptyp<float>();
assert(received.size() == 3);
assert(num == 49.0f);
str = received.popstr();
assert(received.size() == 2);
assert(str == "Fifty");
str = received.popstr();
assert(received.size() == 1);
assert(str == "Ninety-nine");
str = received.popstr();
assert(received.empty());
assert(str == "One-hundred");
}
#endif

View File

@@ -1,356 +0,0 @@
#include "testutil.hpp"
#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL) && defined(ZMQ_HAVE_POLLER)
#include <array>
#include <memory>
#ifdef ZMQ_CPP17
static_assert(std::is_nothrow_swappable_v<zmq::poller_t<>>);
#endif
static_assert(sizeof(zmq_poller_event_t) == sizeof(zmq::poller_event<>), "");
static_assert(sizeof(zmq_poller_event_t) == sizeof(zmq::poller_event<zmq::
no_user_data>), "");
static_assert(sizeof(zmq_poller_event_t) == sizeof(zmq::poller_event<int>), "");
static_assert(alignof(zmq_poller_event_t) == alignof(zmq::poller_event<>), "");
static_assert(alignof(zmq_poller_event_t) == alignof(zmq::poller_event<int>), "");
static_assert(!std::is_copy_constructible<zmq::poller_t<>>::value,
"poller_t should not be copy-constructible");
static_assert(!std::is_copy_assignable<zmq::poller_t<>>::value,
"poller_t should not be copy-assignable");
TEST_CASE("event flags", "[poller]")
{
CHECK((zmq::event_flags::pollin | zmq::event_flags::pollout)
== static_cast<zmq::event_flags>(ZMQ_POLLIN | ZMQ_POLLOUT));
CHECK((zmq::event_flags::pollin & zmq::event_flags::pollout)
== static_cast<zmq::event_flags>(ZMQ_POLLIN & ZMQ_POLLOUT));
CHECK((zmq::event_flags::pollin ^ zmq::event_flags::pollout)
== static_cast<zmq::event_flags>(ZMQ_POLLIN ^ ZMQ_POLLOUT));
CHECK(~zmq::event_flags::pollin == static_cast<zmq::event_flags>(~ZMQ_POLLIN));
}
TEST_CASE("poller create destroy", "[poller]")
{
zmq::poller_t<> a;
#ifdef ZMQ_CPP17 // CTAD
zmq::poller_t b;
zmq::poller_event e;
#endif
}
TEST_CASE("poller move construct empty", "[poller]")
{
zmq::poller_t<> a;
zmq::poller_t<> b = std::move(a);
}
TEST_CASE("poller move assign empty", "[poller]")
{
zmq::poller_t<> a;
zmq::poller_t<> b;
b = std::move(a);
}
TEST_CASE("poller swap", "[poller]")
{
zmq::poller_t<> a;
zmq::poller_t<> b;
using std::swap;
swap(a, b);
}
TEST_CASE("poller move construct non empty", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> a;
a.add(socket, zmq::event_flags::pollin);
zmq::poller_t<> b = std::move(a);
}
TEST_CASE("poller move assign non empty", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> a;
a.add(socket, zmq::event_flags::pollin);
zmq::poller_t<> b;
b = std::move(a);
}
TEST_CASE("poller add nullptr", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<void> poller;
CHECK_NOTHROW(poller.add(socket, zmq::event_flags::pollin, nullptr));
}
TEST_CASE("poller add non nullptr", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<int> poller;
int i;
CHECK_NOTHROW(poller.add(socket, zmq::event_flags::pollin, &i));
}
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 0)
// this behaviour was added by https://github.com/zeromq/libzmq/pull/3100
TEST_CASE("poller add handler invalid events type", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> poller;
short invalid_events_type = 2 << 10;
CHECK_THROWS_AS(
poller.add(socket, static_cast<zmq::event_flags>(invalid_events_type)),
zmq::error_t);
}
#endif
TEST_CASE("poller add handler twice throws", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> poller;
poller.add(socket, zmq::event_flags::pollin);
/// \todo the actual error code should be checked
CHECK_THROWS_AS(poller.add(socket, zmq::event_flags::pollin),
zmq::error_t);
}
TEST_CASE("poller wait with no handlers throws", "[poller]")
{
zmq::poller_t<> poller;
std::vector<zmq::poller_event<>> events;
/// \todo the actual error code should be checked
CHECK_THROWS_AS(poller.wait_all(events, std::chrono::milliseconds{10}),
zmq::error_t);
}
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 3, 3)
TEST_CASE("poller add/remove size checks", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> poller;
CHECK(poller.size() == 0);
poller.add(socket, zmq::event_flags::pollin);
CHECK(poller.size() == 1);
CHECK_NOTHROW(poller.remove(socket));
CHECK(poller.size() == 0);
}
#endif
TEST_CASE("poller remove unregistered throws", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> poller;
/// \todo the actual error code should be checked
CHECK_THROWS_AS(poller.remove(socket), zmq::error_t);
}
TEST_CASE("poller remove registered empty", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> poller;
poller.add(socket, zmq::event_flags::pollin);
CHECK_NOTHROW(poller.remove(socket));
}
TEST_CASE("poller remove registered non empty", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<int> poller;
int empty{};
poller.add(socket, zmq::event_flags::pollin, &empty);
CHECK_NOTHROW(poller.remove(socket));
}
const std::string hi_str = "Hi";
TEST_CASE("poller poll basic", "[poller]")
{
common_server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::poller_t<int> poller;
std::vector<zmq::poller_event<int>> events{1};
int i = 0;
CHECK_NOTHROW(poller.add(s.server, zmq::event_flags::pollin, &i));
CHECK(1 == poller.wait_all(events, std::chrono::milliseconds{-1}));
CHECK(s.server == events[0].socket);
CHECK(&i == events[0].user_data);
}
TEST_CASE("poller add invalid socket throws", "[poller]")
{
zmq::context_t context;
zmq::poller_t<> poller;
zmq::socket_t a{context, zmq::socket_type::router};
zmq::socket_t b{std::move(a)};
CHECK_THROWS_AS(poller.add(a, zmq::event_flags::pollin), zmq::error_t);
}
TEST_CASE("poller remove invalid socket throws", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::router};
zmq::poller_t<> poller;
CHECK_NOTHROW(poller.add(socket, zmq::event_flags::pollin));
std::vector<zmq::socket_t> sockets;
sockets.emplace_back(std::move(socket));
CHECK_THROWS_AS(poller.remove(socket), zmq::error_t);
CHECK_NOTHROW(poller.remove(sockets[0]));
}
TEST_CASE("poller modify empty throws", "[poller]")
{
zmq::context_t context;
zmq::socket_t socket{context, zmq::socket_type::push};
zmq::poller_t<> poller;
CHECK_THROWS_AS(poller.modify(socket, zmq::event_flags::pollin),
zmq::error_t);
}
TEST_CASE("poller modify invalid socket throws", "[poller]")
{
zmq::context_t context;
zmq::socket_t a{context, zmq::socket_type::push};
zmq::socket_t b{std::move(a)};
zmq::poller_t<> poller;
CHECK_THROWS_AS(poller.modify(a, zmq::event_flags::pollin), zmq::error_t);
}
TEST_CASE("poller modify not added throws", "[poller]")
{
zmq::context_t context;
zmq::socket_t a{context, zmq::socket_type::push};
zmq::socket_t b{context, zmq::socket_type::push};
zmq::poller_t<> poller;
CHECK_NOTHROW(poller.add(a, zmq::event_flags::pollin));
CHECK_THROWS_AS(poller.modify(b, zmq::event_flags::pollin), zmq::error_t);
}
TEST_CASE("poller modify simple", "[poller]")
{
zmq::context_t context;
zmq::socket_t a{context, zmq::socket_type::push};
zmq::poller_t<> poller;
CHECK_NOTHROW(poller.add(a, zmq::event_flags::pollin));
CHECK_NOTHROW(
poller.modify(a, zmq::event_flags::pollin | zmq::event_flags::pollout));
}
TEST_CASE("poller poll client server", "[poller]")
{
// Setup server and client
common_server_client_setup s;
// Setup poller
zmq::poller_t<zmq::socket_t> poller;
CHECK_NOTHROW(poller.add(s.server, zmq::event_flags::pollin, &s.server));
// client sends message
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
// wait for message and verify events
std::vector<zmq::poller_event<zmq::socket_t>> events(1);
CHECK(1 == poller.wait_all(events, std::chrono::milliseconds{500}));
CHECK(zmq::event_flags::pollin == events[0].events);
// Modify server socket with pollout flag
CHECK_NOTHROW(
poller.modify(s.server, zmq::event_flags::pollin | zmq::event_flags::pollout
));
CHECK(1 == poller.wait_all(events, std::chrono::milliseconds{500}));
CHECK((zmq::event_flags::pollin | zmq::event_flags::pollout) == events[0].events)
;
}
TEST_CASE("poller wait one return", "[poller]")
{
// Setup server and client
common_server_client_setup s;
// Setup poller
zmq::poller_t<> poller;
CHECK_NOTHROW(poller.add(s.server, zmq::event_flags::pollin));
// client sends message
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
// wait for message and verify events
std::vector<zmq::poller_event<>> events(1);
CHECK(1 == poller.wait_all(events, std::chrono::milliseconds{500}));
}
TEST_CASE("poller wait on move constructed", "[poller]")
{
common_server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::poller_t<> a;
CHECK_NOTHROW(a.add(s.server, zmq::event_flags::pollin));
zmq::poller_t<> b{std::move(a)};
std::vector<zmq::poller_event<>> events(1);
/// \todo the actual error code should be checked
CHECK_THROWS_AS(a.wait_all(events, std::chrono::milliseconds{10}),
zmq::error_t);
CHECK(1 == b.wait_all(events, std::chrono::milliseconds{-1}));
}
TEST_CASE("poller wait on move assigned", "[poller]")
{
common_server_client_setup s;
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
zmq::poller_t<> a;
CHECK_NOTHROW(a.add(s.server, zmq::event_flags::pollin));
zmq::poller_t<> b;
b = {std::move(a)};
/// \todo the TEST_CASE error code should be checked
std::vector<zmq::poller_event<>> events(1);
CHECK_THROWS_AS(a.wait_all(events, std::chrono::milliseconds{10}),
zmq::error_t);
CHECK(1 == b.wait_all(events, std::chrono::milliseconds{-1}));
}
TEST_CASE("poller remove from handler", "[poller]")
{
constexpr size_t ITER_NO = 10;
// Setup servers and clients
std::vector<common_server_client_setup> setup_list;
for (size_t i = 0; i < ITER_NO; ++i)
setup_list.emplace_back(common_server_client_setup{});
// Setup poller
zmq::poller_t<> poller;
for (size_t i = 0; i < ITER_NO; ++i) {
CHECK_NOTHROW(poller.add(setup_list[i].server, zmq::event_flags::pollin));
}
// Clients send messages
for (auto &s : setup_list) {
CHECK_NOTHROW(s.client.send(zmq::message_t{hi_str}, zmq::send_flags::none));
}
// Wait for all servers to receive a message
for (auto &s : setup_list) {
zmq::pollitem_t items[] = {{s.server, 0, ZMQ_POLLIN, 0}};
zmq::poll(&items[0], 1);
}
// Fire all handlers in one wait
std::vector<zmq::poller_event<>> events(ITER_NO);
CHECK(ITER_NO == poller.wait_all(events, std::chrono::milliseconds{-1}));
}
#endif

View File

@@ -1,139 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq_addon.hpp>
#ifdef ZMQ_CPP11
TEST_CASE("recv_multipart test", "[recv_multipart]")
{
zmq::context_t context(1);
zmq::socket_t output(context, ZMQ_PAIR);
zmq::socket_t input(context, ZMQ_PAIR);
output.bind("inproc://multipart.test");
input.connect("inproc://multipart.test");
SECTION("send 1 message") {
input.send(zmq::str_buffer("hello"));
std::vector<zmq::message_t> msgs;
auto ret = zmq::recv_multipart(output, std::back_inserter(msgs));
REQUIRE(ret);
CHECK(*ret == 1);
REQUIRE(msgs.size() == 1);
CHECK(msgs[0].size() == 5);
}
SECTION("send 2 messages") {
input.send(zmq::str_buffer("hello"), zmq::send_flags::sndmore);
input.send(zmq::str_buffer("world!"));
std::vector<zmq::message_t> msgs;
auto ret = zmq::recv_multipart(output, std::back_inserter(msgs));
REQUIRE(ret);
CHECK(*ret == 2);
REQUIRE(msgs.size() == 2);
CHECK(msgs[0].size() == 5);
CHECK(msgs[1].size() == 6);
}
SECTION("send no messages, dontwait") {
std::vector<zmq::message_t> msgs;
auto ret = zmq::recv_multipart(output, std::back_inserter(msgs),
zmq::recv_flags::dontwait);
CHECK_FALSE(ret);
REQUIRE(msgs.size() == 0);
}
SECTION("send 1 partial message, dontwait") {
input.send(zmq::str_buffer("hello"), zmq::send_flags::sndmore);
std::vector<zmq::message_t> msgs;
auto ret = zmq::recv_multipart(output, std::back_inserter(msgs),
zmq::recv_flags::dontwait);
CHECK_FALSE(ret);
REQUIRE(msgs.size() == 0);
}
SECTION("recv with invalid socket") {
std::vector<zmq::message_t> msgs;
CHECK_THROWS_AS(
zmq::recv_multipart(zmq::socket_ref(), std::back_inserter(msgs)),
zmq::error_t);
}
}
TEST_CASE("recv_multipart_n test", "[recv_multipart]")
{
zmq::context_t context(1);
zmq::socket_t output(context, ZMQ_PAIR);
zmq::socket_t input(context, ZMQ_PAIR);
output.bind("inproc://multipart.test");
input.connect("inproc://multipart.test");
SECTION("send 1 message") {
input.send(zmq::str_buffer("hello"));
std::array<zmq::message_t, 1> msgs;
auto ret = zmq::recv_multipart_n(output, msgs.data(), msgs.size());
REQUIRE(ret);
CHECK(*ret == 1);
CHECK(msgs[0].size() == 5);
}
SECTION("send 1 message 2") {
input.send(zmq::str_buffer("hello"));
std::array<zmq::message_t, 2> msgs;
auto ret = zmq::recv_multipart_n(output, msgs.data(), msgs.size());
REQUIRE(ret);
CHECK(*ret == 1);
CHECK(msgs[0].size() == 5);
CHECK(msgs[1].size() == 0);
}
SECTION("send 2 messages, recv 1") {
input.send(zmq::str_buffer("hello"), zmq::send_flags::sndmore);
input.send(zmq::str_buffer("world!"));
std::array<zmq::message_t, 1> msgs;
CHECK_THROWS_AS(
zmq::recv_multipart_n(output, msgs.data(), msgs.size()),
std::runtime_error);
}
SECTION("recv 0") {
input.send(zmq::str_buffer("hello"), zmq::send_flags::sndmore);
input.send(zmq::str_buffer("world!"));
std::array<zmq::message_t, 1> msgs;
CHECK_THROWS_AS(
zmq::recv_multipart_n(output, msgs.data(), 0),
std::runtime_error);
}
SECTION("send 2 messages") {
input.send(zmq::str_buffer("hello"), zmq::send_flags::sndmore);
input.send(zmq::str_buffer("world!"));
std::array<zmq::message_t, 2> msgs;
auto ret = zmq::recv_multipart_n(output, msgs.data(), msgs.size());
REQUIRE(ret);
CHECK(*ret == 2);
CHECK(msgs[0].size() == 5);
CHECK(msgs[1].size() == 6);
}
SECTION("send no messages, dontwait") {
std::array<zmq::message_t, 1> msgs;
auto ret = zmq::recv_multipart_n(output, msgs.data(), msgs.size(),
zmq::recv_flags::dontwait);
CHECK_FALSE(ret);
REQUIRE(msgs[0].size() == 0);
}
SECTION("send 1 partial message, dontwait") {
input.send(zmq::str_buffer("hello"), zmq::send_flags::sndmore);
std::array<zmq::message_t, 1> msgs;
auto ret = zmq::recv_multipart_n(output, msgs.data(), msgs.size(),
zmq::recv_flags::dontwait);
CHECK_FALSE(ret);
REQUIRE(msgs[0].size() == 0);
}
SECTION("recv with invalid socket") {
std::array<zmq::message_t, 1> msgs;
CHECK_THROWS_AS(
zmq::recv_multipart_n(zmq::socket_ref(), msgs.data(), msgs.size()),
zmq::error_t);
}
}
#endif

View File

@@ -1,121 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq_addon.hpp>
#ifdef ZMQ_CPP11
#include <forward_list>
TEST_CASE("send_multipart test", "[send_multipart]")
{
zmq::context_t context(1);
zmq::socket_t output(context, ZMQ_PAIR);
zmq::socket_t input(context, ZMQ_PAIR);
output.bind("inproc://multipart.test");
input.connect("inproc://multipart.test");
SECTION("send 0 messages") {
std::vector<zmq::message_t> imsgs;
auto iret = zmq::send_multipart(input, imsgs);
REQUIRE(iret);
CHECK(*iret == 0);
}
SECTION("send 1 message") {
std::array<zmq::message_t, 1> imsgs = {zmq::message_t(3)};
auto iret = zmq::send_multipart(input, imsgs);
REQUIRE(iret);
CHECK(*iret == 1);
std::vector<zmq::message_t> omsgs;
auto oret = zmq::recv_multipart(output, std::back_inserter(omsgs));
REQUIRE(oret);
CHECK(*oret == 1);
REQUIRE(omsgs.size() == 1);
CHECK(omsgs[0].size() == 3);
}
SECTION("send 2 messages") {
std::array<zmq::message_t, 2> imsgs = {zmq::message_t(3), zmq::message_t(4)};
auto iret = zmq::send_multipart(input, imsgs);
REQUIRE(iret);
CHECK(*iret == 2);
std::vector<zmq::message_t> omsgs;
auto oret = zmq::recv_multipart(output, std::back_inserter(omsgs));
REQUIRE(oret);
CHECK(*oret == 2);
REQUIRE(omsgs.size() == 2);
CHECK(omsgs[0].size() == 3);
CHECK(omsgs[1].size() == 4);
}
SECTION("send 2 messages, const_buffer") {
std::array<zmq::const_buffer, 2> imsgs = {zmq::str_buffer("foo"),
zmq::str_buffer("bar!")};
auto iret = zmq::send_multipart(input, imsgs);
REQUIRE(iret);
CHECK(*iret == 2);
std::vector<zmq::message_t> omsgs;
auto oret = zmq::recv_multipart(output, std::back_inserter(omsgs));
REQUIRE(oret);
CHECK(*oret == 2);
REQUIRE(omsgs.size() == 2);
CHECK(omsgs[0].size() == 3);
CHECK(omsgs[1].size() == 4);
}
SECTION("send 2 messages, mutable_buffer") {
char buf[4] = {};
std::array<zmq::mutable_buffer, 2> imsgs = {
zmq::buffer(buf, 3), zmq::buffer(buf)};
auto iret = zmq::send_multipart(input, imsgs);
REQUIRE(iret);
CHECK(*iret == 2);
std::vector<zmq::message_t> omsgs;
auto oret = zmq::recv_multipart(output, std::back_inserter(omsgs));
REQUIRE(oret);
CHECK(*oret == 2);
REQUIRE(omsgs.size() == 2);
CHECK(omsgs[0].size() == 3);
CHECK(omsgs[1].size() == 4);
}
SECTION("send 2 messages, dontwait") {
zmq::socket_t push(context, ZMQ_PUSH);
push.bind("inproc://multipart.test.push");
std::array<zmq::message_t, 2> imsgs = {zmq::message_t(3), zmq::message_t(4)};
auto iret = zmq::send_multipart(push, imsgs, zmq::send_flags::dontwait);
REQUIRE_FALSE(iret);
}
SECTION("send, misc. containers") {
std::vector<zmq::message_t> msgs_vec;
msgs_vec.emplace_back(3);
msgs_vec.emplace_back(4);
auto iret = zmq::send_multipart(input, msgs_vec);
REQUIRE(iret);
CHECK(*iret == 2);
std::forward_list<zmq::message_t> msgs_list;
msgs_list.emplace_front(4);
msgs_list.emplace_front(3);
iret = zmq::send_multipart(input, msgs_list);
REQUIRE(iret);
CHECK(*iret == 2);
// init. list
const auto msgs_il = {zmq::str_buffer("foo"), zmq::str_buffer("bar!")};
iret = zmq::send_multipart(input, msgs_il);
REQUIRE(iret);
CHECK(*iret == 2);
// rvalue
iret = zmq::send_multipart(input,
std::initializer_list<zmq::const_buffer>{
zmq::str_buffer("foo"),
zmq::str_buffer("bar!")});
REQUIRE(iret);
CHECK(*iret == 2);
}
SECTION("send with invalid socket") {
std::vector<zmq::message_t> msgs(1);
CHECK_THROWS_AS(zmq::send_multipart(zmq::socket_ref(), msgs),
zmq::error_t);
}
}
#endif

View File

@@ -1,700 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq.hpp>
#ifdef ZMQ_CPP11
#include <future>
#endif
#if (__cplusplus >= 201703L)
static_assert(std::is_nothrow_swappable<zmq::socket_t>::value,
"socket_t should be nothrow swappable");
#endif
TEST_CASE("socket default ctor", "[socket]")
{
zmq::socket_t socket;
}
TEST_CASE("socket create destroy", "[socket]")
{
zmq::context_t context;
zmq::socket_t socket(context, ZMQ_ROUTER);
}
#ifdef ZMQ_CPP11
TEST_CASE("socket create assign", "[socket]")
{
zmq::context_t context;
zmq::socket_t socket(context, ZMQ_ROUTER);
CHECK(static_cast<bool>(socket));
CHECK(socket.handle() != nullptr);
socket = {};
CHECK(!static_cast<bool>(socket));
CHECK(socket.handle() == nullptr);
}
TEST_CASE("socket create by enum and destroy", "[socket]")
{
zmq::context_t context;
zmq::socket_t socket(context, zmq::socket_type::router);
}
TEST_CASE("socket swap", "[socket]")
{
zmq::context_t context;
zmq::socket_t socket1(context, zmq::socket_type::router);
zmq::socket_t socket2(context, zmq::socket_type::dealer);
using std::swap;
swap(socket1, socket2);
}
#ifdef ZMQ_CPP11
TEST_CASE("socket options", "[socket]")
{
zmq::context_t context;
zmq::socket_t socket(context, zmq::socket_type::router);
#ifdef ZMQ_IMMEDIATE
socket.set(zmq::sockopt::immediate, 0);
socket.set(zmq::sockopt::immediate, false);
CHECK(socket.get(zmq::sockopt::immediate) == false);
// unit out of range
CHECK_THROWS_AS(socket.set(zmq::sockopt::immediate, 80), zmq::error_t);
#endif
#ifdef ZMQ_LINGER
socket.set(zmq::sockopt::linger, 55);
CHECK(socket.get(zmq::sockopt::linger) == 55);
#endif
#ifdef ZMQ_ROUTING_ID
const std::string id = "foobar";
socket.set(zmq::sockopt::routing_id, "foobar");
socket.set(zmq::sockopt::routing_id, zmq::buffer(id));
socket.set(zmq::sockopt::routing_id, id);
#if CPPZMQ_HAS_STRING_VIEW
socket.set(zmq::sockopt::routing_id, std::string_view{id});
#endif
std::string id_ret(10, ' ');
auto size = socket.get(zmq::sockopt::routing_id, zmq::buffer(id_ret));
id_ret.resize(size);
CHECK(id == id_ret);
auto stropt = socket.get(zmq::sockopt::routing_id);
CHECK(id == stropt);
std::string id_ret_small(3, ' ');
// truncated
CHECK_THROWS_AS(socket.get(zmq::sockopt::routing_id, zmq::buffer(id_ret_small)),
zmq::error_t);
#endif
}
template<class T>
void check_array_opt(T opt,
zmq::socket_t &sock,
std::string info,
bool set_only = false)
{
const std::string val = "foobar";
INFO("setting " + info);
sock.set(opt, val);
if (set_only)
return;
INFO("getting " + info);
auto s = sock.get(opt);
CHECK(s == val);
}
template<class T>
void check_array_opt_get(T opt, zmq::socket_t &sock, std::string info)
{
INFO("getting " + info);
(void) sock.get(opt);
}
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 0)
template<class T> void check_bin_z85(T opt, zmq::socket_t &sock, std::string str_val)
{
std::vector<uint8_t> bin_val(32);
const auto dret = zmq_z85_decode(bin_val.data(), str_val.c_str());
CHECK(dret != nullptr);
sock.set(opt, str_val);
sock.set(opt, zmq::buffer(bin_val));
auto sv = sock.get(opt);
CHECK(sv == str_val);
auto bv = sock.get(opt, 32);
REQUIRE(bv.size() == bin_val.size());
CHECK(std::memcmp(bv.data(), bin_val.data(), bin_val.size()) == 0);
}
#endif
TEST_CASE("socket check array options", "[socket]")
{
zmq::context_t context;
zmq::socket_t router(context, zmq::socket_type::router);
zmq::socket_t xpub(context, zmq::socket_type::xpub);
zmq::socket_t sub(context, zmq::socket_type::sub);
#ifdef ZMQ_BINDTODEVICE
// requires setting CAP_NET_RAW
//check_array_opt(zmq::sockopt::bindtodevice, router, "bindtodevice");
#endif
#ifdef ZMQ_CONNECT_ROUTING_ID
check_array_opt(zmq::sockopt::connect_routing_id, router, "connect_routing_id",
true);
#endif
#ifdef ZMQ_LAST_ENDPOINT
check_array_opt_get(zmq::sockopt::last_endpoint, router, "last_endpoint");
#endif
#ifdef ZMQ_METADATA
router.set(zmq::sockopt::metadata, zmq::str_buffer("X-foo:bar"));
#endif
#ifdef ZMQ_PLAIN_PASSWORD
check_array_opt(zmq::sockopt::plain_password, router, "plain_password");
#endif
#ifdef ZMQ_PLAIN_USERNAME
check_array_opt(zmq::sockopt::plain_username, router, "plain_username");
#endif
#ifdef ZMQ_ROUTING_ID
check_array_opt(zmq::sockopt::routing_id, router, "routing_id");
#endif
#ifdef ZMQ_SOCKS_PROXY
check_array_opt(zmq::sockopt::socks_proxy, router, "socks_proxy");
#endif
#ifdef ZMQ_SUBSCRIBE
check_array_opt(zmq::sockopt::subscribe, sub, "subscribe", true);
#endif
#ifdef ZMQ_UNSUBSCRIBE
check_array_opt(zmq::sockopt::unsubscribe, sub, "unsubscribe", true);
#endif
#ifdef ZMQ_XPUB_WELCOME_MSG
check_array_opt(zmq::sockopt::xpub_welcome_msg, xpub, "xpub_welcome_msg", true);
#endif
#ifdef ZMQ_ZAP_DOMAIN
check_array_opt(zmq::sockopt::zap_domain, router, "zap_domain");
#endif
// curve
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 0, 0) && defined(ZMQ_HAS_CAPABILITIES)
if (zmq_has("curve") == 1) {
const std::string spk = "rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7";
const std::string ssk = "JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6";
const std::string cpk = "Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID";
const std::string csk = "D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs";
zmq::socket_t curve_server(context, zmq::socket_type::router);
curve_server.set(zmq::sockopt::curve_server, true);
CHECK(curve_server.get(zmq::sockopt::curve_server));
check_bin_z85(zmq::sockopt::curve_secretkey, curve_server, ssk);
zmq::socket_t curve_client(context, zmq::socket_type::router);
curve_client.set(zmq::sockopt::curve_server, false);
CHECK_FALSE(curve_client.get(zmq::sockopt::curve_server));
check_bin_z85(zmq::sockopt::curve_serverkey, curve_client, spk);
check_bin_z85(zmq::sockopt::curve_publickey, curve_client, cpk);
check_bin_z85(zmq::sockopt::curve_secretkey, curve_client, csk);
}
#endif
// gssapi
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 1, 0) && defined(ZMQ_HAS_CAPABILITIES)
if (zmq_has("gssapi") == 1 && false) // TODO enable
{
zmq::socket_t gss_server(context, zmq::socket_type::router);
gss_server.set(zmq::sockopt::gssapi_server, true);
CHECK(gss_server.get(zmq::sockopt::gssapi_server) == 1);
gss_server.set(zmq::sockopt::gssapi_plaintext, false);
CHECK(gss_server.get(zmq::sockopt::gssapi_plaintext) == 0);
check_array_opt(zmq::sockopt::gssapi_principal, gss_server,
"gssapi_principal");
zmq::socket_t gss_client(context, zmq::socket_type::router);
CHECK(gss_client.get(zmq::sockopt::gssapi_server) == 0);
check_array_opt(zmq::sockopt::gssapi_principal, gss_client,
"gssapi_principal");
check_array_opt(zmq::sockopt::gssapi_service_principal, gss_client,
"gssapi_service_principal");
}
#endif
}
template<class T, class Opt>
void check_integral_opt(Opt opt,
zmq::socket_t &sock,
std::string info,
bool set_only = false)
{
const T val = 1;
INFO("setting " + info);
sock.set(opt, val);
if (set_only)
return;
INFO("getting " + info);
auto s = sock.get(opt);
CHECK(s == val);
}
template<class T, class Opt>
void check_integral_opt_get(Opt opt, zmq::socket_t &sock, std::string info)
{
INFO("getting " + info);
(void) sock.get(opt);
}
TEST_CASE("socket check integral options", "[socket]")
{
zmq::context_t context;
zmq::socket_t router(context, zmq::socket_type::router);
zmq::socket_t xpub(context, zmq::socket_type::xpub);
zmq::socket_t req(context, zmq::socket_type::req);
#ifdef ZMQ_STREAM_NOTIFY
zmq::socket_t stream(context, zmq::socket_type::stream);
#endif
#ifdef ZMQ_AFFINITY
check_integral_opt<uint64_t>(zmq::sockopt::affinity, router, "affinity");
#endif
#ifdef ZMQ_BACKLOG
check_integral_opt<int>(zmq::sockopt::backlog, router, "backlog");
#endif
#ifdef ZMQ_CONFLATE
check_integral_opt<int>(zmq::sockopt::conflate, router, "conflate");
#endif
#ifdef ZMQ_CONNECT_TIMEOUT
check_integral_opt<int>(zmq::sockopt::connect_timeout, router,
"connect_timeout");
#endif
#ifdef ZMQ_EVENTS
check_integral_opt_get<int>(zmq::sockopt::events, router, "events");
#endif
#ifdef ZMQ_FD
check_integral_opt_get<zmq::fd_t>(zmq::sockopt::fd, router, "fd");
#endif
#ifdef ZMQ_HANDSHAKE_IVL
check_integral_opt<int>(zmq::sockopt::handshake_ivl, router, "handshake_ivl");
#endif
#ifdef ZMQ_HEARTBEAT_IVL
check_integral_opt<int>(zmq::sockopt::heartbeat_ivl, router, "heartbeat_ivl");
#endif
#ifdef ZMQ_HEARTBEAT_TIMEOUT
check_integral_opt<int>(zmq::sockopt::heartbeat_timeout, router,
"heartbeat_timeout");
#endif
#ifdef ZMQ_HEARTBEAT_TTL
router.set(zmq::sockopt::heartbeat_ttl, 100);
CHECK(router.get(zmq::sockopt::heartbeat_ttl) == 100);
#endif
#ifdef ZMQ_IMMEDIATE
check_integral_opt<int>(zmq::sockopt::immediate, router, "immediate");
#endif
#ifdef ZMQ_INVERT_MATCHING
check_integral_opt<int>(zmq::sockopt::invert_matching, router,
"invert_matching");
#endif
#ifdef ZMQ_IPV6
check_integral_opt<int>(zmq::sockopt::ipv6, router, "ipv6");
#endif
#ifdef ZMQ_LINGER
check_integral_opt<int>(zmq::sockopt::linger, router, "linger");
#endif
#ifdef ZMQ_MAXMSGSIZE
check_integral_opt<int64_t>(zmq::sockopt::maxmsgsize, router, "maxmsgsize");
#endif
#ifdef ZMQ_MECHANISM
check_integral_opt_get<int>(zmq::sockopt::mechanism, router, "mechanism");
#endif
#ifdef ZMQ_MULTICAST_HOPS
check_integral_opt<int>(zmq::sockopt::multicast_hops, router, "multicast_hops");
#endif
#ifdef ZMQ_MULTICAST_LOOP
check_integral_opt<int>(zmq::sockopt::multicast_loop, router, "multicast_loop");
#endif
#ifdef ZMQ_MULTICAST_MAXTPDU
check_integral_opt<int>(zmq::sockopt::multicast_maxtpdu, router,
"multicast_maxtpdu");
#endif
#ifdef ZMQ_PLAIN_SERVER
check_integral_opt<int>(zmq::sockopt::plain_server, router, "plain_server");
#endif
#ifdef ZMQ_USE_FD
check_integral_opt<int>(zmq::sockopt::use_fd, router, "use_fd");
#endif
#ifdef ZMQ_PROBE_ROUTER
check_integral_opt<int>(zmq::sockopt::probe_router, router, "probe_router",
true);
#endif
#ifdef ZMQ_RATE
check_integral_opt<int>(zmq::sockopt::rate, router, "rate");
#endif
#ifdef ZMQ_RCVBUF
check_integral_opt<int>(zmq::sockopt::rcvbuf, router, "rcvbuf");
#endif
#ifdef ZMQ_RCVHWM
check_integral_opt<int>(zmq::sockopt::rcvhwm, router, "rcvhwm");
#endif
#ifdef ZMQ_RCVMORE
check_integral_opt_get<int>(zmq::sockopt::rcvmore, router, "rcvmore");
#endif
#ifdef ZMQ_RCVTIMEO
check_integral_opt<int>(zmq::sockopt::rcvtimeo, router, "rcvtimeo");
#endif
#ifdef ZMQ_RECONNECT_IVL
check_integral_opt<int>(zmq::sockopt::reconnect_ivl, router, "reconnect_ivl");
#endif
#ifdef ZMQ_RECONNECT_IVL_MAX
check_integral_opt<int>(zmq::sockopt::reconnect_ivl_max, router,
"reconnect_ivl_max");
#endif
#ifdef ZMQ_RECOVERY_IVL
check_integral_opt<int>(zmq::sockopt::recovery_ivl, router, "recovery_ivl");
#endif
#ifdef ZMQ_REQ_CORRELATE
check_integral_opt<int>(zmq::sockopt::req_correlate, req, "req_correlate", true);
#endif
#ifdef ZMQ_REQ_RELAXED
check_integral_opt<int>(zmq::sockopt::req_relaxed, req, "req_relaxed", true);
#endif
#ifdef ZMQ_ROUTER_HANDOVER
check_integral_opt<int>(zmq::sockopt::router_handover, router, "router_handover",
true);
#endif
#ifdef ZMQ_ROUTER_MANDATORY
check_integral_opt<int>(zmq::sockopt::router_mandatory, router,
"router_mandatory", true);
#endif
#ifdef ZMQ_ROUTER_NOTIFY
check_integral_opt<int>(zmq::sockopt::router_notify, router, "router_notify");
#endif
#ifdef ZMQ_SNDBUF
check_integral_opt<int>(zmq::sockopt::sndbuf, router, "sndbuf");
#endif
#ifdef ZMQ_SNDHWM
check_integral_opt<int>(zmq::sockopt::sndhwm, router, "sndhwm");
#endif
#ifdef ZMQ_SNDTIMEO
check_integral_opt<int>(zmq::sockopt::sndtimeo, router, "sndtimeo");
#endif
#ifdef ZMQ_STREAM_NOTIFY
check_integral_opt<int>(zmq::sockopt::stream_notify, stream, "stream_notify",
true);
#endif
#ifdef ZMQ_TCP_KEEPALIVE
check_integral_opt<int>(zmq::sockopt::tcp_keepalive, router, "tcp_keepalive");
#endif
#ifdef ZMQ_TCP_KEEPALIVE_CNT
check_integral_opt<int>(zmq::sockopt::tcp_keepalive_cnt, router,
"tcp_keepalive_cnt");
#endif
#ifdef ZMQ_TCP_KEEPALIVE_IDLE
check_integral_opt<int>(zmq::sockopt::tcp_keepalive_idle, router,
"tcp_keepalive_idle");
#endif
#ifdef ZMQ_TCP_KEEPALIVE_INTVL
check_integral_opt<int>(zmq::sockopt::tcp_keepalive_intvl, router,
"tcp_keepalive_intvl");
#endif
#ifdef ZMQ_TCP_MAXRT
check_integral_opt<int>(zmq::sockopt::tcp_maxrt, router, "tcp_maxrt");
#endif
#ifdef ZMQ_THREAD_SAFE
check_integral_opt_get<bool>(zmq::sockopt::thread_safe, router, "thread_safe");
#endif
#ifdef ZMQ_TOS
check_integral_opt<int>(zmq::sockopt::tos, router, "tos");
#endif
#ifdef ZMQ_TYPE
check_integral_opt_get<int>(zmq::sockopt::type, router, "type");
#ifdef ZMQ_CPP11
check_integral_opt_get<zmq::socket_type>(zmq::sockopt::socket_type, router, "socket_type");
#endif // ZMQ_CPP11
#endif // ZMQ_TYPE
#ifdef ZMQ_HAVE_VMCI
#ifdef ZMQ_VMCI_BUFFER_SIZE
check_integral_opt<uint64_t>(zmq::sockopt::vmci_buffer_size, router,
"vmci_buffer_size");
#endif
#ifdef ZMQ_VMCI_BUFFER_MIN_SIZE
check_integral_opt<uint64_t>(zmq::sockopt::vmci_buffer_min_size, router,
"vmci_buffer_min_size");
#endif
#ifdef ZMQ_VMCI_BUFFER_MAX_SIZE
check_integral_opt<uint64_t>(zmq::sockopt::vmci_buffer_max_size, router,
"vmci_buffer_max_size");
#endif
#ifdef ZMQ_VMCI_CONNECT_TIMEOUT
check_integral_opt<int>(zmq::sockopt::vmci_connect_timeout, router,
"vmci_connect_timeout");
#endif
#endif
#ifdef ZMQ_XPUB_VERBOSE
check_integral_opt<int>(zmq::sockopt::xpub_verbose, xpub, "xpub_verbose", true);
#endif
#ifdef ZMQ_XPUB_VERBOSER
check_integral_opt<int>(zmq::sockopt::xpub_verboser, xpub, "xpub_verboser",
true);
#endif
#ifdef ZMQ_XPUB_MANUAL
check_integral_opt<int>(zmq::sockopt::xpub_manual, xpub, "xpub_manual", true);
#endif
#ifdef ZMQ_XPUB_NODROP
check_integral_opt<int>(zmq::sockopt::xpub_nodrop, xpub, "xpub_nodrop", true);
#endif
#ifdef ZMQ_ZAP_ENFORCE_DOMAIN
check_integral_opt<int>(zmq::sockopt::zap_enforce_domain, router,
"zap_enforce_domain");
#endif
}
#endif
TEST_CASE("socket flags", "[socket]")
{
CHECK((zmq::recv_flags::dontwait | zmq::recv_flags::none)
== static_cast<zmq::recv_flags>(ZMQ_DONTWAIT | 0));
CHECK((zmq::recv_flags::dontwait & zmq::recv_flags::none)
== static_cast<zmq::recv_flags>(ZMQ_DONTWAIT & 0));
CHECK((zmq::recv_flags::dontwait ^ zmq::recv_flags::none)
== static_cast<zmq::recv_flags>(ZMQ_DONTWAIT ^ 0));
CHECK(~zmq::recv_flags::dontwait == static_cast<zmq::recv_flags>(~ZMQ_DONTWAIT));
CHECK((zmq::send_flags::dontwait | zmq::send_flags::sndmore)
== static_cast<zmq::send_flags>(ZMQ_DONTWAIT | ZMQ_SNDMORE));
CHECK((zmq::send_flags::dontwait & zmq::send_flags::sndmore)
== static_cast<zmq::send_flags>(ZMQ_DONTWAIT & ZMQ_SNDMORE));
CHECK((zmq::send_flags::dontwait ^ zmq::send_flags::sndmore)
== static_cast<zmq::send_flags>(ZMQ_DONTWAIT ^ ZMQ_SNDMORE));
CHECK(~zmq::send_flags::dontwait == static_cast<zmq::send_flags>(~ZMQ_DONTWAIT));
}
TEST_CASE("socket readme example", "[socket]")
{
zmq::context_t ctx;
zmq::socket_t sock(ctx, zmq::socket_type::push);
sock.bind("inproc://test");
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
}
#endif
TEST_CASE("socket sends and receives const buffer", "[socket]")
{
zmq::context_t context;
zmq::socket_t sender(context, ZMQ_PAIR);
zmq::socket_t receiver(context, ZMQ_PAIR);
receiver.bind("inproc://test");
sender.connect("inproc://test");
const char *str = "Hi";
#ifdef ZMQ_CPP11
CHECK(2 == *sender.send(zmq::buffer(str, 2)));
char buf[2];
const auto res = receiver.recv(zmq::buffer(buf));
CHECK(res);
CHECK(!res->truncated());
CHECK(2 == res->size);
#else
CHECK(2 == sender.send(str, 2));
char buf[2];
CHECK(2 == receiver.recv(buf, 2));
#endif
CHECK(0 == memcmp(buf, str, 2));
}
#ifdef ZMQ_CPP11
TEST_CASE("socket send none sndmore", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::router);
s.bind("inproc://test");
std::vector<char> buf(4);
auto res = s.send(zmq::buffer(buf), zmq::send_flags::sndmore);
CHECK(res);
CHECK(*res == buf.size());
res = s.send(zmq::buffer(buf));
CHECK(res);
CHECK(*res == buf.size());
}
TEST_CASE("socket send dontwait", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::push);
s.bind("inproc://test");
std::vector<char> buf(4);
auto res = s.send(zmq::buffer(buf), zmq::send_flags::dontwait);
CHECK(!res);
res =
s.send(zmq::buffer(buf), zmq::send_flags::dontwait | zmq::send_flags::sndmore);
CHECK(!res);
zmq::message_t msg;
auto resm = s.send(msg, zmq::send_flags::dontwait);
CHECK(!resm);
CHECK(msg.size() == 0);
}
TEST_CASE("socket send exception", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::pull);
s.bind("inproc://test");
std::vector<char> buf(4);
CHECK_THROWS_AS(s.send(zmq::buffer(buf)), zmq::error_t);
}
TEST_CASE("socket recv none", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::pair);
zmq::socket_t s2(context, zmq::socket_type::pair);
s2.bind("inproc://test");
s.connect("inproc://test");
std::vector<char> sbuf(4);
const auto res_send = s2.send(zmq::buffer(sbuf));
CHECK(res_send);
CHECK(res_send.has_value());
std::vector<char> buf(2);
const auto res = s.recv(zmq::buffer(buf));
CHECK(res.has_value());
CHECK(res->truncated());
CHECK(res->untruncated_size == sbuf.size());
CHECK(res->size == buf.size());
const auto res_send2 = s2.send(zmq::buffer(sbuf));
CHECK(res_send2.has_value());
std::vector<char> buf2(10);
const auto res2 = s.recv(zmq::buffer(buf2));
CHECK(res2.has_value());
CHECK(!res2->truncated());
CHECK(res2->untruncated_size == sbuf.size());
CHECK(res2->size == sbuf.size());
}
TEST_CASE("socket send recv message_t", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::pair);
zmq::socket_t s2(context, zmq::socket_type::pair);
s2.bind("inproc://test");
s.connect("inproc://test");
zmq::message_t smsg(10);
const auto res_send = s2.send(smsg, zmq::send_flags::none);
CHECK(res_send);
CHECK(*res_send == 10);
CHECK(smsg.size() == 0);
zmq::message_t rmsg;
const auto res = s.recv(rmsg);
CHECK(res);
CHECK(*res == 10);
CHECK(res.value() == 10);
CHECK(rmsg.size() == *res);
}
TEST_CASE("socket send recv message_t by pointer", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::pair);
zmq::socket_t s2(context, zmq::socket_type::pair);
s2.bind("inproc://test");
s.connect("inproc://test");
zmq::message_t smsg(size_t{10});
const auto res_send = s2.send(smsg, zmq::send_flags::none);
CHECK(res_send);
CHECK(*res_send == 10);
CHECK(smsg.size() == 0);
zmq::message_t rmsg;
const bool res = s.recv(&rmsg);
CHECK(res);
}
TEST_CASE("socket recv dontwait", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::pull);
s.bind("inproc://test");
std::vector<char> buf(4);
constexpr auto flags = zmq::recv_flags::none | zmq::recv_flags::dontwait;
auto res = s.recv(zmq::buffer(buf), flags);
CHECK(!res);
zmq::message_t msg;
auto resm = s.recv(msg, flags);
CHECK(!resm);
CHECK_THROWS_AS(resm.value(), std::exception);
CHECK(msg.size() == 0);
}
TEST_CASE("socket recv exception", "[socket]")
{
zmq::context_t context;
zmq::socket_t s(context, zmq::socket_type::push);
s.bind("inproc://test");
std::vector<char> buf(4);
CHECK_THROWS_AS(s.recv(zmq::buffer(buf)), zmq::error_t);
}
TEST_CASE("socket proxy", "[socket]")
{
zmq::context_t context;
zmq::socket_t front(context, ZMQ_ROUTER);
zmq::socket_t back(context, ZMQ_ROUTER);
zmq::socket_t capture(context, ZMQ_DEALER);
front.bind("inproc://test1");
back.bind("inproc://test2");
capture.bind("inproc://test3");
auto f = std::async(std::launch::async, [&]() {
auto s1 = std::move(front);
auto s2 = std::move(back);
auto s3 = std::move(capture);
try {
zmq::proxy(s1, s2, zmq::socket_ref(s3));
}
catch (const zmq::error_t &e) {
return e.num() == ETERM;
}
return false;
});
context.close();
CHECK(f.get());
}
TEST_CASE("socket proxy steerable", "[socket]")
{
zmq::context_t context;
zmq::socket_t front(context, ZMQ_ROUTER);
zmq::socket_t back(context, ZMQ_ROUTER);
zmq::socket_t control(context, ZMQ_SUB);
front.bind("inproc://test1");
back.bind("inproc://test2");
control.connect("inproc://test3");
auto f = std::async(std::launch::async, [&]() {
auto s1 = std::move(front);
auto s2 = std::move(back);
auto s3 = std::move(control);
try {
zmq::proxy_steerable(s1, s2, zmq::socket_ref(), s3);
}
catch (const zmq::error_t &e) {
return e.num() == ETERM;
}
return false;
});
context.close();
CHECK(f.get());
}
#endif

View File

@@ -1,118 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq.hpp>
#ifdef ZMQ_CPP11
#ifdef ZMQ_CPP17
static_assert(std::is_nothrow_swappable_v<zmq::socket_ref>);
#endif
static_assert(sizeof(zmq::socket_ref) == sizeof(void *), "size mismatch");
static_assert(alignof(zmq::socket_ref) == alignof(void *), "alignment mismatch");
static_assert(ZMQ_IS_TRIVIALLY_COPYABLE(zmq::socket_ref),
"needs to be trivially copyable");
TEST_CASE("socket_ref default init", "[socket_ref]")
{
zmq::socket_ref sr;
CHECK(!sr);
CHECK(sr == nullptr);
CHECK(nullptr == sr);
CHECK(sr.handle() == nullptr);
}
TEST_CASE("socket_ref create from nullptr", "[socket_ref]")
{
zmq::socket_ref sr = nullptr;
CHECK(sr == nullptr);
CHECK(sr.handle() == nullptr);
}
TEST_CASE("socket_ref create from handle", "[socket_ref]")
{
void *np = nullptr;
zmq::socket_ref sr{zmq::from_handle, np};
CHECK(sr == nullptr);
CHECK(sr.handle() == nullptr);
}
TEST_CASE("socket_ref compare", "[socket_ref]")
{
zmq::socket_ref sr1;
zmq::socket_ref sr2;
CHECK(sr1 == sr2);
CHECK(!(sr1 != sr2));
}
TEST_CASE("socket_ref compare from socket_t", "[socket_ref]")
{
zmq::context_t context;
zmq::socket_t s1(context, zmq::socket_type::router);
zmq::socket_t s2(context, zmq::socket_type::dealer);
zmq::socket_ref sr1 = s1;
zmq::socket_ref sr2 = s2;
CHECK(sr1);
CHECK(sr2);
CHECK(sr1 == s1);
CHECK(sr2 == s2);
CHECK(sr1.handle() == s1.handle());
CHECK(sr1 != sr2);
CHECK(sr1.handle() != sr2.handle());
CHECK(sr1 != nullptr);
CHECK(nullptr != sr1);
CHECK(sr2 != nullptr);
const bool comp1 = (sr1 < sr2) != (sr1 >= sr2);
CHECK(comp1);
const bool comp2 = (sr1 > sr2) != (sr1 <= sr2);
CHECK(comp2);
std::hash<zmq::socket_ref> hash;
CHECK(hash(sr1) != hash(sr2));
CHECK(hash(sr1) == hash(s1));
}
TEST_CASE("socket_ref assignment", "[socket_ref]")
{
zmq::context_t context;
zmq::socket_t s1(context, zmq::socket_type::router);
zmq::socket_t s2(context, zmq::socket_type::dealer);
zmq::socket_ref sr1 = s1;
zmq::socket_ref sr2 = s2;
sr1 = s2;
CHECK(sr1 == sr2);
CHECK(sr1.handle() == sr2.handle());
sr1 = std::move(sr2);
CHECK(sr1 == sr2);
CHECK(sr1.handle() == sr2.handle());
sr2 = nullptr;
CHECK(sr1 != sr2);
sr1 = nullptr;
CHECK(sr1 == sr2);
}
TEST_CASE("socket_ref swap", "[socket_ref]")
{
zmq::socket_ref sr1;
zmq::socket_ref sr2;
using std::swap;
swap(sr1, sr2);
}
TEST_CASE("socket_ref type punning", "[socket_ref]")
{
struct SVP
{
void *p;
} svp;
struct SSR
{
zmq::socket_ref sr;
} ssr;
zmq::context_t context;
zmq::socket_t socket(context, zmq::socket_type::router);
CHECK(socket.handle() != nullptr);
svp.p = socket.handle();
// static_cast to silence incorrect warning
std::memcpy(static_cast<void *>(&ssr), &svp, sizeof(ssr));
CHECK(ssr.sr == socket);
}
#endif

View File

@@ -1,54 +0,0 @@
#pragma once
#include <catch2/catch.hpp>
#include <zmq.hpp>
#if defined(ZMQ_CPP11)
inline std::string bind_ip4_loopback(zmq::socket_t &socket)
{
socket.bind("tcp://127.0.0.1:*");
std::string endpoint(100, ' ');
endpoint.resize(socket.get(zmq::sockopt::last_endpoint, zmq::buffer(endpoint)));
return endpoint;
}
struct common_server_client_setup
{
common_server_client_setup(bool initialize = true)
{
if (initialize)
init();
}
void init()
{
endpoint = bind_ip4_loopback(server);
REQUIRE_NOTHROW(client.connect(endpoint));
}
zmq::context_t context;
zmq::socket_t server{context, zmq::socket_type::pair};
zmq::socket_t client{context, zmq::socket_type::pair};
std::string endpoint;
};
#endif
#define CHECK_THROWS_ZMQ_ERROR(ecode, expr) \
do { \
try { \
expr; \
CHECK(false); \
} \
catch (const zmq::error_t &ze) { \
INFO(std::string("Unexpected error code: ") + ze.what()); \
CHECK(ze.num() == ecode); \
} \
catch (const std::exception &ex) { \
INFO(std::string("Unexpected exception: ") + ex.what()); \
CHECK(false); \
} \
catch (...) { \
CHECK(false); \
} \
} while (false)

View File

@@ -1,110 +0,0 @@
#include <catch2/catch.hpp>
#include <zmq.hpp>
#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL)
namespace test_ns
{
struct T_nr
{
};
struct T_mr
{
void *begin() const noexcept { return nullptr; }
void *end() const noexcept { return nullptr; }
};
struct T_fr
{
};
inline void *begin(const T_fr &) noexcept
{
return nullptr;
}
inline void *end(const T_fr &) noexcept
{
return nullptr;
}
struct T_mfr
{
void *begin() const noexcept { return nullptr; }
void *end() const noexcept { return nullptr; }
};
inline void *begin(const T_mfr &) noexcept
{
return nullptr;
}
inline void *end(const T_mfr &) noexcept
{
return nullptr;
}
// types with associated namespace std
struct T_assoc_ns_nr : std::exception
{
};
struct T_assoc_ns_mr : std::exception
{
void *begin() const noexcept { return nullptr; }
void *end() const noexcept { return nullptr; }
};
struct T_assoc_ns_fr : std::exception
{
};
inline void *begin(const T_assoc_ns_fr &) noexcept
{
return nullptr;
}
inline void *end(const T_assoc_ns_fr &) noexcept
{
return nullptr;
}
struct T_assoc_ns_mfr : std::exception
{
void *begin() const noexcept { return nullptr; }
void *end() const noexcept { return nullptr; }
};
inline void *begin(const T_assoc_ns_mfr &) noexcept
{
return nullptr;
}
inline void *end(const T_assoc_ns_mfr &) noexcept
{
return nullptr;
}
} // namespace test_ns
TEST_CASE("range SFINAE", "[utilities]")
{
CHECK(!zmq::detail::is_range<int>::value);
CHECK(zmq::detail::is_range<std::string>::value);
CHECK(zmq::detail::is_range<std::string &>::value);
CHECK(zmq::detail::is_range<const std::string &>::value);
CHECK(zmq::detail::is_range<decltype("hello")>::value);
CHECK(zmq::detail::is_range<std::initializer_list<int>>::value);
CHECK(!zmq::detail::is_range<test_ns::T_nr>::value);
CHECK(zmq::detail::is_range<test_ns::T_mr>::value);
CHECK(zmq::detail::is_range<test_ns::T_fr>::value);
CHECK(zmq::detail::is_range<test_ns::T_mfr>::value);
CHECK(!zmq::detail::is_range<test_ns::T_assoc_ns_nr>::value);
CHECK(zmq::detail::is_range<test_ns::T_assoc_ns_mr>::value);
CHECK(zmq::detail::is_range<test_ns::T_assoc_ns_fr>::value);
CHECK(zmq::detail::is_range<test_ns::T_assoc_ns_mfr>::value);
}
#endif

View File

@@ -1,21 +0,0 @@
#!/bin/sh
#
# This script extracts the 0MQ version from zmq.hpp, which is the master
# location for this information.
#
if [ ! -f zmq.hpp ]; then
echo "version.sh: error: zmq.hpp does not exist" 1>&2
exit 1
fi
MAJOR=$(grep '^#define CPPZMQ_VERSION_MAJOR \+[0-9]\+' zmq.hpp)
MINOR=$(grep '^#define CPPZMQ_VERSION_MINOR \+[0-9]\+' zmq.hpp)
PATCH=$(grep '^#define CPPZMQ_VERSION_PATCH \+[0-9]\+' zmq.hpp)
if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then
echo "version.sh: error: could not extract version from zmq.hpp" 1>&2
exit 1
fi
MAJOR=$(echo $MAJOR | awk '{ print $3 }')
MINOR=$(echo $MINOR | awk '{ print $3 }')
PATCH=$(echo $PATCH | awk '{ print $3 }')
echo $MAJOR.$MINOR.$PATCH | tr -d '\n\r'

File diff suppressed because it is too large Load Diff

View File

@@ -1,753 +0,0 @@
/*
Copyright (c) 2016-2017 ZeroMQ community
Copyright (c) 2016 VOCA AS / Harald Nøkland
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
#ifndef __ZMQ_ADDON_HPP_INCLUDED__
#define __ZMQ_ADDON_HPP_INCLUDED__
#include "zmq.hpp"
#include <deque>
#include <iomanip>
#include <sstream>
#include <stdexcept>
#ifdef ZMQ_CPP11
#include <limits>
#include <functional>
#include <unordered_map>
#endif
namespace zmq
{
#ifdef ZMQ_CPP11
namespace detail
{
template<bool CheckN, class OutputIt>
recv_result_t
recv_multipart_n(socket_ref s, OutputIt out, size_t n, recv_flags flags)
{
size_t msg_count = 0;
message_t msg;
while (true) {
if ZMQ_CONSTEXPR_IF (CheckN) {
if (msg_count >= n)
throw std::runtime_error(
"Too many message parts in recv_multipart_n");
}
if (!s.recv(msg, flags)) {
// zmq ensures atomic delivery of messages
assert(msg_count == 0);
return {};
}
++msg_count;
const bool more = msg.more();
*out++ = std::move(msg);
if (!more)
break;
}
return msg_count;
}
inline bool is_little_endian()
{
const uint16_t i = 0x01;
return *reinterpret_cast<const uint8_t *>(&i) == 0x01;
}
inline void write_network_order(unsigned char *buf, const uint32_t value)
{
if (is_little_endian()) {
ZMQ_CONSTEXPR_VAR uint32_t mask = (std::numeric_limits<std::uint8_t>::max)();
*buf++ = static_cast<unsigned char>((value >> 24) & mask);
*buf++ = static_cast<unsigned char>((value >> 16) & mask);
*buf++ = static_cast<unsigned char>((value >> 8) & mask);
*buf++ = static_cast<unsigned char>(value & mask);
} else {
std::memcpy(buf, &value, sizeof(value));
}
}
inline uint32_t read_u32_network_order(const unsigned char *buf)
{
if (is_little_endian()) {
return (static_cast<uint32_t>(buf[0]) << 24)
+ (static_cast<uint32_t>(buf[1]) << 16)
+ (static_cast<uint32_t>(buf[2]) << 8)
+ static_cast<uint32_t>(buf[3]);
} else {
uint32_t value;
std::memcpy(&value, buf, sizeof(value));
return value;
}
}
} // namespace detail
/* Receive a multipart message.
Writes the zmq::message_t objects to OutputIterator out.
The out iterator must handle an unspecified number of writes,
e.g. by using std::back_inserter.
Returns: the number of messages received or nullopt (on EAGAIN).
Throws: if recv throws. Any exceptions thrown
by the out iterator will be propagated and the message
may have been only partially received with pending
message parts. It is adviced to close this socket in that event.
*/
template<class OutputIt>
ZMQ_NODISCARD recv_result_t recv_multipart(socket_ref s,
OutputIt out,
recv_flags flags = recv_flags::none)
{
return detail::recv_multipart_n<false>(s, std::move(out), 0, flags);
}
/* Receive a multipart message.
Writes at most n zmq::message_t objects to OutputIterator out.
If the number of message parts of the incoming message exceeds n
then an exception will be thrown.
Returns: the number of messages received or nullopt (on EAGAIN).
Throws: if recv throws. Throws std::runtime_error if the number
of message parts exceeds n (exactly n messages will have been written
to out). Any exceptions thrown
by the out iterator will be propagated and the message
may have been only partially received with pending
message parts. It is adviced to close this socket in that event.
*/
template<class OutputIt>
ZMQ_NODISCARD recv_result_t recv_multipart_n(socket_ref s,
OutputIt out,
size_t n,
recv_flags flags = recv_flags::none)
{
return detail::recv_multipart_n<true>(s, std::move(out), n, flags);
}
/* Send a multipart message.
The range must be a ForwardRange of zmq::message_t,
zmq::const_buffer or zmq::mutable_buffer.
The flags may be zmq::send_flags::sndmore if there are
more message parts to be sent after the call to this function.
Returns: the number of messages sent (exactly msgs.size()) or nullopt (on EAGAIN).
Throws: if send throws. Any exceptions thrown
by the msgs range will be propagated and the message
may have been only partially sent. It is adviced to close this socket in that event.
*/
template<class Range
#ifndef ZMQ_CPP11_PARTIAL
,
typename = typename std::enable_if<
detail::is_range<Range>::value
&& (std::is_same<detail::range_value_t<Range>, message_t>::value
|| detail::is_buffer<detail::range_value_t<Range>>::value)>::type
#endif
>
send_result_t
send_multipart(socket_ref s, Range &&msgs, send_flags flags = send_flags::none)
{
using std::begin;
using std::end;
auto it = begin(msgs);
const auto end_it = end(msgs);
size_t msg_count = 0;
while (it != end_it) {
const auto next = std::next(it);
const auto msg_flags =
flags | (next == end_it ? send_flags::none : send_flags::sndmore);
if (!s.send(*it, msg_flags)) {
// zmq ensures atomic delivery of messages
assert(it == begin(msgs));
return {};
}
++msg_count;
it = next;
}
return msg_count;
}
/* Encode a multipart message.
The range must be a ForwardRange of zmq::message_t. A
zmq::multipart_t or STL container may be passed for encoding.
Returns: a zmq::message_t holding the encoded multipart data.
Throws: std::range_error is thrown if the size of any single part
can not fit in an unsigned 32 bit integer.
The encoding is compatible with that used by the CZMQ function
zmsg_encode(), see https://rfc.zeromq.org/spec/50/.
Each part consists of a size followed by the data.
These are placed contiguously into the output message. A part of
size less than 255 bytes will have a single byte size value.
Larger parts will have a five byte size value with the first byte
set to 0xFF and the remaining four bytes holding the size of the
part's data.
*/
template<class Range
#ifndef ZMQ_CPP11_PARTIAL
,
typename = typename std::enable_if<
detail::is_range<Range>::value
&& (std::is_same<detail::range_value_t<Range>, message_t>::value
|| detail::is_buffer<detail::range_value_t<Range>>::value)>::type
#endif
>
message_t encode(const Range &parts)
{
size_t mmsg_size = 0;
// First pass check sizes
for (const auto &part : parts) {
const size_t part_size = part.size();
if (part_size > (std::numeric_limits<std::uint32_t>::max)()) {
// Size value must fit into uint32_t.
throw std::range_error("Invalid size, message part too large");
}
const size_t count_size =
part_size < (std::numeric_limits<std::uint8_t>::max)() ? 1 : 5;
mmsg_size += part_size + count_size;
}
message_t encoded(mmsg_size);
unsigned char *buf = encoded.data<unsigned char>();
for (const auto &part : parts) {
const uint32_t part_size = static_cast<uint32_t>(part.size());
const unsigned char *part_data =
static_cast<const unsigned char *>(part.data());
if (part_size < (std::numeric_limits<std::uint8_t>::max)()) {
// small part
*buf++ = (unsigned char) part_size;
} else {
// big part
*buf++ = (std::numeric_limits<uint8_t>::max)();
detail::write_network_order(buf, part_size);
buf += sizeof(part_size);
}
std::memcpy(buf, part_data, part_size);
buf += part_size;
}
assert(static_cast<size_t>(buf - encoded.data<unsigned char>()) == mmsg_size);
return encoded;
}
/* Decode an encoded message to multiple parts.
The given output iterator must be a ForwardIterator to a container
holding zmq::message_t such as a zmq::multipart_t or various STL
containers.
Returns the ForwardIterator advanced once past the last decoded
part.
Throws: a std::out_of_range is thrown if the encoded part sizes
lead to exceeding the message data bounds.
The decoding assumes the message is encoded in the manner
performed by zmq::encode(), see https://rfc.zeromq.org/spec/50/.
*/
template<class OutputIt> OutputIt decode(const message_t &encoded, OutputIt out)
{
const unsigned char *source = encoded.data<unsigned char>();
const unsigned char *const limit = source + encoded.size();
while (source < limit) {
size_t part_size = *source++;
if (part_size == (std::numeric_limits<std::uint8_t>::max)()) {
if (static_cast<size_t>(limit - source) < sizeof(uint32_t)) {
throw std::out_of_range(
"Malformed encoding, overflow in reading size");
}
part_size = detail::read_u32_network_order(source);
// the part size is allowed to be less than 0xFF
source += sizeof(uint32_t);
}
if (static_cast<size_t>(limit - source) < part_size) {
throw std::out_of_range("Malformed encoding, overflow in reading part");
}
*out = message_t(source, part_size);
++out;
source += part_size;
}
assert(source == limit);
return out;
}
#endif
#ifdef ZMQ_HAS_RVALUE_REFS
/*
This class handles multipart messaging. It is the C++ equivalent of zmsg.h,
which is part of CZMQ (the high-level C binding). Furthermore, it is a major
improvement compared to zmsg.hpp, which is part of the examples in the ØMQ
Guide. Unnecessary copying is avoided by using move semantics to efficiently
add/remove parts.
*/
class multipart_t
{
private:
std::deque<message_t> m_parts;
public:
typedef std::deque<message_t>::value_type value_type;
typedef std::deque<message_t>::iterator iterator;
typedef std::deque<message_t>::const_iterator const_iterator;
typedef std::deque<message_t>::reverse_iterator reverse_iterator;
typedef std::deque<message_t>::const_reverse_iterator const_reverse_iterator;
// Default constructor
multipart_t() {}
// Construct from socket receive
multipart_t(socket_ref socket) { recv(socket); }
// Construct from memory block
multipart_t(const void *src, size_t size) { addmem(src, size); }
// Construct from string
multipart_t(const std::string &string) { addstr(string); }
// Construct from message part
multipart_t(message_t &&message) { add(std::move(message)); }
// Move constructor
multipart_t(multipart_t &&other) ZMQ_NOTHROW { m_parts = std::move(other.m_parts); }
// Move assignment operator
multipart_t &operator=(multipart_t &&other) ZMQ_NOTHROW
{
m_parts = std::move(other.m_parts);
return *this;
}
// Destructor
virtual ~multipart_t() { clear(); }
message_t &operator[](size_t n) { return m_parts[n]; }
const message_t &operator[](size_t n) const { return m_parts[n]; }
message_t &at(size_t n) { return m_parts.at(n); }
const message_t &at(size_t n) const { return m_parts.at(n); }
iterator begin() { return m_parts.begin(); }
const_iterator begin() const { return m_parts.begin(); }
const_iterator cbegin() const { return m_parts.cbegin(); }
reverse_iterator rbegin() { return m_parts.rbegin(); }
const_reverse_iterator rbegin() const { return m_parts.rbegin(); }
iterator end() { return m_parts.end(); }
const_iterator end() const { return m_parts.end(); }
const_iterator cend() const { return m_parts.cend(); }
reverse_iterator rend() { return m_parts.rend(); }
const_reverse_iterator rend() const { return m_parts.rend(); }
// Delete all parts
void clear() { m_parts.clear(); }
// Get number of parts
size_t size() const { return m_parts.size(); }
// Check if number of parts is zero
bool empty() const { return m_parts.empty(); }
// Receive multipart message from socket
bool recv(socket_ref socket, int flags = 0)
{
clear();
bool more = true;
while (more) {
message_t message;
#ifdef ZMQ_CPP11
if (!socket.recv(message, static_cast<recv_flags>(flags)))
return false;
#else
if (!socket.recv(&message, flags))
return false;
#endif
more = message.more();
add(std::move(message));
}
return true;
}
// Send multipart message to socket
bool send(socket_ref socket, int flags = 0)
{
flags &= ~(ZMQ_SNDMORE);
bool more = size() > 0;
while (more) {
message_t message = pop();
more = size() > 0;
#ifdef ZMQ_CPP11
if (!socket.send(message, static_cast<send_flags>(
(more ? ZMQ_SNDMORE : 0) | flags)))
return false;
#else
if (!socket.send(message, (more ? ZMQ_SNDMORE : 0) | flags))
return false;
#endif
}
clear();
return true;
}
// Concatenate other multipart to front
void prepend(multipart_t &&other)
{
while (!other.empty())
push(other.remove());
}
// Concatenate other multipart to back
void append(multipart_t &&other)
{
while (!other.empty())
add(other.pop());
}
// Push memory block to front
void pushmem(const void *src, size_t size)
{
m_parts.push_front(message_t(src, size));
}
// Push memory block to back
void addmem(const void *src, size_t size)
{
m_parts.push_back(message_t(src, size));
}
// Push string to front
void pushstr(const std::string &string)
{
m_parts.push_front(message_t(string.data(), string.size()));
}
// Push string to back
void addstr(const std::string &string)
{
m_parts.push_back(message_t(string.data(), string.size()));
}
// Push type (fixed-size) to front
template<typename T> void pushtyp(const T &type)
{
static_assert(!std::is_same<T, std::string>::value,
"Use pushstr() instead of pushtyp<std::string>()");
m_parts.push_front(message_t(&type, sizeof(type)));
}
// Push type (fixed-size) to back
template<typename T> void addtyp(const T &type)
{
static_assert(!std::is_same<T, std::string>::value,
"Use addstr() instead of addtyp<std::string>()");
m_parts.push_back(message_t(&type, sizeof(type)));
}
// Push message part to front
void push(message_t &&message) { m_parts.push_front(std::move(message)); }
// Push message part to back
void add(message_t &&message) { m_parts.push_back(std::move(message)); }
// Alias to allow std::back_inserter()
void push_back(message_t &&message) { m_parts.push_back(std::move(message)); }
// Pop string from front
std::string popstr()
{
std::string string(m_parts.front().data<char>(), m_parts.front().size());
m_parts.pop_front();
return string;
}
// Pop type (fixed-size) from front
template<typename T> T poptyp()
{
static_assert(!std::is_same<T, std::string>::value,
"Use popstr() instead of poptyp<std::string>()");
if (sizeof(T) != m_parts.front().size())
throw std::runtime_error(
"Invalid type, size does not match the message size");
T type = *m_parts.front().data<T>();
m_parts.pop_front();
return type;
}
// Pop message part from front
message_t pop()
{
message_t message = std::move(m_parts.front());
m_parts.pop_front();
return message;
}
// Pop message part from back
message_t remove()
{
message_t message = std::move(m_parts.back());
m_parts.pop_back();
return message;
}
// get message part from front
const message_t &front() { return m_parts.front(); }
// get message part from back
const message_t &back() { return m_parts.back(); }
// Get pointer to a specific message part
const message_t *peek(size_t index) const { return &m_parts[index]; }
// Get a string copy of a specific message part
std::string peekstr(size_t index) const
{
std::string string(m_parts[index].data<char>(), m_parts[index].size());
return string;
}
// Peek type (fixed-size) from front
template<typename T> T peektyp(size_t index) const
{
static_assert(!std::is_same<T, std::string>::value,
"Use peekstr() instead of peektyp<std::string>()");
if (sizeof(T) != m_parts[index].size())
throw std::runtime_error(
"Invalid type, size does not match the message size");
T type = *m_parts[index].data<T>();
return type;
}
// Create multipart from type (fixed-size)
template<typename T> static multipart_t create(const T &type)
{
multipart_t multipart;
multipart.addtyp(type);
return multipart;
}
// Copy multipart
multipart_t clone() const
{
multipart_t multipart;
for (size_t i = 0; i < size(); i++)
multipart.addmem(m_parts[i].data(), m_parts[i].size());
return multipart;
}
// Dump content to string
std::string str() const
{
std::stringstream ss;
for (size_t i = 0; i < m_parts.size(); i++) {
const unsigned char *data = m_parts[i].data<unsigned char>();
size_t size = m_parts[i].size();
// Dump the message as text or binary
bool isText = true;
for (size_t j = 0; j < size; j++) {
if (data[j] < 32 || data[j] > 127) {
isText = false;
break;
}
}
ss << "\n[" << std::dec << std::setw(3) << std::setfill('0') << size
<< "] ";
if (size >= 1000) {
ss << "... (too big to print)";
continue;
}
for (size_t j = 0; j < size; j++) {
if (isText)
ss << static_cast<char>(data[j]);
else
ss << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<short>(data[j]);
}
}
return ss.str();
}
// Check if equal to other multipart
bool equal(const multipart_t *other) const ZMQ_NOTHROW
{
return *this == *other;
}
bool operator==(const multipart_t &other) const ZMQ_NOTHROW
{
if (size() != other.size())
return false;
for (size_t i = 0; i < size(); i++)
if (at(i) != other.at(i))
return false;
return true;
}
bool operator!=(const multipart_t &other) const ZMQ_NOTHROW
{
return !(*this == other);
}
#ifdef ZMQ_CPP11
// Return single part message_t encoded from this multipart_t.
message_t encode() const { return zmq::encode(*this); }
// Decode encoded message into multiple parts and append to self.
void decode_append(const message_t &encoded)
{
zmq::decode(encoded, std::back_inserter(*this));
}
// Return a new multipart_t containing the decoded message_t.
static multipart_t decode(const message_t &encoded)
{
multipart_t tmp;
zmq::decode(encoded, std::back_inserter(tmp));
return tmp;
}
#endif
private:
// Disable implicit copying (moving is more efficient)
multipart_t(const multipart_t &other) ZMQ_DELETED_FUNCTION;
void operator=(const multipart_t &other) ZMQ_DELETED_FUNCTION;
}; // class multipart_t
inline std::ostream &operator<<(std::ostream &os, const multipart_t &msg)
{
return os << msg.str();
}
#endif // ZMQ_HAS_RVALUE_REFS
#if defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER)
class active_poller_t
{
public:
active_poller_t() = default;
~active_poller_t() = default;
active_poller_t(const active_poller_t &) = delete;
active_poller_t &operator=(const active_poller_t &) = delete;
active_poller_t(active_poller_t &&src) = default;
active_poller_t &operator=(active_poller_t &&src) = default;
using handler_type = std::function<void(event_flags)>;
void add(zmq::socket_ref socket, event_flags events, handler_type handler)
{
if (!handler)
throw std::invalid_argument("null handler in active_poller_t::add");
auto ret = handlers.emplace(
socket, std::make_shared<handler_type>(std::move(handler)));
if (!ret.second)
throw error_t(EINVAL); // already added
try {
base_poller.add(socket, events, ret.first->second.get());
need_rebuild = true;
}
catch (...) {
// rollback
handlers.erase(socket);
throw;
}
}
void remove(zmq::socket_ref socket)
{
base_poller.remove(socket);
handlers.erase(socket);
need_rebuild = true;
}
void modify(zmq::socket_ref socket, event_flags events)
{
base_poller.modify(socket, events);
}
size_t wait(std::chrono::milliseconds timeout)
{
if (need_rebuild) {
poller_events.resize(handlers.size());
poller_handlers.clear();
poller_handlers.reserve(handlers.size());
for (const auto &handler : handlers) {
poller_handlers.push_back(handler.second);
}
need_rebuild = false;
}
const auto count = base_poller.wait_all(poller_events, timeout);
std::for_each(poller_events.begin(),
poller_events.begin() + static_cast<ptrdiff_t>(count),
[](decltype(base_poller)::event_type &event) {
assert(event.user_data != nullptr);
(*event.user_data)(event.events);
});
return count;
}
ZMQ_NODISCARD bool empty() const noexcept { return handlers.empty(); }
size_t size() const noexcept { return handlers.size(); }
private:
bool need_rebuild{false};
poller_t<handler_type> base_poller{};
std::unordered_map<socket_ref, std::shared_ptr<handler_type>> handlers{};
std::vector<decltype(base_poller)::event_type> poller_events{};
std::vector<std::shared_ptr<handler_type>> poller_handlers{};
}; // class active_poller_t
#endif // defined(ZMQ_BUILD_DRAFT_API) && defined(ZMQ_CPP11) && defined(ZMQ_HAVE_POLLER)
} // namespace zmq
#endif // __ZMQ_ADDON_HPP_INCLUDED__

1
libs/libzmq Submodule

Submodule libs/libzmq added at 3e08ecc012

View File

@@ -1,53 +0,0 @@
BasedOnStyle: LLVM
IndentWidth: 4
UseTab: Never
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: false
IndentBraces: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: true
BinPackArguments: true
BinPackParameters: false
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakTemplateDeclarations: false
ColumnLimit: 80
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
ContinuationIndentWidth: 2
PointerAlignment: Right
ReflowComments: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Always
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
SortIncludes: false
FixNamespaceComments: false
BreakBeforeBinaryOperators: NonAssignment
SpaceAfterTemplateKeyword: true
AlignAfterOpenBracket: Align
AlignOperands: true
BreakConstructorInitializers: AfterColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
SpaceAfterCStyleCast: true
BreakBeforeTernaryOperators: true

View File

@@ -1,429 +0,0 @@
Checks: "*,\
# not currently a coding convention, but conceivable,\
-llvm-include-order,\
# currently the coding convention deliberately produces violations of these,\
# rules, but it may make sense to reconsider,\
-readability-implicit-bool-conversion,\
-readability-braces-around-statements,\
-readability-named-parameter,\
-fuchsia-default-arguments,\
-google-readability-todo,\
-google-runtime-int,\
-cppcoreguidelines-avoid-goto,\
-hicpp-avoid-goto, \
-cppcoreguidelines-pro-type-member-init,\
-cppcoreguidelines-pro-type-static-cast-downcast,\
-readability-identifier-naming,\
# not applicable,\
-fuchsia-default-arguments-calls,\
-fuchsia-overloaded-operator,\
-fuchsia-statically-constructed-objects,\
# not currently a coding convention, C++11-specific, but conceivable,\
-modernize-use-nullptr,\
-modernize-use-equals-default,\
-modernize-deprecated-headers,\
# not currently a coding convention, C++11-specific and hard to implement,\
-hicpp-no-malloc,\
-hicpp-avoid-c-arrays,\
-modernize-avoid-c-arrays,\
-modernize-pass-by-value,\
-modernize-loop-convert,\
-modernize-use-auto,\
-modernize-use-trailing-return-type,\
-modernize-use-using,\
-modernize-return-braced-init-list,\
-cppcoreguidelines-avoid-c-arrays,\
-cppcoreguidelines-no-malloc,\
-cppcoreguidelines-owning-memory,\
-cppcoreguidelines-pro-type-union-access,\
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,\
-cppcoreguidelines-pro-bounds-constant-array-index,\
-cppcoreguidelines-pro-bounds-pointer-arithmetic,\
# not easily possible to implement (maybe replace by specific exclusions),\
-cppcoreguidelines-pro-type-vararg,\
-cppcoreguidelines-pro-type-reinterpret-cast,\
-hicpp-signed-bitwise,\
# duplicates,\
-google-readability-braces-around-statements,\
-cppcoreguidelines-pro-type-cstyle-cast,\
-cppcoreguidelines-avoid-magic-numbers,\
-readability-magic-numbers,\
-hicpp-braces-around-statements,\
-hicpp-use-equals-default,\
-hicpp-deprecated-headers,\
-hicpp-no-assembler,\
-hicpp-vararg,\
-hicpp-use-auto,\
-hicpp-use-nullptr,\
-hicpp-no-array-decay,\
-hicpp-member-init"
WarningsAsErrors: ''
HeaderFilterRegex: ''
# AnalyzeTemporaryDtors: false
CheckOptions:
# - key: cert-dcl59-cpp.HeaderFileExtensions
# value: h,hh,hpp,hxx
# - key: cert-err61-cpp.CheckThrowTemporaries
# value: '1'
# - key: cert-oop11-cpp.IncludeStyle
# value: llvm
# - key: cert-oop11-cpp.UseCERTSemantics
# value: '1'
# - key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader
# value: ''
# - key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle
# value: '0'
# - key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
# value: '0'
# - key: google-build-namespaces.HeaderFileExtensions
# value: h,hh,hpp,hxx
# - key: google-global-names-in-headers.HeaderFileExtensions
# value: h
# - key: google-readability-braces-around-statements.ShortStatementLines
# value: '1'
# - key: google-readability-function-size.BranchThreshold
# value: '4294967295'
# - key: google-readability-function-size.LineThreshold
# value: '4294967295'
# - key: google-readability-function-size.StatementThreshold
# value: '800'
# - key: google-readability-namespace-comments.ShortNamespaceLines
# value: '10'
# - key: google-readability-namespace-comments.SpacesBeforeComments
# value: '2'
# - key: google-runtime-int.SignedTypePrefix
# value: int
# - key: google-runtime-int.TypeSuffix
# value: ''
# - key: google-runtime-int.UnsignedTypePrefix
# value: uint
# - key: llvm-namespace-comment.ShortNamespaceLines
# value: '1'
# - key: llvm-namespace-comment.SpacesBeforeComments
# value: '1'
# - key: misc-assert-side-effect.AssertMacros
# value: assert
# - key: misc-assert-side-effect.CheckFunctionCalls
# value: '0'
# - key: misc-dangling-handle.HandleClasses
# value: 'std::basic_string_view;std::experimental::basic_string_view'
# - key: misc-definitions-in-headers.HeaderFileExtensions
# value: ',h,hh,hpp,hxx'
# - key: misc-definitions-in-headers.UseHeaderFileExtension
# value: '1'
# - key: misc-misplaced-widening-cast.CheckImplicitCasts
# value: '1'
# - key: misc-move-constructor-init.IncludeStyle
# value: llvm
# - key: misc-move-constructor-init.UseCERTSemantics
# value: '0'
# - key: misc-sizeof-expression.WarnOnSizeOfCompareToConstant
# value: '1'
# - key: misc-sizeof-expression.WarnOnSizeOfConstant
# value: '1'
# - key: misc-sizeof-expression.WarnOnSizeOfThis
# value: '1'
# - key: misc-string-constructor.LargeLengthThreshold
# value: '8388608'
# - key: misc-string-constructor.WarnOnLargeLength
# value: '1'
# - key: misc-suspicious-missing-comma.MaxConcatenatedTokens
# value: '5'
# - key: misc-suspicious-missing-comma.RatioThreshold
# value: '0.200000'
# - key: misc-suspicious-missing-comma.SizeThreshold
# value: '5'
# - key: misc-suspicious-string-compare.StringCompareLikeFunctions
# value: ''
# - key: misc-suspicious-string-compare.WarnOnImplicitComparison
# value: '1'
# - key: misc-suspicious-string-compare.WarnOnLogicalNotComparison
# value: '0'
# - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
# value: '1'
# - key: modernize-loop-convert.MaxCopySize
# value: '16'
# - key: modernize-loop-convert.MinConfidence
# value: reasonable
# - key: modernize-loop-convert.NamingStyle
# value: CamelCase
# - key: modernize-pass-by-value.IncludeStyle
# value: llvm
# - key: modernize-replace-auto-ptr.IncludeStyle
# value: llvm
# - key: modernize-use-nullptr.NullMacros
# value: 'NULL'
# - key: performance-faster-string-find.StringLikeClasses
# value: 'std::basic_string'
# - key: performance-for-range-copy.WarnOnAllAutoCopies
# value: '0'
# - key: readability-braces-around-statements.ShortStatementLines
# value: '1'
# - key: readability-function-size.BranchThreshold
# value: '4294967295'
# - key: readability-function-size.LineThreshold
# value: '4294967295'
# - key: readability-function-size.StatementThreshold
# value: '800'
# - key: readability-identifier-naming.AbstractClassCase
# value: aNy_CasE
# - key: readability-identifier-naming.AbstractClassPrefix
# value: ''
# - key: readability-identifier-naming.AbstractClassSuffix
# value: ''
# - key: readability-identifier-naming.ClassCase
# value: aNy_CasE
# - key: readability-identifier-naming.ClassConstantCase
# value: aNy_CasE
# - key: readability-identifier-naming.ClassConstantPrefix
# value: ''
# - key: readability-identifier-naming.ClassConstantSuffix
# value: ''
# - key: readability-identifier-naming.ClassMemberCase
# value: aNy_CasE
# - key: readability-identifier-naming.ClassMemberPrefix
# value: ''
# - key: readability-identifier-naming.ClassMemberSuffix
# value: ''
# - key: readability-identifier-naming.ClassMethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.ClassMethodPrefix
# value: ''
# - key: readability-identifier-naming.ClassMethodSuffix
# value: ''
# - key: readability-identifier-naming.ClassPrefix
# value: ''
# - key: readability-identifier-naming.ClassSuffix
# value: ''
# - key: readability-identifier-naming.ConstantCase
# value: aNy_CasE
# - key: readability-identifier-naming.ConstantMemberCase
# value: aNy_CasE
# - key: readability-identifier-naming.ConstantMemberPrefix
# value: ''
# - key: readability-identifier-naming.ConstantMemberSuffix
# value: ''
# - key: readability-identifier-naming.ConstantParameterCase
# value: aNy_CasE
# - key: readability-identifier-naming.ConstantParameterPrefix
# value: ''
# - key: readability-identifier-naming.ConstantParameterSuffix
# value: ''
# - key: readability-identifier-naming.ConstantPrefix
# value: ''
# - key: readability-identifier-naming.ConstantSuffix
# value: ''
# - key: readability-identifier-naming.ConstexprFunctionCase
# value: aNy_CasE
# - key: readability-identifier-naming.ConstexprFunctionPrefix
# value: ''
# - key: readability-identifier-naming.ConstexprFunctionSuffix
# value: ''
# - key: readability-identifier-naming.ConstexprMethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.ConstexprMethodPrefix
# value: ''
# - key: readability-identifier-naming.ConstexprMethodSuffix
# value: ''
# - key: readability-identifier-naming.ConstexprVariableCase
# value: aNy_CasE
# - key: readability-identifier-naming.ConstexprVariablePrefix
# value: ''
# - key: readability-identifier-naming.ConstexprVariableSuffix
# value: ''
# - key: readability-identifier-naming.EnumCase
# value: aNy_CasE
# - key: readability-identifier-naming.EnumConstantCase
# value: aNy_CasE
# - key: readability-identifier-naming.EnumConstantPrefix
# value: ''
# - key: readability-identifier-naming.EnumConstantSuffix
# value: ''
# - key: readability-identifier-naming.EnumPrefix
# value: ''
# - key: readability-identifier-naming.EnumSuffix
# value: ''
# - key: readability-identifier-naming.FunctionCase
# value: aNy_CasE
# - key: readability-identifier-naming.FunctionPrefix
# value: ''
# - key: readability-identifier-naming.FunctionSuffix
# value: ''
# - key: readability-identifier-naming.GlobalConstantCase
# value: aNy_CasE
# - key: readability-identifier-naming.GlobalConstantPrefix
# value: ''
# - key: readability-identifier-naming.GlobalConstantSuffix
# value: ''
# - key: readability-identifier-naming.GlobalFunctionCase
# value: aNy_CasE
# - key: readability-identifier-naming.GlobalFunctionPrefix
# value: ''
# - key: readability-identifier-naming.GlobalFunctionSuffix
# value: ''
# - key: readability-identifier-naming.GlobalVariableCase
# value: aNy_CasE
# - key: readability-identifier-naming.GlobalVariablePrefix
# value: ''
# - key: readability-identifier-naming.GlobalVariableSuffix
# value: ''
# - key: readability-identifier-naming.IgnoreFailedSplit
# value: '0'
# - key: readability-identifier-naming.InlineNamespaceCase
# value: aNy_CasE
# - key: readability-identifier-naming.InlineNamespacePrefix
# value: ''
# - key: readability-identifier-naming.InlineNamespaceSuffix
# value: ''
- key: readability-identifier-naming.LocalConstantCase
value: lower_case
- key: readability-identifier-naming.LocalConstantPrefix
value: ''
- key: readability-identifier-naming.LocalConstantSuffix
value: ''
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.LocalVariablePrefix
value: ''
- key: readability-identifier-naming.LocalVariableSuffix
value: ''
# - key: readability-identifier-naming.MemberCase
# value: lower_case
# - key: readability-identifier-naming.MemberPrefix
# value: '_'
# - key: readability-identifier-naming.MemberSuffix
# value: ''
# - key: readability-identifier-naming.MethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.MethodPrefix
# value: ''
# - key: readability-identifier-naming.MethodSuffix
# value: ''
# - key: readability-identifier-naming.NamespaceCase
# value: aNy_CasE
# - key: readability-identifier-naming.NamespacePrefix
# value: ''
# - key: readability-identifier-naming.NamespaceSuffix
# value: ''
- key: readability-identifier-naming.ParameterCase
value: lower_case
# - key: readability-identifier-naming.ParameterPackCase
# value: aNy_CasE
# - key: readability-identifier-naming.ParameterPackPrefix
# value: ''
# - key: readability-identifier-naming.ParameterPackSuffix
# value: ''
# - key: readability-identifier-naming.ParameterPrefix
# value: ''
- key: readability-identifier-naming.ParameterSuffix
value: '_'
- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberPrefix
value: '_'
- key: readability-identifier-naming.PrivateMemberSuffix
value: ''
# - key: readability-identifier-naming.PrivateMethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.PrivateMethodPrefix
# value: ''
# - key: readability-identifier-naming.PrivateMethodSuffix
# value: ''
# - key: readability-identifier-naming.ProtectedMemberCase
# value: aNy_CasE
# - key: readability-identifier-naming.ProtectedMemberPrefix
# value: ''
# - key: readability-identifier-naming.ProtectedMemberSuffix
# value: ''
# - key: readability-identifier-naming.ProtectedMethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.ProtectedMethodPrefix
# value: ''
# - key: readability-identifier-naming.ProtectedMethodSuffix
# value: ''
# - key: readability-identifier-naming.PublicMemberCase
# value: aNy_CasE
# - key: readability-identifier-naming.PublicMemberPrefix
# value: ''
# - key: readability-identifier-naming.PublicMemberSuffix
# value: ''
# - key: readability-identifier-naming.PublicMethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.PublicMethodPrefix
# value: ''
# - key: readability-identifier-naming.PublicMethodSuffix
# value: ''
# - key: readability-identifier-naming.StaticConstantCase
# value: aNy_CasE
# - key: readability-identifier-naming.StaticConstantPrefix
# value: ''
# - key: readability-identifier-naming.StaticConstantSuffix
# value: ''
# - key: readability-identifier-naming.StaticVariableCase
# value: aNy_CasE
# - key: readability-identifier-naming.StaticVariablePrefix
# value: ''
# - key: readability-identifier-naming.StaticVariableSuffix
# value: ''
# - key: readability-identifier-naming.StructCase
# value: aNy_CasE
# - key: readability-identifier-naming.StructPrefix
# value: ''
# - key: readability-identifier-naming.StructSuffix
# value: ''
# - key: readability-identifier-naming.TemplateParameterCase
# value: aNy_CasE
# - key: readability-identifier-naming.TemplateParameterPrefix
# value: ''
# - key: readability-identifier-naming.TemplateParameterSuffix
# value: ''
# - key: readability-identifier-naming.TemplateTemplateParameterCase
# value: aNy_CasE
# - key: readability-identifier-naming.TemplateTemplateParameterPrefix
# value: ''
# - key: readability-identifier-naming.TemplateTemplateParameterSuffix
# value: ''
# - key: readability-identifier-naming.TypeTemplateParameterCase
# value: aNy_CasE
# - key: readability-identifier-naming.TypeTemplateParameterPrefix
# value: ''
# - key: readability-identifier-naming.TypeTemplateParameterSuffix
# value: ''
# - key: readability-identifier-naming.TypedefCase
# value: aNy_CasE
# - key: readability-identifier-naming.TypedefPrefix
# value: ''
# - key: readability-identifier-naming.TypedefSuffix
# value: ''
# - key: readability-identifier-naming.UnionCase
# value: aNy_CasE
# - key: readability-identifier-naming.UnionPrefix
# value: ''
# - key: readability-identifier-naming.UnionSuffix
# value: ''
# - key: readability-identifier-naming.ValueTemplateParameterCase
# value: aNy_CasE
# - key: readability-identifier-naming.ValueTemplateParameterPrefix
# value: ''
# - key: readability-identifier-naming.ValueTemplateParameterSuffix
# value: ''
# - key: readability-identifier-naming.VariableCase
# value: aNy_CasE
# - key: readability-identifier-naming.VariablePrefix
# value: ''
# - key: readability-identifier-naming.VariableSuffix
# value: ''
# - key: readability-identifier-naming.VirtualMethodCase
# value: aNy_CasE
# - key: readability-identifier-naming.VirtualMethodPrefix
# value: ''
# - key: readability-identifier-naming.VirtualMethodSuffix
# value: ''
# - key: readability-simplify-boolean-expr.ChainedConditionalAssignment
# value: '0'
# - key: readability-simplify-boolean-expr.ChainedConditionalReturn
# value: '0'
- key: modernize-use-override.OverrideSpelling
value: 'ZMQ_OVERRIDE'
- key: modernize-use-override.FinalSpelling
value: 'ZMQ_FINAL'

View File

@@ -1,2 +0,0 @@
# tree-wide clang format
41f459e1dc6f7cdedd1268298153c970e290b2ce

View File

@@ -1,48 +0,0 @@
# Pull Request Notice
Before sending a pull request make sure each commit solves one clear, minimal,
plausible problem. Further each commit should have the following format:
```
Problem: X is broken
Solution: do Y and Z to fix X
```
Please try to have the code changes conform to our coding style. For your
convenience, you can install clang-format (at least version 5.0) and then
run ```make clang-format-check```. Don't fix existing issues, if any - just
make sure your changes are compliant. ```make clang-format-diff``` will
automatically apply the required changes.
To set a specific clang-format binary with autotools, you can for example
run: ```./configure CLANG_FORMAT=clang-format-5.0```
Please avoid sending a pull request with recursive merge nodes, as they
are impossible to fix once merged. Please rebase your branch on
zeromq/libzmq master instead of merging it.
```
git remote add upstream git@github.com:zeromq/libzmq.git
git fetch upstream
git rebase upstream/master
git push -f
```
In case you already merged instead of rebasing you can drop the merge commit.
```
git rebase -i HEAD~10
```
Now, find your merge commit and mark it as drop and save. Finally rebase!
If you are a new contributor please have a look at our contributing guidelines:
[CONTRIBUTING](http://zeromq.org/docs:contributing)
# FIRST TIME CONTRIBUTORS PLEASE NOTE
Please add an additional commit with a relicensing grant.
[Example](https://github.com/zeromq/libzmq/commit/fecbd42dbe45455fff3b6456350ceca047b82050)
[More information on RELICENSING effort](https://github.com/zeromq/libzmq/tree/master/RELICENSE/README.md)

View File

@@ -1,22 +0,0 @@
*Please use this template for reporting suspected bugs or requests for help.*
# Issue description
# Environment
* libzmq version (commit hash if unreleased):
* OS:
# Minimal test code / Steps to reproduce the issue
1.
# What's the actual result? (include assertion message & call stack if applicable)
# What's the expected result?

View File

@@ -1,19 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 365
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 56
# Issues with these labels will never be considered stale
exemptLabels:
- "Help Request"
- "Feature Request"
- "Problem reproduced"
- Critical
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
activity for 365 days. It will be closed if no further activity occurs within
56 days. Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@@ -1,243 +0,0 @@
name: CI
on:
push:
pull_request:
schedule:
- cron: "0 9 * * 5"
jobs:
build:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- platform: x64
configuration: release
os: windows-2019
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
CMAKE_GENERATOR: Visual Studio 16 2019
MSVCVERSION: v142
MSVCYEAR: vs2019
ARTIFACT_NAME: v142-x64
ENABLE_DRAFTS: ON
- platform: x64
configuration: Release
os: windows-2016
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
MSVCVERSION: "v141"
MSVCYEAR: "vs2017"
ARTIFACT_NAME: v141-x64
ENABLE_DRAFTS: ON
- os: ubuntu-latest
BUILD_TYPE: default
PACKAGES: asciidoc xmlto
CURVE: tweetnacl
DRAFT: disabled
POLLER: select
- os: ubuntu-latest
BUILD_TYPE: default
CURVE: tweetnacl
DRAFT: disabled
POLLER: poll
- os: ubuntu-latest
BUILD_TYPE: android
CURVE: tweetnacl
DRAFT: disabled
- os: ubuntu-latest
BUILD_TYPE: coverage
PACKAGES: libkrb5-dev libnorm-dev libpgm-dev libgnutls28-dev lcov
CURVE: tweetnacl
DRAFT: enabled
GSSAPI: enabled
PGM: enabled
NORM: enabled
TIPC: enabled
TLS: enabled
VMCI: enabled
- os: ubuntu-latest
BUILD_TYPE: valgrind
PACKAGES: valgrind libgnutls28-dev
CURVE: tweetnacl
DRAFT: enabled
- os: ubuntu-latest
BUILD_TYPE: cmake
CURVE: libsodium
DRAFT: enabled
PACKAGES: cmake libsodium-dev
TLS: enabled
- os: ubuntu-latest
BUILD_TYPE: cmake
DRAFT: enabled
PACKAGES: cmake clang-format-11
DO_CLANG_FORMAT_CHECK: 1
- os: ubuntu-latest
BUILD_TYPE: default
PACKAGES: libkrb5-dev libnorm-dev libpgm-dev libgnutls28-dev libsodium-dev libnss3-dev libbsd-dev
CURVE: libsodium
ADDRESS_SANITIZER: enabled
DRAFT: enabled
- os: ubuntu-latest
BUILD_TYPE: default
PACKAGES: libkrb5-dev libnorm-dev libpgm-dev libgnutls28-dev libsodium-dev libnss3-dev libbsd-dev
CURVE: libsodium
GSSAPI: enabled
PGM: enabled
NORM: enabled
TIPC: enabled
IPv6: ON
TLS: enabled
USE_NSS: yes
VMCI: enabled
DRAFT: enabled
- os: ubuntu-latest
BUILD_TYPE: default
PACKAGES: libkrb5-dev libnorm-dev libpgm-dev libgnutls28-dev libsodium-dev libnss3-dev
CURVE: libsodium
GSSAPI: enabled
PGM: enabled
NORM: enabled
TIPC: enabled
IPv6: ON
TLS: enabled
USE_NSS: yes
VMCI: enabled
DRAFT: enabled
FORCE_98: enabled
CXX: clang++
- os: ubuntu-latest
BUILD_TYPE: abi-compliance-checker
PACKAGES: abi-dumper abi-compliance-checker
CURVE: tweetnacl
DRAFT: disabled
- os: ubuntu-latest
BUILD_TYPE: cmake
PACKAGES: clang-tidy clang-tools
CURVE: tweetnacl
DRAFT: enabled
CXX: clang++
- os: macos-latest
BUILD_TYPE: default
PACKAGES: automake autoconf
CURVE: tweetnacl
DRAFT: enabled
- os: macos-latest
BUILD_TYPE: default
PACKAGES: automake autoconf libsodium
CURVE: libsodium
DRAFT: disabled
env:
platform: ${{ matrix.platform }}
configuration: ${{ matrix.configuration }}
WITH_LIBSODIUM: ${{ matrix.WITH_LIBSODIUM }}
ENABLE_CURVE: ${{ matrix.ENABLE_CURVE }}
CMAKE_GENERATOR: ${{ matrix.CMAKE_GENERATOR }}
MSVCVERSION: ${{ matrix.MSVCVERSION }}
MSVCYEAR: ${{ matrix.MSVCYEAR }}
ARTIFACT_NAME: ${{ matrix.ARTIFACT_NAME }}
ENABLE_DRAFTS: ${{ matrix.ENABLE_DRAFTS }}
SODIUM_INCLUDE_DIR: ${{ github.workspace }}\libsodium\src\libsodium\include"
SODIUM_LIBRARY_DIR: ${{ github.workspace }}\libsodium\bin\${{ matrix.platform }}\${{ matrix.configuration }}\${{ matrix.MSVCVERSION }}\dynamic"
LIBZMQ_SRCDIR: ${{ github.workspace }}\libzmq
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
CURVE: ${{ matrix.CURVE }}
DRAFT: ${{ matrix.DRAFT }}
ADDRESS_SANITIZER: ${{ matrix.ADDRESS_SANITIZER }}
DO_CLANG_FORMAT_CHECK: ${{ matrix.DO_CLANG_FORMAT_CHECK }}
FORCE_98: ${{ matrix.FORCE_98 }}
CXX: ${{ matrix.CXX }}
GSSAPI: ${{ matrix.GSSAPI }}
PGM: ${{ matrix.PGM }}
NORM: ${{ matrix.NORM }}
TIPC: ${{ matrix.TIPC }}
IPv6: ${{ matrix.IPv6 }}
TLS: ${{ matrix.TLS }}
USE_NSS: ${{ matrix.USE_NSS }}
VMCI: ${{ matrix.VMCI }}
POLLER: ${{ matrix.POLLER }}
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
if: matrix.os == 'windows-2019'
- name: Add msbuild to PATH 2016
uses: microsoft/setup-msbuild@v1.0.2
with:
vs-version: '[15.0,16.0)'
if: matrix.os == 'windows-2016'
- uses: actions/checkout@v2
if: matrix.WITH_LIBSODIUM == 'ON'
with:
repository: jedisct1/libsodium
ref: stable
path: libsodium
- name: Compile libsodium
if: matrix.WITH_LIBSODIUM == 'ON' && (matrix.os == 'windows-2019' || matrix.os == 'windows-2016')
shell: cmd
working-directory: libsodium
run: msbuild /v:minimal /p:Configuration=%Configuration%DLL builds\msvc\%MSVCYEAR%\libsodium\libsodium.vcxproj
- name: Copy libsodium
if: matrix.WITH_LIBSODIUM == 'ON' && (matrix.os == 'windows-2019' || matrix.os == 'windows-2016')
shell: powershell
working-directory: libsodium
run: Copy-Item "bin\${env:Platform}\${env:Configuration}\${env:MSVCVERSION}\dynamic\libsodium.lib" -Destination "bin\${env:Platform}\${env:Configuration}\${env:MSVCVERSION}\dynamic\sodium.lib"
- uses: actions/checkout@v2
with:
path: libzmq
- run: md build_libzmq
shell: cmd
if: matrix.os == 'windows-2019' || matrix.os == 'windows-2016'
- name: build-win
if: matrix.os == 'windows-2019' || matrix.os == 'windows-2016'
shell: cmd
working-directory: build_libzmq
run: |
cmake -D CMAKE_INCLUDE_PATH="%SODIUM_INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%SODIUM_LIBRARY_DIR%" -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D ENABLE_DRAFTS="%ENABLE_DRAFTS%" -D ENABLE_ANALYSIS="%ENABLE_ANALYSIS%" -D ENABLE_CURVE="%ENABLE_CURVE%" -D API_POLLER="%API_POLLER%" -D POLLER="%POLLER%" %EXTRA_FLAGS% -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D LIBZMQ_WERROR="%LIBZMQ_WERROR%" -G "%CMAKE_GENERATOR%" "%LIBZMQ_SRCDIR%"
cmake --build . --config %configuration% --target install -- -verbosity:Minimal -maxcpucount
- name: test
if: matrix.os == 'windows-2019' || matrix.os == 'windows-2016'
shell: cmd
working-directory: build_libzmq
run: ctest -C "%Configuration%"
- name: Add debian packages
if: matrix.os == 'ubuntu-latest' && (matrix.BUILD_TYPE != 'coverage' || github.repository == 'zeromq/libzmq')
uses: myci-actions/add-deb-repo@10
with:
repo-name: obs
repo: deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_20.04/ ./
keys-asc: https://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-stable/xUbuntu_20.04/Release.key
install: ${{ matrix.PACKAGES }}
- name: Add brew packages
if: matrix.os == 'macos-latest'
shell: bash
run: brew install ${{ matrix.PACKAGES }}
- name: build
if: (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && (matrix.BUILD_TYPE != 'coverage' || github.repository == 'zeromq/libzmq')
shell: bash
working-directory: libzmq
run: ./ci_build.sh
- name: coveralls
if: matrix.BUILD_TYPE == 'coverage' && github.repository == 'zeromq/libzmq'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: /home/runner/work/libzmq/libzmq/libzmq/lcov.info
cron:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
strategy:
fail-fast: false
env:
BUILD_TYPE: cmake
CXX: clang++
CLANG_TIDY: clang-tidy
steps:
- name: Add debian packages
run: apt-get install --yes clang-tidy clang-tools
- name: build
shell: bash
working-directory: libzmq
run: ./ci_build.sh

View File

@@ -1,35 +0,0 @@
name: Fuzzers
on:
push:
branches:
- master
pull_request:
paths:
- '.github/workflows/Fuzzers.yaml'
- 'src/*'
- 'tests/*fuzzer.cpp'
jobs:
Fuzzing:
runs-on: ubuntu-latest
if: github.repository == 'zeromq/libzmq'
strategy:
matrix:
san: [address, memory, undefined]
steps:
- name: Build Fuzzers (${{ matrix.san }})
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
sanitizer: ${{ matrix.san }}
oss-fuzz-project-name: 'libzmq'
allowed-broken-targets-percentage: 0
dry-run: false
- name: Run Fuzzers (${{ matrix.san }})
id: run
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
sanitizer: ${{ matrix.san }}
oss-fuzz-project-name: 'libzmq'
allowed-broken-targets-percentage: 0
dry-run: false
fuzz-seconds: 300

127
libs/libzmq/.gitignore vendored
View File

@@ -1,127 +0,0 @@
syntax: glob # for hg-git users
# Generated build scripts and IDE generating files
## autotools
/Makefile
builds/Makefile
builds/deprecated-msvc/Makefile
doc/Makefile
libtool
### automake
Makefile.in
.deps/
.dirstamp
### autoconf
autom4te.cache
aclocal.m4
config
config.status
config.log
configure
stamp-h1
## CMake
cmake-build-debug/
build/
## Android
builds/android/prefix
## IntelliJ
.idea/
## Visual Code
.vscode/
## other results-like folders
bin/
lib/
obj/
## Doxygen
doxygen/
## Packaging
packaging/nuget/*.nupkg
# Test related build files
libtestutil.a
libunity.a
# Some build outputs and temporal files
*.o
*.gcno
*.gcda
*.gcov
*.ncb
*.lo
*.loT
*.la
*.exe
*.html
*.pdf
*.ps
*~
.*~
.libs
# /src
## Ignore generated files in configuration process
src/platform.hpp*
src/libzmq.pc
# /tools
## Executable binaries are ignored
tools/curve_keygen
## Executable source files must be tracked
!tools/*.[ch]
!tools/*.[ch]pp
# /tests
## Test binaries and logs are ignored
tests/test*
tests/test*.log
tests/test*.trs
## Test source files must be tracked
!tests/test*.[ch]
!tests/test*.[ch]pp
## Build script and documentations must be tracked
!tests/CMakeLists.txt
!tests/README.md
# /unittests
## Unit test binaries and logs are ignored
unittests/unittest_*
unittests/unittest*.log
unittests/unittest*.trs
## Unit test source files must be tracked
!unittests/unittest*.[ch]
!unittests/unittest*.[ch]pp
## Build script and documentations must be tracked
!unittests/CMakeLists.txt
!unittests/README.md
# check test log files
test-suite*.log
# /perf
## Benchmarking binaries and result files are ignored
perf/*_lat
perf/*_thr
perf/benchmark_*
perf/results
## Benchmarking source files must be tracked
!perf/*.[ch]
!perf/*.[ch]pp
## Benchmarking tool scripts must be tracked
!perf/*.py
!perf/*.sh
# /doc
## Generated document files
doc/*.[137]
doc/*.html
doc/*.xml
# external libraries and release archive files
foreign/openpgm/*
!foreign/openpgm/*.tar.bz2
!foreign/openpgm/*.tar.gz
!foreign/openpgm/Makefile.am
zeromq-*.tar.gz
zeromq-*.zip
core

View File

@@ -1,2 +0,0 @@
[patterns]
** = native

View File

@@ -1,81 +0,0 @@
Ahmet Kakici <ahmet.kakici@pro-line.com.tr> ahmet <ahmet.kakici@pro-line.com.tr>
Andrey Sibiryov <me@kobology.ru> Kobolog <me@kobology.ru>
Brian Knox <taotetek@gmail.com> taotetek <taotetek@users.noreply.github.com>
Chernyshev Vyacheslav <astellar@ro.ru> Astellar <astellar@ro.ru>
Chris Laws <clawsicus@gmail.com> Chris Laws <claws@localhost>
Chris Staite <chris@yourdreamnet.co.uk> Chris <chris@yourdreamnet.co.uk>
Christoph Zach <czach@rst-automation.com> czach <czach@rst-automation.com>
Chuck Remes <git@chuckremes.com> Chuck Remes <cremes@mac.com>
Chuck Remes <git@chuckremes.com> Chuck Remes <cremes.devlist@mac.com>
Constantin Rack <constantin.rack@gmail.com> Constantin Rack <constantin@rack.li>
Constantin Rack <constantin.rack@gmail.com> Constantin Rack <c-rack@users.noreply.github.com>
Daniel Krikun <krikun.daniel@gmail.com> danielkr <krikun.daniel@gmail.com>
Daiyu Hurst <daiyu.hurst@gmail.com> DaiyuHurst <daiyu.hurst@gmail.com>
Diego Rodriguez-Losada <diego.rlosada@gmail.com> Diego <diego.rlosada@gmail.com>
Dongmin Yu <miniway@gmail.com> Min(Dongmin Yu) <miniway@gmail.com>
Doron Somech <somdoron@gmail.com> somdoron <somdoron@gmail.com>
Elliot Saba <staticfloat@gmail.com> staticfloat <staticfloat@gmail.com>
Eric Voskuil <eric@voskuil.org> evoskuil <eric@voskuil.org>
Eric Voskuil <eric@voskuil.org> anonymous <eric@voskuil.org>
Felipe Farinon <felipe.farinon@powersyslab.com> psl-felipefarinon <felipe.farinon@powersyslab.com>
Frank Hartmann <soundart@gmx.net> Frank <soundart@gmx.net>
Gian Lorenzo Meocci <glmeocci@gmail.com> meox <glmeocci@gmail.com>
Hardeep Singh <hshardeesi@gmail.com> Hardeep <hshardeesi@gmail.com>
Henrik Feldt <henrik@haf.se> Henrik <henrik@haf.se>
Huang Xin <chrox.huang@gmail.com> chrox <chrox.huang@gmail.com>
Ian Barber <ian.barber@gmail.com> Ian Barber <ianbarber@google.com>
Jens Auer <jens.auer@cgi.com> Jens Auer <jens-auer@users.noreply.github.com>
Jens Auer <jens.auer@cgi.com> Jens Auer <jens.auer@betaversion.net>
Joe Eli McIlvain <joe.eli.mac@gmail.com> Joe McIlvain <joe.eli.mac@gmail.com>
Jos Decoster <jos.decoster@gmail.com> jdc8 <jos.decoster@gmail.com>
Jos Decoster <jos.decoster@gmail.com> Jos Decoster <jos.decoster@retarget.com>
Joshua Gao <jmg116@gmail.com> Josh Gao <jgao@mobileiron.com>
Jörg Kreuzberger <joerg@kreuzberger.eu> kreuzberger <joerg@kreuzberger.eu>
Arnaud Kapp <kapp.arno@gmail.com> Kapp Arnaud <kapp.arno@gmail.com>
Arnaud Kapp <kapp.arno@gmail.com> KAPP Arnaud <kapp.arno@gmail.com>
Arnaud Kapp <kapp.arno@gmail.com> KAPP Arnaud <xaqq@users.noreply.github.com>
Kenneth Wilke <kenneth.wilke@rackspace.com> KennethWilke <kenneth.wilke@rackspace.com>
Kevin Sapper <mail@kevinsapper.de> sappo <mail@kevinsapper.de>
Kevin Sapper <mail@kevinsapper.de> Kevin Sapper <sappo@users.noreply.github.com>
Leonard Michelet <leonard.michelet@openwide.fr> leonarf <leonard.michelet@openwide.fr>
Martijn Jasperse <m.jasperse@gmail.com> mjasperse <m.jasperse@gmail.com>
Martin Hurton <hurtonm@gmail.com> Martin Hurtoň <hurtonm@gmail.com>
Martin Lucina <martin@lucina.net> Martin Lucina <mato@kotelna.sk>
Martin Sustrik <sustrik@250bpm.com> Martin Sustrik <sustrik@fastmq.commkdir>
Martin Sustrik <sustrik@250bpm.com> Martin Sustrik <sustrik@fastmq.com>
Martin Sustrik <sustrik@250bpm.com> sustrik <sustrik@250bpm.com>
Martin Sustrik <sustrik@250bpm.com> Martin Sustrik <sustrik@jozsi.(none)>
Martin Sustrik <sustrik@250bpm.com> unknown <sustrik@.(none)>
Martin Sustrik <sustrik@250bpm.com> Martin Sustrik <sustrik@turist.(none)>
Maurice Barnum <msb@yahoo-inc.com> maurice barnum <msb@yahoo-inc.com>
Maurizio Melato <maurizio.melato@nice-software.com> unknown <mauri@okinawa.(none)>
Max Skaller <Max.Skaller@gmail.com> skaller <Max.Skaller@gmail.com>
Michael Fox <415fox@gmail.com> m <415fox@gmail.com>
Michael Hand <mipa@matrix.by> Mipa <mipa@matrix.by>
Michel Zou <xantares10@hotmail.com> xantares <xantares09@hotmail.com>
Mikael Helbo Kjaer <mhk@designtech.dk> Mikael Helbo Kjær <mhk@designtech.dk>
Mike Gatny <mgatny@gmail.com> Mike Gatny <mgatny@connamara.com>
Mikko Koppanen <mikko.koppanen@gmail.com> Mikko Koppanen <mkoppanen@php.net>
Mikko Koppanen <mikko.koppanen@gmail.com> Mikko Koppanen <mikko@kuut.io>
Mikko Koppanen <mikko.koppanen@gmail.com> Mikko Koppanen <mkoppanen@gameboy.config>
Min RK <benjaminrk@gmail.com> MinRK <benjaminrk@gmail.com>
Min RK <benjaminrk@gmail.com> Min Ragan-Kelley <benjaminrk@gmail.com>
Montoya Edu <montoya.edu@gmail.com> montoyaedu <montoya.edu@gmail.com>
Nikita Kozlov <nikita@elyzion.net> nikita kozlov <nikita@elyzion.net>
Pavol Malosek <malosek@fastmq.com> malosek <malosek@fastmq.com>
Pieter Hintjens <ph@imatix.com> Pieter Hintjens <ph@itmatix.com>
Reza Ebrahimi <reza.ebrahimi.dev@gmail.com> reza.ebrahimi <reza.ebrahimi.dev@gmail.com>
Ricardo Catalinas Jiménez <r@untroubled.be> Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
Rohan Bedarkar <rohanb@cs.uchicago.edu> rohanbedarkar <rohanb@cs.uchicago.edu>
Rohan Bedarkar <rohanb@cs.uchicago.edu> Rohan <rbe@ws5-34-chi.rtsgroup.net>
Sergey KHripchenko <shripchenko@intermedia.net> root <root@ast-pbx-mt-3.intermedia.net>
Sergey KHripchenko <shripchenko@intermedia.net> shripchenko <shripchenko@intermedia.net>
Sergey M. <dstftw@gmail.com> Sergey M <dstftw@gmail.com>
Steven McCoy <steven.mccoy@miru.hk> Steve-o <fnjordy@gmail.com>
Tamara Kustarova <kustarova@fastmq.com> tamara <tamara@jozsi.(none)>
Timothee Besset <ttimo@ttimo.net> Timothee "TTimo" Besset <ttimo@ttimo.net>
Timothy Mossbarger <tim@ent.net> Tim M <tim@ent.net>
Trevor Bernard <trevor.bernard@gmail.com> Trevor Bernard <tbernard@liveops.com>
Trevor Bernard <trevor.bernard@gmail.com> Trevor Bernard <trevor.bernard@userevents.com>
Volodymyr Korniichuk <VolodymyrKorn@gmail.com> Volodymyr Korniichuk <9173519@gmail.com>
lysyloren <lysy_loren@gmail.com> lysyloren <lysy.loren@gmail.com>

View File

@@ -1,16 +0,0 @@
workflow:
steps:
- branch_package:
source_project: network:messaging:zeromq:git-draft
source_package: libzmq
target_project: network:messaging:zeromq:ci
release:
steps:
- trigger_services:
project: network:messaging:zeromq:release-stable
package: libzmq
- trigger_services:
project: network:messaging:zeromq:release-draft
package: libzmq
filters:
event: tag_push

View File

@@ -1,43 +0,0 @@
# Travis CI script
language: c
os:
- linux
dist: bionic
cache: ccache
env:
matrix:
- BUILD_TYPE=default
# tokens to deploy releases on OBS and create/delete temporary branch on Github.
# 1) Create a token on https://github.com/settings/tokens/new with "public_repo"
# capability and encrypt it with travis encrypt --org -r zeromq/libzmq GH_TOKEN="<token>"
# 2) Create 2 OBS tokens with osc token --create network:messaging:zeromq:release-<stable|draft> libzmq
# encrypt them with travis encrypt --org -r zeromq/libzmq OBS_<STABLE|DRAFT>_TOKEN="<token>"
global:
- secure: aaIs9Y44FYp9VFCqa6LLD4illBH4aUfbS0zzzbAQ5xJvD6NfBsMiKEIhf/kRNCHAtP+1VfQVOejTD6/i08ALsVr3cZD9oB/t7874tz2/jeZUIhRNo+1KwyaVqNg0yUSV6ASIoq4aOfuGnjBlezNQ8LQ2bjQB2m4Enl5wxoYcYdA=
- secure: YFrcedBIKe0NR1WC6qQi9phZgtnzOiBIXm40TirvCtstV4eVnSouKgtQfLLArZ4o2tjflq4grQQNo1rJatvyi5YPOXsMcndsni18S+4Ffu8qbECdtPrK52vBweuf7q9oV9Ydax0Fm4bEqEMOZ2/mRBy3nK+mgsE3upeMwyWR0Zw=
- secure: lbZSzmqN39QdJwewKOZgq/1ijPKuyx9MFrGzMqXj2+eOSlaZS/tNavHMdKJOev+qJGK9wxmwzxOxS10AiH+AvN7WBacXX4ZtudjScz2HKJRDWTKyzMbzyScq51afniItzrsm+Vo8NHkenNFkux0sSbh0aHlpkLwrGQu+WZWcDN4=
- secure: "ZFL7hLJlGwYix8fF835OnQYakBt/o5iS7IfSW7el44ejEvGAOM9O5/ufxCcqSqn8Np7nOaM3RriAVTqWPZD6S7tMeflGTSGYHPYwWUc83z4rUPyG2FWVKXdB8ufpebAwu3hCgLiSmVeoQG47dl6xNk1oKCd+3UIjgz33u1Ecfps="
# Build and check this project according to the BUILD_TYPE
script: ./ci_build.sh
# Deploy tags
before_deploy:
- . ./ci_deploy.sh
deploy:
provider: releases
api_key:
secure: vGB5E+A8wxm2J1GJZzmIgT9PrjEzvd9gE8iui8FyxSbxAsW9vFZFGZC/21sTtpVcmRarwQCHH1UEbtg+nJwN2iD9YzMRnSVks8xqP+b709YW+VXaMuhZgTzWa74IorQku7NuvLibvQk72/OSgdwPGaNJ6f5AX9pnWVWbEoW1svE=
file_glob: true
file: ${LIBZMQ_DEPLOYMENT}
skip_cleanup: true
on:
repo: zeromq/libzmq
branch: master
tags: true
condition: "$TRAVIS_OS_NAME =~ (linux) && $BUILD_TYPE =~ (default) && $CURVE =~ (libsodium) && -z $DRAFT"

View File

@@ -1,152 +0,0 @@
Corporate Contributors
======================
Copyright (c) 2007-2014 iMatix Corporation
Copyright (c) 2009-2011 250bpm s.r.o.
Copyright (c) 2010-2011 Miru Limited
Copyright (c) 2011 VMware, Inc.
Copyright (c) 2012 Spotify AB
Copyright (c) 2013 Ericsson AB
Copyright (c) 2014 AppDynamics Inc.
Copyright (c) 2015 Google, Inc.
Copyright (c) 2015-2016 Brocade Communications Systems Inc.
Individual Contributors
=======================
AJ Lewis
Alexej Lotz
Andrew Thompson
André Caron
Asko Kauppi
Attila Mark
Barak Amar
Ben Gray
Bernd Melchers
Bernd Prager
Bob Beaty
Brandon Carpenter
Brett Cameron
Brian Buchanan
Burak Arslan
Carl Clemens
Chia-liang Kao
Chris Busbey
Chris Rempel
Chris Wong
Christian Gudrian
Christian Kamm
Chuck Remes
Conrad D. Steenberg
Constantin Rack
Daniel J. Bernstein
Dhammika Pathirana
Dhruva Krishnamurthy
Dirk O. Kaar
Doron Somech
Douglas Creager
Drew Crawford
Erich Heine
Erik Hugne
Erik Rigtorp
Fabien Ninoles
Frank Denis
George Neill
Gerard Toonstra
Ghislain Putois
Gonzalo Diethelm
Guido Goldstein
Harald Achitz
Hardeep Singh
Hiten Pandya
Ian Barber
Ilja Golshtein
Ilya Kulakov
Ivo Danihelka
Jacob Rideout
Joe Thornber
Jon Dyte
Kamil Shakirov
Ken Steele
Kouhei Sutou
Laurent Alebarde
Leonardo J. Consoni
Lionel Flandrin
Lourens Naudé
Luca Boccassi
Marc Rossi
Mark Barbisan
Martin Hurton
Martin Lucina
Martin Pales
Martin Sustrik
Matus Hamorsky
Max Wolf
McClain Looney
Michael Compton
Mika Fischer
Mikael Helbo Kjaer
Mike Gatny
Mikko Koppanen
Min Ragan-Kelley
Neale Ferguson
Nir Soffer
Osiris Pedroso
Paul Betts
Paul Colomiets
Pavel Gushcha
Pavol Malosek
Perry Kundert
Peter Bourgon
Philip Kovacs
Pieter Hintjens
Piotr Trojanek
Reza Ebrahimi
Richard Newton
Rik van der Heijden
Robert G. Jakabosky
Sebastian Otaegui
Stefan Radomski
Steven McCoy
Stuart Webster
Tamara Kustarova
Taras Shpot
Tero Marttila
Terry Wilson
Thijs Terlouw
Thomas Rodgers
Tim Mossbarger
Toralf Wittner
Tore Halvorsen
Trevor Bernard
Vitaly Mayatskikh
Credits
=======
Aamir Mohammad
Adrian von Bidder
Aleksey Yeschenko
Alessio Spadaro
Alexander Majorov
Anh Vu
Bernd Schumacher
Brian Granger
Carsten Dinkelmann
David Bahi
Dirk Eddelbuettel
Evgueny Khartchenko
Frank Vanden Berghen
Ian Barber
John Apps
Markus Fischer
Matt Muggeridge
Michael Santy
Oleg Sevostyanov
Paulo Henrique Silva
Peter Busser
Peter Lemenkov
Robert Zhang
Toralf Wittner
Zed Shaw

File diff suppressed because it is too large Load Diff

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,181 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
--------------------------------------------------------------------------------
SPECIAL EXCEPTION GRANTED BY COPYRIGHT HOLDERS
As a special exception, copyright holders give you permission to link this
library with independent modules to produce an executable, regardless of
the license terms of these independent modules, and to copy and distribute
the resulting executable under terms of your choice, provided that you also
meet, for each linked independent module, the terms and conditions of
the license of that module. An independent module is a module which is not
derived from or based on this library. If you modify this library, you must
extend this exception to your version of the library.
Note: this exception relieves you of any obligations under sections 4 and 5
of this license, and section 6 of the GNU General Public License.

View File

@@ -1,32 +0,0 @@
FROM debian:buster-slim AS builder
LABEL maintainer="ZeroMQ Project <zeromq@imatix.com>"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -qq --yes --no-install-recommends \
autoconf \
automake \
build-essential \
git \
libkrb5-dev \
libsodium-dev \
libtool \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/libzmq
COPY . .
RUN ./autogen.sh \
&& ./configure --prefix=/usr/local --with-libsodium --with-libgssapi_krb5 \
&& make \
&& make check \
&& make install
FROM debian:buster-slim
LABEL maintainer="ZeroMQ Project <zeromq@imatix.com>"
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -qq --yes --no-install-recommends \
libkrb5-dev \
libsodium23 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
RUN ldconfig && ldconfig -p | grep libzmq

File diff suppressed because it is too large Load Diff

View File

@@ -1,315 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
From GitHub
===========
If you clone the Git repository then you should start by running the
command `./autogen.sh`. This is not necessary if you get the source
packages.
CMake installation
==================
The following options are available for cmake invocation:
- `WITH_PERF_TOOL'
Enables the build of performance tools. Default value is ON.
- `ZMQ_BUILD_TESTS'
Builds ZeroMQ tests. Default value is ON.
- `ENABLE_CPACK'
Enables CPack build rules. This option has effect on Windows
platform only. Default value is ON. Turn it to OFF if you
don't want the runtime libraries to be installed (typically
if your installation destination already contains them).
Example: installing ZeroMQ on Windows with no tests, no performance
tools, and no runtime library copy:
cmake -G "NMake Makefiles" -D WITH_PERF_TOOL=OFF -D ZMQ_BUILD_TESTS=OFF
-D ENABLE_CPACK=OFF -D CMAKE_BUILD_TYPE=Release
Windows Builds
==============
On Windows, use CMake for building, or for generating a Visual Studio solution file.
The library can also be built for the Windows 10 UWP platform through CMake :
cmake -H. -B<build dir> -G"Visual Studio 14 2015 Win64" \
-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 \
-DENABLE_CURVE=OFF -DZMQ_BUILD_TESTS=OFF
In VS 2012 it is mandatory to increase the default stack size of 1 MB to
at least 2 MB due to implementation of std::map intermittently requiring
substantial amount of stack and causing stack overflow.
Windows Builds - Static
=======================
When linking statically with libzmq your CFLAGS and/or CPPFLAGS need to include
`-DZMQ_STATIC` otherwise `__dclspec(dllimport)` will be set for all functions
and the build will fail.
This is a workaround for issue:
https://github.com/zeromq/libzmq/issues/2788
Windows Builds - Wine
=====================
To use Windows binaries on *nix via Wine, it is necessary to ensure that the
kernel TCP buffers are large enough. On some systems, like OS X, they are too
small by default.
They need to be set to at least one MB as a workaround for issue:
https://github.com/zeromq/libzmq/issues/1608
sudo sysctl -w net.inet.tcp.sendspace=1300000
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'. If you are building a development version from the
Github source, for example, use `./autogen.sh' to generate `configure'
and other necessary installation scripts.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package. Note that `make -j check' is not supported as some
tests share infrastructure and cannot be run in parallel.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
OS X Builds - Documentation
===========================
Basic installation on OS X may fail in `Making all in doc' step. This
error can be resolved by adding environment variable for shell.
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog
Write command above in shell for instant resolve, or append command into
shell profile file and reload for permanent resolve.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@@ -1,485 +0,0 @@
pipeline {
agent { label "linux || macosx || bsd || solaris || posix || windows" }
parameters {
// Use DEFAULT_DEPLOY_BRANCH_PATTERN and DEFAULT_DEPLOY_JOB_NAME if
// defined in this jenkins setup -- in Jenkins Management Web-GUI
// see Configure System / Global properties / Environment variables
// Default (if unset) is empty => no deployment attempt after good test
// See zproject Jenkinsfile-deploy.example for an example deploy job.
// TODO: Try to marry MultiBranchPipeline support with pre-set defaults
// directly in MultiBranchPipeline plugin, or mechanism like Credentials,
// or a config file uploaded to master for all jobs or this job, see
// https://jenkins.io/doc/pipeline/examples/#configfile-provider-plugin
string (
defaultValue: '${DEFAULT_DEPLOY_BRANCH_PATTERN}',
description: 'Regular expression of branch names for which a deploy action would be attempted after a successful build and test; leave empty to not deploy. Reasonable value is ^(master|release/.*|feature/*)$',
name : 'DEPLOY_BRANCH_PATTERN')
string (
defaultValue: '${DEFAULT_DEPLOY_JOB_NAME}',
description: 'Name of your job that handles deployments and should accept arguments: DEPLOY_GIT_URL DEPLOY_GIT_BRANCH DEPLOY_GIT_COMMIT -- and it is up to that job what to do with this knowledge (e.g. git archive + push to packaging); leave empty to not deploy',
name : 'DEPLOY_JOB_NAME')
booleanParam (
defaultValue: true,
description: 'If the deployment is done, should THIS job wait for it to complete and include its success or failure as the build result (true), or should it schedule the job and exit quickly to free up the executor (false)',
name: 'DEPLOY_REPORT_RESULT')
booleanParam (
defaultValue: true,
description: 'Attempt stable build without DRAFT API in this run?',
name: 'DO_BUILD_WITHOUT_DRAFT_API')
booleanParam (
defaultValue: true,
description: 'Attempt build with DRAFT API in this run?',
name: 'DO_BUILD_WITH_DRAFT_API')
booleanParam (
defaultValue: true,
description: 'Attempt a build with docs in this run? (Note: corresponding tools are required in the build environment)',
name: 'DO_BUILD_DOCS')
booleanParam (
defaultValue: false,
description: 'Publish as an archive a "dist" tarball from a build with docs in this run? (Note: corresponding tools are required in the build environment; enabling this enforces DO_BUILD_DOCS too)',
name: 'DO_DIST_DOCS')
booleanParam (
defaultValue: true,
description: 'Attempt "make check" in this run?',
name: 'DO_TEST_CHECK')
booleanParam (
defaultValue: false,
description: 'Attempt "make memcheck" in this run?',
name: 'DO_TEST_MEMCHECK')
booleanParam (
defaultValue: true,
description: 'Attempt "make distcheck" in this run?',
name: 'DO_TEST_DISTCHECK')
booleanParam (
defaultValue: true,
description: 'Attempt a "make install" check in this run?',
name: 'DO_TEST_INSTALL')
string (
defaultValue: "`pwd`/tmp/_inst",
description: 'If attempting a "make install" check in this run, what DESTDIR to specify? (absolute path, defaults to "BUILD_DIR/tmp/_inst")',
name: 'USE_TEST_INSTALL_DESTDIR')
booleanParam (
defaultValue: true,
description: 'Attempt "cppcheck" analysis before this run? (Note: corresponding tools are required in the build environment)',
name: 'DO_CPPCHECK')
booleanParam (
defaultValue: true,
description: 'Require that there are no files not discovered changed/untracked via .gitignore after builds and tests?',
name: 'REQUIRE_GOOD_GITIGNORE')
string (
defaultValue: "30",
description: 'When running tests, use this timeout (in minutes; be sure to leave enough for double-job of a distcheck too)',
name: 'USE_TEST_TIMEOUT')
booleanParam (
defaultValue: true,
description: 'When using temporary subdirs in build/test workspaces, wipe them after successful builds?',
name: 'DO_CLEANUP_AFTER_BUILD')
}
triggers {
pollSCM 'H/2 * * * *'
}
// Note: your Jenkins setup may benefit from similar setup on side of agents:
// PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/bin:/bin:${PATH}"
stages {
stage ('prepare') {
steps {
dir("tmp") {
sh 'if [ -s Makefile ]; then make -k distclean || true ; fi'
sh 'chmod -R u+w .'
deleteDir()
}
sh './autogen.sh'
stash (name: 'prepped', includes: '**/*', excludes: '**/cppcheck.xml')
}
}
stage ('compile') {
parallel {
stage ('build with DRAFT') {
when { expression { return ( params.DO_BUILD_WITH_DRAFT_API ) } }
steps {
dir("tmp/build-withDRAFT") {
deleteDir()
unstash 'prepped'
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; ./configure --enable-drafts=yes --with-docs=no'
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make -k -j4 || make'
sh 'echo "Are GitIgnores good after make with drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
stash (name: 'built-draft', includes: '**/*', excludes: '**/cppcheck.xml')
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('build without DRAFT') {
when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API ) } }
steps {
dir("tmp/build-withoutDRAFT") {
deleteDir()
unstash 'prepped'
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; ./configure --enable-drafts=no --with-docs=no'
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make -k -j4 || make'
sh 'echo "Are GitIgnores good after make without drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
stash (name: 'built-nondraft', includes: '**/*', excludes: '**/cppcheck.xml')
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('build with DOCS') {
when { expression { return ( params.DO_BUILD_DOCS || params.DO_DIST_DOCS ) } }
steps {
dir("tmp/build-DOCS") {
deleteDir()
unstash 'prepped'
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; ./configure --enable-drafts=yes --with-docs=yes'
script {
if ( params.DO_DIST_DOCS ) {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make dist-gzip || exit ; DISTFILE="`ls -1tc *.tar.gz | head -1`" && [ -n "$DISTFILE" ] && [ -s "$DISTFILE" ] || exit ; mv -f "$DISTFILE" __dist.tar.gz'
archiveArtifacts artifacts: '__dist.tar.gz'
sh "rm -f __dist.tar.gz"
}
}
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make -k -j4 || make'
sh 'echo "Are GitIgnores good after make with docs? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
stash (name: 'built-docs', includes: '**/*', excludes: '**/cppcheck.xml')
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
}
}
stage ('check') {
parallel {
stage ('cppcheck') {
when { expression { return ( params.DO_CPPCHECK ) } }
steps {
dir("tmp/test-cppcheck") {
deleteDir()
unstash 'prepped'
sh 'cppcheck --std=c++11 --enable=all --inconclusive --xml --xml-version=2 . 2>cppcheck.xml'
archiveArtifacts artifacts: '**/cppcheck.xml'
sh 'rm -f cppcheck.xml'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('check with DRAFT') {
when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_CHECK ) } }
steps {
dir("tmp/test-check-withDRAFT") {
deleteDir()
unstash 'built-draft'
script {
def RETRY_NUMBER = 0
retry(3) {
RETRY_NUMBER++
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
try {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="$LD_LIBRARY_PATH" check'
}
catch (Exception e) {
currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve"
sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`"""
archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmpty: true
throw e
}
}
}
}
sh 'echo "Are GitIgnores good after make check with drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('check without DRAFT') {
when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_CHECK ) } }
steps {
dir("tmp/test-check-withoutDRAFT") {
deleteDir()
unstash 'built-nondraft'
script {
def RETRY_NUMBER = 0
retry(3) {
RETRY_NUMBER++
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
try {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="$LD_LIBRARY_PATH" check'
}
catch (Exception e) {
currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve"
sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`"""
archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmpty: true
throw e
}
}
}
}
sh 'echo "Are GitIgnores good after make check without drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('memcheck with DRAFT') {
when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_MEMCHECK ) } }
steps {
dir("tmp/test-memcheck-withDRAFT") {
deleteDir()
unstash 'built-draft'
script {
def RETRY_NUMBER = 0
retry(3) {
RETRY_NUMBER++
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
try {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="$LD_LIBRARY_PATH" memcheck && exit 0 ; echo "Re-running failed ($?) memcheck with greater verbosity" >&2 ; make LD_LIBRARY_PATH="$LD_LIBRARY_PATH" VERBOSE=1 memcheck-verbose'
}
catch (Exception e) {
currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve"
sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`"""
archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmpty: true
throw e
}
}
}
}
sh 'echo "Are GitIgnores good after make memcheck with drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('memcheck without DRAFT') {
when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_MEMCHECK ) } }
steps {
dir("tmp/test-memcheck-withoutDRAFT") {
deleteDir()
unstash 'built-nondraft'
script {
def RETRY_NUMBER = 0
retry(3) {
RETRY_NUMBER++
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
try {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="$LD_LIBRARY_PATH" memcheck && exit 0 ; echo "Re-running failed ($?) memcheck with greater verbosity" >&2 ; make LD_LIBRARY_PATH="$LD_LIBRARY_PATH" VERBOSE=1 memcheck-verbose'
}
catch (Exception e) {
currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve"
sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`"""
archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmpty: true
throw e
}
}
}
}
sh 'echo "Are GitIgnores good after make memcheck without drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('distcheck with DRAFT') {
when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_DISTCHECK ) } }
steps {
dir("tmp/test-distcheck-withDRAFT") {
deleteDir()
unstash 'built-draft'
script {
def RETRY_NUMBER = 0
retry(3) {
RETRY_NUMBER++
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
try {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; DISTCHECK_CONFIGURE_FLAGS="--enable-drafts=yes --with-docs=no" ; export DISTCHECK_CONFIGURE_FLAGS; make DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" distcheck'
}
catch (Exception e) {
currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve"
sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`"""
archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmpty: true
throw e
}
}
}
}
sh 'echo "Are GitIgnores good after make distcheck with drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('distcheck without DRAFT') {
when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_DISTCHECK ) } }
steps {
dir("tmp/test-distcheck-withoutDRAFT") {
deleteDir()
unstash 'built-nondraft'
script {
def RETRY_NUMBER = 0
retry(3) {
RETRY_NUMBER++
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
try {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; DISTCHECK_CONFIGURE_FLAGS="--enable-drafts=no --with-docs=no" ; export DISTCHECK_CONFIGURE_FLAGS; make DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" distcheck'
}
catch (Exception e) {
currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve"
sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`"""
archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmpty: true
throw e
}
}
}
}
sh 'echo "Are GitIgnores good after make distcheck without drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('install with DRAFT') {
when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_INSTALL ) } }
steps {
dir("tmp/test-install-withDRAFT") {
deleteDir()
unstash 'built-draft'
retry(3) {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:\${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}" DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}/withDRAFT" install"""
}
}
sh """cd "${params.USE_TEST_INSTALL_DESTDIR}/withDRAFT" && find . -ls"""
sh 'echo "Are GitIgnores good after make install with drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('install without DRAFT') {
when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_INSTALL ) } }
steps {
dir("tmp/test-install-withoutDRAFT") {
deleteDir()
unstash 'built-nondraft'
retry(3) {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:\${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}" DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}/withoutDRAFT" install"""
}
}
sh """cd "${params.USE_TEST_INSTALL_DESTDIR}/withoutDRAFT" && find . -ls"""
sh 'echo "Are GitIgnores good after make install without drafts? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
stage ('install with DOCS') {
when { expression { return ( params.DO_BUILD_DOCS && params.DO_TEST_INSTALL ) } }
steps {
dir("tmp/test-install-withDOCS") {
deleteDir()
unstash 'built-docs'
retry(3) {
timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') {
sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; LD_LIBRARY_PATH="`pwd`/src/.libs:\${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}" DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}/withDOCS" install"""
}
}
sh """cd "${params.USE_TEST_INSTALL_DESTDIR}/withDOCS" && find . -ls"""
sh 'echo "Are GitIgnores good after make install with Docs? (should have no output below)"; git status -s || if [ "${params.REQUIRE_GOOD_GITIGNORE}" = false ]; then echo "WARNING GitIgnore tests found newly changed or untracked files" >&2 ; exit 0 ; else echo "FAILED GitIgnore tests" >&2 ; exit 1; fi'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
deleteDir()
}
}
}
}
}
}
}
stage ('deploy if appropriate') {
steps {
script {
def myDEPLOY_JOB_NAME = sh(returnStdout: true, script: """echo "${params["DEPLOY_JOB_NAME"]}" """).trim();
def myDEPLOY_BRANCH_PATTERN = sh(returnStdout: true, script: """echo "${params["DEPLOY_BRANCH_PATTERN"]}" """).trim();
def myDEPLOY_REPORT_RESULT = sh(returnStdout: true, script: """echo "${params["DEPLOY_REPORT_RESULT"]}" """).trim().toBoolean();
echo "Original: DEPLOY_JOB_NAME : ${params["DEPLOY_JOB_NAME"]} DEPLOY_BRANCH_PATTERN : ${params["DEPLOY_BRANCH_PATTERN"]} DEPLOY_REPORT_RESULT : ${params["DEPLOY_REPORT_RESULT"]}"
echo "Used: myDEPLOY_JOB_NAME:${myDEPLOY_JOB_NAME} myDEPLOY_BRANCH_PATTERN:${myDEPLOY_BRANCH_PATTERN} myDEPLOY_REPORT_RESULT:${myDEPLOY_REPORT_RESULT}"
if ( (myDEPLOY_JOB_NAME != "") && (myDEPLOY_BRANCH_PATTERN != "") ) {
if ( env.BRANCH_NAME =~ myDEPLOY_BRANCH_PATTERN ) {
def GIT_URL = sh(returnStdout: true, script: """git remote -v | egrep '^origin' | awk '{print \$2}' | head -1""").trim()
def GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse --verify HEAD').trim()
def DIST_ARCHIVE = ""
if ( params.DO_DIST_DOCS ) { DIST_ARCHIVE = env.BUILD_URL + "artifact/__dist.tar.gz" }
build job: "${myDEPLOY_JOB_NAME}", parameters: [
string(name: 'DEPLOY_GIT_URL', value: "${GIT_URL}"),
string(name: 'DEPLOY_GIT_BRANCH', value: env.BRANCH_NAME),
string(name: 'DEPLOY_GIT_COMMIT', value: "${GIT_COMMIT}"),
string(name: 'DEPLOY_DIST_ARCHIVE', value: "${DIST_ARCHIVE}")
], quietPeriod: 0, wait: myDEPLOY_REPORT_RESULT, propagate: myDEPLOY_REPORT_RESULT
} else {
echo "Not deploying because branch '${env.BRANCH_NAME}' did not match filter '${myDEPLOY_BRANCH_PATTERN}'"
}
} else {
echo "Not deploying because deploy-job parameters are not set"
}
}
}
}
}
post {
success {
script {
if (currentBuild.getPreviousBuild()?.result != 'SUCCESS') {
// Uncomment desired notification
//slackSend (color: "#008800", message: "Build ${env.JOB_NAME} is back to normal.")
//emailext (to: "qa@example.com", subject: "Build ${env.JOB_NAME} is back to normal.", body: "Build ${env.JOB_NAME} is back to normal.")
}
}
}
failure {
// Uncomment desired notification
// Section must not be empty, you can delete the sleep once you set notification
sleep 1
//slackSend (color: "#AA0000", message: "Build ${env.BUILD_NUMBER} of ${env.JOB_NAME} ${currentBuild.result} (<${env.BUILD_URL}|Open>)")
//emailext (to: "qa@example.com", subject: "Build ${env.JOB_NAME} failed!", body: "Build ${env.BUILD_NUMBER} of ${env.JOB_NAME} ${currentBuild.result}\nSee ${env.BUILD_URL}")
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
libzmq-cygwin
=============
Definitive build fixes for cygwin (See https://github.com/zeromq/pyzmq/issues/113 for partial solution)
What's changed:
./Makefile.am Add cygwin-specific target mostly the same as mingw
./configure.ac Add cygwin-specific target mostly the same as mingw
./tests/testutil.hpp Lengthen socket timeout to 121 seconds
What's new:
./README.cygwin.md This file
./builds/cygwin Folder for cygwin-specific build files
./builds/cygwin/Makefile.cygwin Makefile for cygwin targets

View File

@@ -1,48 +0,0 @@
## Overview
The ZeroMQ lightweight messaging kernel is a library which extends the
standard socket interfaces with features traditionally provided by
specialised messaging middleware products. ZeroMQ sockets provide an
abstraction of asynchronous message queues, multiple messaging patterns,
message filtering (subscriptions), seamless access to multiple transport
protocols and more.
This documentation describes the internal software that makes up the
ZeroMQ C++ core engine, and not how to use its API, however it may help
you understand certain aspects better, such as the callgraph of an API method.
There are no instructions on using ZeroMQ within this documentation, only
the API internals that make up the software.
**Note:** this documentation is generated directly from the source code with
Doxygen. Since this project is constantly under active development, what you
are about to read may be out of date! If you notice any errors in the
documentation, or the code comments, then please send a pull request.
Please refer to the README file for anything else.
## Resources
Extensive documentation is provided with the distribution. Refer to
doc/zmq.html, or "man zmq" after you have installed libzmq on your system.
* Website: http://www.zeromq.org/
* Official API documentation: http://api.zeromq.org/
Development mailing list: zeromq-dev@lists.zeromq.org
Announcements mailing list: zeromq-announce@lists.zeromq.org
Git repository: http://github.com/zeromq/libzmq
ZeroMQ developers can also be found on the IRC channel \#zeromq, on the
Freenode network (irc.freenode.net).
## Copyright
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file.
The project license is specified in COPYING and COPYING.LESSER.
The names "ØMQ", "ZeroMQ", "0MQ", and the ØMQ logo are registered trademarks
of iMatix Corporation ("iMatix") and refers to either (a) the original libzmq
C++ library, or (b) the community of projects hosted in the
https://github.com/zeromq organization.
This Doxygen configuration is adapted by Hiten Pandya, for the ZeroMQ project.

View File

@@ -1,218 +0,0 @@
# ZeroMQ
[![Build Status](https://github.com/zeromq/libzmq/actions/workflows/CI.yaml/badge.svg)](https://github.com/zeromq/libzmq/actions/workflows/CI.yaml)
[![Build status](https://ci.appveyor.com/api/projects/status/e2ks424yrs1un3wt?svg=true)](https://ci.appveyor.com/project/zeromq/libzmq)
[![Coverage Status](https://coveralls.io/repos/github/zeromq/libzmq/badge.svg?branch=master)](https://coveralls.io/github/zeromq/libzmq?branch=master)
## Welcome
The ZeroMQ lightweight messaging kernel is a library which extends the
standard socket interfaces with features traditionally provided by
specialised messaging middleware products. ZeroMQ sockets provide an
abstraction of asynchronous message queues, multiple messaging patterns,
message filtering (subscriptions), seamless access to multiple transport
protocols and more.
## Supported platforms <a name="#platforms"/>
Libzmq is mainly written in C++98 with some optional C++11-fragments. For
configuration either autotools or CMake is employed. See below for some lists
of platforms, where libzmq has been successfully compiled on.
### Supported platforms with primary CI
| OS and version | Architecture | Compiler and version | Build system | Remarks |
|----------------------------------------|-------------------------|-------------------------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------|
| Android NDK r24 | arm, arm64, x86, x86_64 | llvm (see NDK) | autotools | DRAFT |
| Ubuntu 14.04.5 LTS (trusty) | amd64 | clang 5.0.0 | autotools | STABLE, extras: GSSAPI, PGM, NORM, C++98 mode only |
| Ubuntu 14.04.5 LTS (trusty) | amd64 | gcc 4.8.4 | autotools | STABLE, DRAFT, extras: GSSAPI, PGM, NORM, TIPC, IPV6, also POLLER=poll, POLLER=select, also valgrind and address sanitizer executions |
| Ubuntu 14.04.5 LTS (trusty) | amd64 | gcc 4.8.4 | CMake 3.12.2 | STABLE |
| Windows Server 2012 R2 | x86 | Visual Studio 2008 | CMake 3.12.2 | DRAFT |
| Windows Server 2012 R2 | x86 | Visual Studio 2010 SP1 | CMake 3.12.2 | DRAFT |
| Windows Server 2012 R2 | x86 | Visual Studio 2012 Update 5 | CMake 3.12.2 | DRAFT |
| Windows Server 2012 R2 | x86, amd64 | Visual Studio 2013 Update 5 | CMake 3.12.2 | DRAFT, STABLE (x86 Release only), also POLLER=epoll |
| Windows Server 2012 R2 | x86 | Visual Studio 2015 Update 3 | CMake 3.12.2 | DRAFT |
| Windows Server 2016 | x86 | Visual Studio 2017 15.9.6 | CMake 3.13.3 | DRAFT |
| cygwin 3.0.0 on Windows Server 2012 R2 | amd64 | gcc 7.4.0 | CMake 3.6.2 | DRAFT |
| MSYS2 ? on Windows Server 2012 R2 | amd64 | gcc 6.4.0 | CMake ? | DRAFT |
| Mac OS X 10.13 | amd64 | Xcode 9.4.1, Apple LLVM 9.1.0 | autotools | STABLE, DRAFT |
| Mac OS X 10.13 | amd64 | Xcode 9.4.1, Apple LLVM 9.1.0 | CMake 3.11.4 | DRAFT |
Note: the platforms are regularly updated by the service providers, so this information might get out of date
without any changes on the side of libzmq. For Appveyor, refer to https://www.appveyor.com/updates/ regarding
platform updates. For travis-ci, refer to https://changelog.travis-ci.com/ regarding platform updates.
### Supported platforms with secondary CI
| OS and version | Architecture | Compiler and version | Build system | Remarks |
|------------------------------|----------------------------|----------------------|--------------|---------|
| CentOS 6 | x86, amd64 | ? | autotools | |
| CentOS 7 | amd64 | ? | autotools | |
| Debian 8.0 | x86, amd64 | ? | autotools | |
| Debian 9.0 | ARM64, x86, amd64 | ? | autotools | |
| Fedora 28 | ARM64, ARM32, amd64 | ? | autotools | |
| Fedora 29 | ARM64, ARM32, amd64 | ? | autotools | |
| Fedora Rawhide | ARM64, ARM32, amd64 | ? | autotools | |
| RedHat Enterprise Linux 7 | amd64, ppc64 | ? | autotools | |
| SuSE Linux Enterprise 12 SP4 | ARM64, amd64, ppc64, s390x | ? | autotools | |
| SuSE Linux Enterprise 15 | amd64 | ? | autotools | |
| xUbuntu 12.04 | x86, amd64 | ? | autotools | |
| xUbuntu 14.04 | x86, amd64 | ? | autotools | |
| xUbuntu 16.04 | x86, amd64 | ? | autotools | |
| xUbuntu 18.04 | x86, amd64 | ? | autotools | |
| xUbuntu 18.10 | x86, amd64 | ? | autotools | |
### Supported platforms with known active users
At the time of writing, no explicit reports have been available. Please report your experiences by opening a PR
adding an entry or moving an entry from the section below.
Under "last report", please name either the SHA1 in case of an unreleased version, or the version number in
case of a released version.
| OS and version | Architecture | Compiler and version | Build system | Last report | Remarks |
|----------------|-------------------|----------------------|--------------|-------------------------|---------|
| Solaris 10 | x86, amd64, sparc | GCC 8.1.0 | CMake | 2019/03/18 | |
| DragonFly BSD | amd64 | gcc 8.3 | autotools | 2018/08/07 git-72854e63 | |
| IBM i | ppc64 | gcc 6.3 | autotools | 2019/10/02 git-25320a3 | |
| QNX 7.0 | x86_64 | gcc 5.4.0 | CMake | 4.3.2 | |
| Windows 10 | ARM64 | Visual Studio 2019 | CMake | 2021/11/15 git-2375ca8b | |
| Windows 10 | ARM64 | clang | CMake | 2021/11/15 git-2375ca8b | |
### Supported platforms without known active users
Note: this list is incomplete and inaccurate and still needs some work.
| OS and version | Architecture | Compiler and version | Build system | Remarks |
|------------------------|--------------|--------------------------|------------------|---------|
| Any Linux distribution | x86, amd64 | gcc ?+, clang ?+, icc ?+ | autotools, CMake | |
| SunOS, Solaris | x86, amd64 | SunPro | autotools, CMake | |
| GNU/kFreeBSD | ? | ? | autotools, CMake | |
| FreeBSD | ? | ? | autotools, CMake | |
| NetBSD | ? | ? | autotools, CMake | |
| OpenBSD | ? | ? | autotools, CMake | |
| DragonFly BSD | amd64 | gcc 8.3 | autotools, CMake | |
| HP-UX | ? | ? | autotools, CMake | |
| GNU/Hurd | ? | ? | autotools | |
| VxWorks 6.8 | ? | ? | ? | |
| Windows CE | ? | ? | ? | |
| Windows UWP | ? | ? | ? | |
| OpenVMS | ? | ? | ? | |
### Unsupported platforms
| OS and version | Architecture | Compiler and version | Remarks |
|----------------|--------------|----------------------|-------------------------------------------------------------------------|
| QNX 6.3 | ? | gcc 3.3.5 | see #3371, support was added by a user, but not contributed to upstream |
For more details, see [here](SupportedPlatforms.md).
For some platforms (Linux, Mac OS X), [prebuilt binary packages are supplied by the ZeroMQ organization](#installation).
For other platforms, you need to [build your own binaries](#build).
## Installation of binary packages <a name="installation"/>
### Linux
For Linux users, pre-built binary packages are available for most distributions.
Note that DRAFT APIs can change at any time without warning, pick a STABLE build to
avoid having them enabled.
#### Latest releases
##### DEB
[![OBS release stable](https://img.shields.io/badge/OBS%20master-stable-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-stable&package=libzmq3-dev)
[![OBS release draft](https://img.shields.io/badge/OBS%20master-draft-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-draft&package=libzmq3-dev)
##### RPM
[![OBS release stable](https://img.shields.io/badge/OBS%20master-stable-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-stable&package=zeromq-devel)
[![OBS release draft](https://img.shields.io/badge/OBS%20master-draft-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Arelease-draft&package=zeromq-devel)
#### Bleeding edge packages
##### DEB
[![OBS release stable](https://img.shields.io/badge/OBS%20master-stable-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=libzmq3-dev)
[![OBS release draft](https://img.shields.io/badge/OBS%20master-draft-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-draft&package=libzmq3-dev)
##### RPM
[![OBS release stable](https://img.shields.io/badge/OBS%20master-stable-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-stable&package=zeromq-devel)
[![OBS release draft](https://img.shields.io/badge/OBS%20master-draft-yellow.svg)](http://software.opensuse.org/download.html?project=network%3Amessaging%3Azeromq%3Agit-draft&package=zeromq-devel)
#### Example: Debian 9 latest release, no DRAFT apis
echo "deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/ ./" >> /etc/apt/sources.list
wget https://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_9.0/Release.key -O- | sudo apt-key add
apt-get install libzmq3-dev
### OSX
For OSX users, packages are available via brew.
brew install zeromq
## Installation of package manager <a name="package manager"/>
### vcpkg
vcpkg is a full platform package manager, you can easily install libzmq via vcpkg.
git clone https://github.com/microsoft/vcpkg.git
./bootstrap-vcpkg.bat # For powershell
./bootstrap-vcpkg.sh # For bash
./vcpkg install zeromq
## Build from sources <a name="build"/>
To build from sources, see the INSTALL file included with the distribution.
### Android
To build from source, see [README](./builds/android/README.md) file in the
android build directory.
## Resources
Extensive documentation is provided with the distribution. Refer to
doc/zmq.html, or "man zmq" after you have installed libzmq on your system.
Website: http://www.zeromq.org/
Development mailing list: zeromq-dev@lists.zeromq.org
Announcements mailing list: zeromq-announce@lists.zeromq.org
Git repository: http://github.com/zeromq/libzmq
ZeroMQ developers can also be found on the IRC channel #zeromq, on the
Libera Chat network (irc.libera.chat).
## License
The project license is specified in COPYING and COPYING.LESSER.
libzmq is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
As a special exception, the Contributors give you permission to link
this library with independent modules to produce an executable,
regardless of the license terms of these independent modules, and to
copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the
terms and conditions of the license of that module. An independent
module is a module which is not derived from or based on this library.
If you modify this library, you must extend this exception to your
version of the library.
libzmq is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
## Contributing
This project uses [C4(Collective Code Construction Contract)](https://rfc.zeromq.org/spec:42/C4/) process for contributions.

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Leonardo J. Consoni
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "AnCaPepe", with
commit author "Leonardo José Consoni <consoni_2519@hotmail.com>", are copyright of Leonardo J. Consoni.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Leonardo José Consoni
2017/03/19

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Andre Caron
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "AndreLouisCaron", with
commit author "Andre Caron <andre.l.caron@gmail.com>", are copyright of Andre Caron.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Andre Caron
2017/03/19

View File

@@ -1,13 +0,0 @@
# Permission to Relicense under MPLv2
This is a statement by Hendrik Beskow
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "Asmod4n", with
commit author "Asmod4n Asmod4n@users.noreply.github.com", are copyright of Hendrik Beskow.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Hendrik Beskow
2017/04/21

View File

@@ -1,16 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Axel Nennker that grants permission to
relicense its copyrights in the libzmq C++ library (ZeroMQ) under the
Mozilla Public License v2 (MPLv2) or any other Open Source Initiative
approved license chosen by the current ZeroMQ BDFL (Benevolent
Dictator for Life).
A portion of the commits made by the Github handle "AxelNennker", with
commit author "Axel Nennker <axel@nennker.de>", are
copyright of Axel Nennker. This document hereby grants the libzmq
project team to relicense libzmq, including all past, present and
future contributions of the author listed above.
Axel Nennker
2019/08/11

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Caleb Epstein
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "Bklyn", with
commit author "Caleb Epstein <cae@bklyn.org>", are copyright of Caleb Epstein.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Caleb Epstein
2017/03/21

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Dries Harnie
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "Botje", with
commit author "Dries Harnie <dries@harnie.be>", are copyright of Dries Harnie.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Dries Harnie
2019/10/31

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by C-Sir
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "C-Sir", with
commit author "C-Sir <942510829@qq.com>", are copyright of C-Sir.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
C-Sir
2020/09/28

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Michael Lloyd
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "CommanderBubble", with
commit author "Michael Lloyd <commander.bubble@gmail.com>", are copyright of Michael Lloyd.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Michael Lloyd
2019/02/23

View File

@@ -1,7 +0,0 @@
Permission to Relicense under MPLv2
This is a statement by Wojciech Kula that grants permission to relicense its copyrights in the libzmq C++ library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "Cziken", with commit author "Cziken wojciech_kula@o2.pl", are copyright of Wojciech Kula. This document hereby grants the libzmq project team to relicense libzmq, including all past, present and future contributions of the author listed above.
Wojciech Kula 2021/01/13

View File

@@ -1,16 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Daiyu Hurst that grants permission to
relicense its copyrights in the libzmq C++ library (ZeroMQ) under the
Mozilla Public License v2 (MPLv2) or any other Open Source Initiative
approved license chosen by the current ZeroMQ BDFL (Benevolent
Dictator for Life).
A portion of the commits made by the Github handle "daiyuhurst", with
commit author "Daiyu Hurst <daiyu.hurst@gmail.com>", are
copyright of Daiyu Hurst. This document hereby grants the libzmq
project team to relicense libzmq, including all past, present and
future contributions of the author listed above.
Daiyu Hurst
2019/08/31

View File

@@ -1,16 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Eelis van der Weegen that grants permission to
relicense its copyrights in the libzmq C++ library (ZeroMQ) under the
Mozilla Public License v2 (MPLv2) or any other Open Source Initiative
approved license chosen by the current ZeroMQ BDFL (Benevolent
Dictator for Life).
A portion of the commits made by the Github handle "Eelis", with
commit author "Eelis van der Weegen <eelis@eelis.net>", are
copyright of Eelis van der Weegen. This document hereby grants the libzmq
project team to relicense libzmq, including all past, present and
future contributions of the author listed above.
Eelis van der Weegen
2019/02/22

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Franco Fichtner that grants permission to relicense
its copyrights in the libzmq C++ library (ZeroMQ) under the Mozilla Public
License v2 (MPLv2) or any other Open Source Initiative approved license
chosen by the current ZeroMQ BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "fichtner", with
commit author "Franco Fichtner <franco@lastsummer.de>", are copyright
of Franco Fichtner. This document hereby grants the libzmq project
team to relicense libzmq, including all past, present and future
contributions of the author listed above.
Franco Fichtner
2017/03/21

View File

@@ -1,13 +0,0 @@
# Permission to Relicense under MPLv2
This is a statement by Frédéric Trégon
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "FredTreg", with
commit author "Frederic Tregon <frederic.tregon@gmail.com>", are copyright of Frédéric Trégon.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Frédéric Trégon
2020/02/03

View File

@@ -1,17 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Erik Hugne
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "Hugne", with
commit author "erik.hugne@gmail.com", are copyright of Erik Hugne.
Commits made by author "erik.hugne@ericsson.com" are NOT covered by this
statement.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Erik Hugne
2017/03/22

View File

@@ -1,13 +0,0 @@
# Permission to Relicense under MPLv2
This is a statement by the Netherlands eScience Center
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "Jasper-Bekkers", with
commit author "Jasper Bekkers bekkers@gmail.com", are copyright of Traverse Research BV.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Jasper Bekkers <bekkers@gmail.com
2022/02/08

View File

@@ -1,16 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Johan Mabille
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "JohanMabille", with
commit author "Johan Mabille johan.mabille@gmail.com", are copyright of Johan Mabille.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Johan Mabille
2017/03/20

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Jon Dyte
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "JonDyte", with
commit author "Jon Dyte <jon@totient.co.uk>", are copyright of Jon Dyte.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Jon Dyte
2019/10/03

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2
This is a statement by Nikita Kozlov
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "KLNikita", with
commit author "nikita kozlov <nikita@elyzion.net>", are copyright of Nikita Kozlov .
This document hereby grants the libzmq project team to relicense
libzmq,
including all past, present and future contributions of the author
listed above.
Nikita Kozlov
6 February 2020

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Martin Grigorov
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "martin-g", with
commit author "Martin Grigorov", are copyright of Martin Grigorov.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Martin Grigorov
2021/01/11

View File

@@ -1,13 +0,0 @@
# Permission to Relicense under MPLv2
This is a statement by the Netherlands eScience Center
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "egpbos", with
commit author "E. G. Patrick Bos p.bos@esciencecenter.nl", are copyright of the Netherlands eScience Center.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Rob van Nieuwpoort <R.vanNieuwpoort@esciencecenter.nl>
2021/06/15

View File

@@ -1,13 +0,0 @@
# Permission to Relicense under MPLv2
This is a statement by Robert G. Jakabosky
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the Github handle "Neopallium", with
commit author "Robert G. Jakabosky <bobby@sharedrealm.com>", are copyright of Robert G. Jakabosky.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Robert Gabriel Jakabosky
2019/08/17

View File

@@ -1,16 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Paul Thiele that grants permission to
relicense its copyrights in the libzmq C++ library (ZeroMQ) under the
Mozilla Public License v2 (MPLv2) or any other Open Source Initiative
approved license chosen by the current ZeroMQ BDFL (Benevolent
Dictator for Life).
A portion of the commits made by the Github handle "thielepaul", with
commit author "Paul Thiele <thielepaul@gmail.com>", are
copyright of Paul Thiele. This document hereby grants the libzmq
project team to relicense libzmq, including all past, present and
future contributions of the author listed above.
Paul Thiele
2021/11/04

View File

@@ -1,15 +0,0 @@
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL
This is a statement by Arthur O'Dwyer
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current ZeroMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the Github handle "Quuxplusone", with
commit author "Arthur O'Dwyer <arthur@push.am>", are copyright of Arthur O'Dwyer.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Arthur O'Dwyer
2019/02/17

View File

@@ -1,23 +0,0 @@
# Permission to Relicense under MPLV2
This directory collects grants from individuals and firms that hold
copyrights in ZeroMQ to permit licensing the ZeroMQ code under
the [Mozilla Public License, version
2](https://www.mozilla.org/en-US/MPL/2.0/). See [GitHub Pull
Request #1917](https://github.com/zeromq/libzmq/pull/1917),
the [0MQ Licensing Page](http://zeromq.org/area:licensing) and
[original iMatix zeromq-dev license
grant](http://lists.zeromq.org/pipermail/zeromq-dev/2016-April/030288.html)
for some background information.
Please create a separate file in this directory for each individual
or firm holding copyright in ZeroMQ, named after the individual or
firm holding the copyright.
Each patch must be made with a GitHub handle that is clearly
associated with the copyright owner, to guarantee the identity of
the signatory. Please avoid changing the files created by other
individuals or firms granting a copyright license over their
copyrights (if rewording is required contact them and ask them to
submit an updated version). This makes it easier to verify that
the license grant was made by an authorized GitHub account.

Some files were not shown because too many files have changed in this diff Show More