Files
libsession-util/proto/WebSocketResources.pb.h
dr7anaandJason Rhinelander 43384d7f92 Protobuf integration & config wrapping/unwrapping
This adds support for automatic wrapping and unwrapping of config
messages that may be wrapped in protobuf; this was unintentional, but is
out in the wild in current Session releases.  The long-term plan is to
stop doing this eventually, but supporting it here allows us to change
from the current mode (always wrap/unwrap affected message types) to
a mode where we only unwrap, and then finally we can drop unwrapping as
well.

For now: we wrap/unwrap the existing released message types (user
profile, conversation info, and so on) but not the new groups configs
(which should always be un-wrapped).

Various notes:

- protobuf added as external dependency.

- protobuf 21.12 is used, which is an older release, but is what is
  still being used by lots of projects and Linux distributions because
  Google applied huge amounts of extra bloat in v22 (including pulling a
  massive pile of crap in abseil), broke the build system in various
  ways, and made everything suck to the point that many Linux
  distributions have just stuck with the latest 21.12 because of all the
  broken crap Google imposed on everyone in v22 and newer.

- SessionProtos.pro and WebSocketResources.proto looped in from
  session-ios codebase, with one minor change to let us use it in "lite"
  mode (which is still very bloated, but nothing like non-lite mode).

- Added pregenerated header/cpp files; we experimented with building
  them as part of the build, but that ended up neigh impossible for our
  various cross-compiled builds.  (These also get excluded from
  format.sh because they break if formatted.  Hurray.)

- Add protobuf::libprotobuf-lite to the static build list.

- Adds a dummy test script that does nothing, but tests that we can
  probably link against the combined archive (when building with
  `-DSTATIC_BUILD=ON`).
2023-10-04 11:06:33 -03:00

1568 lines
60 KiB
C++

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: WebSocketResources.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_WebSocketResources_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_WebSocketResources_2eproto
#include <limits>
#include <string>
#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_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/message_lite.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_util.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_WebSocketResources_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_WebSocketResources_2eproto {
static const uint32_t offsets[];
};
namespace WebSocketProtos {
class WebSocketMessage;
struct WebSocketMessageDefaultTypeInternal;
extern WebSocketMessageDefaultTypeInternal _WebSocketMessage_default_instance_;
class WebSocketRequestMessage;
struct WebSocketRequestMessageDefaultTypeInternal;
extern WebSocketRequestMessageDefaultTypeInternal _WebSocketRequestMessage_default_instance_;
class WebSocketResponseMessage;
struct WebSocketResponseMessageDefaultTypeInternal;
extern WebSocketResponseMessageDefaultTypeInternal _WebSocketResponseMessage_default_instance_;
} // namespace WebSocketProtos
PROTOBUF_NAMESPACE_OPEN
template<> ::WebSocketProtos::WebSocketMessage* Arena::CreateMaybeMessage<::WebSocketProtos::WebSocketMessage>(Arena*);
template<> ::WebSocketProtos::WebSocketRequestMessage* Arena::CreateMaybeMessage<::WebSocketProtos::WebSocketRequestMessage>(Arena*);
template<> ::WebSocketProtos::WebSocketResponseMessage* Arena::CreateMaybeMessage<::WebSocketProtos::WebSocketResponseMessage>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace WebSocketProtos {
enum WebSocketMessage_Type : int {
WebSocketMessage_Type_UNKNOWN = 0,
WebSocketMessage_Type_REQUEST = 1,
WebSocketMessage_Type_RESPONSE = 2
};
bool WebSocketMessage_Type_IsValid(int value);
constexpr WebSocketMessage_Type WebSocketMessage_Type_Type_MIN = WebSocketMessage_Type_UNKNOWN;
constexpr WebSocketMessage_Type WebSocketMessage_Type_Type_MAX = WebSocketMessage_Type_RESPONSE;
constexpr int WebSocketMessage_Type_Type_ARRAYSIZE = WebSocketMessage_Type_Type_MAX + 1;
const std::string& WebSocketMessage_Type_Name(WebSocketMessage_Type value);
template<typename T>
inline const std::string& WebSocketMessage_Type_Name(T enum_t_value) {
static_assert(::std::is_same<T, WebSocketMessage_Type>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function WebSocketMessage_Type_Name.");
return WebSocketMessage_Type_Name(static_cast<WebSocketMessage_Type>(enum_t_value));
}
bool WebSocketMessage_Type_Parse(
::PROTOBUF_NAMESPACE_ID::ConstStringParam name, WebSocketMessage_Type* value);
// ===================================================================
class WebSocketRequestMessage final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:WebSocketProtos.WebSocketRequestMessage) */ {
public:
inline WebSocketRequestMessage() : WebSocketRequestMessage(nullptr) {}
~WebSocketRequestMessage() override;
explicit PROTOBUF_CONSTEXPR WebSocketRequestMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
WebSocketRequestMessage(const WebSocketRequestMessage& from);
WebSocketRequestMessage(WebSocketRequestMessage&& from) noexcept
: WebSocketRequestMessage() {
*this = ::std::move(from);
}
inline WebSocketRequestMessage& operator=(const WebSocketRequestMessage& from) {
CopyFrom(from);
return *this;
}
inline WebSocketRequestMessage& operator=(WebSocketRequestMessage&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const std::string& unknown_fields() const {
return _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString);
}
inline std::string* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
static const WebSocketRequestMessage& default_instance() {
return *internal_default_instance();
}
static inline const WebSocketRequestMessage* internal_default_instance() {
return reinterpret_cast<const WebSocketRequestMessage*>(
&_WebSocketRequestMessage_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(WebSocketRequestMessage& a, WebSocketRequestMessage& b) {
a.Swap(&b);
}
inline void Swap(WebSocketRequestMessage* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(WebSocketRequestMessage* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
WebSocketRequestMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<WebSocketRequestMessage>(arena);
}
void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const WebSocketRequestMessage& from);
void MergeFrom(const WebSocketRequestMessage& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(WebSocketRequestMessage* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "WebSocketProtos.WebSocketRequestMessage";
}
protected:
explicit WebSocketRequestMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
std::string GetTypeName() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kHeadersFieldNumber = 5,
kVerbFieldNumber = 1,
kPathFieldNumber = 2,
kBodyFieldNumber = 3,
kRequestIdFieldNumber = 4,
};
// repeated string headers = 5;
int headers_size() const;
private:
int _internal_headers_size() const;
public:
void clear_headers();
const std::string& headers(int index) const;
std::string* mutable_headers(int index);
void set_headers(int index, const std::string& value);
void set_headers(int index, std::string&& value);
void set_headers(int index, const char* value);
void set_headers(int index, const char* value, size_t size);
std::string* add_headers();
void add_headers(const std::string& value);
void add_headers(std::string&& value);
void add_headers(const char* value);
void add_headers(const char* value, size_t size);
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& headers() const;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_headers();
private:
const std::string& _internal_headers(int index) const;
std::string* _internal_add_headers();
public:
// optional string verb = 1;
bool has_verb() const;
private:
bool _internal_has_verb() const;
public:
void clear_verb();
const std::string& verb() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_verb(ArgT0&& arg0, ArgT... args);
std::string* mutable_verb();
PROTOBUF_NODISCARD std::string* release_verb();
void set_allocated_verb(std::string* verb);
private:
const std::string& _internal_verb() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_verb(const std::string& value);
std::string* _internal_mutable_verb();
public:
// optional string path = 2;
bool has_path() const;
private:
bool _internal_has_path() const;
public:
void clear_path();
const std::string& path() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_path(ArgT0&& arg0, ArgT... args);
std::string* mutable_path();
PROTOBUF_NODISCARD std::string* release_path();
void set_allocated_path(std::string* path);
private:
const std::string& _internal_path() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_path(const std::string& value);
std::string* _internal_mutable_path();
public:
// optional bytes body = 3;
bool has_body() const;
private:
bool _internal_has_body() const;
public:
void clear_body();
const std::string& body() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_body(ArgT0&& arg0, ArgT... args);
std::string* mutable_body();
PROTOBUF_NODISCARD std::string* release_body();
void set_allocated_body(std::string* body);
private:
const std::string& _internal_body() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value);
std::string* _internal_mutable_body();
public:
// optional uint64 requestId = 4;
bool has_requestid() const;
private:
bool _internal_has_requestid() const;
public:
void clear_requestid();
uint64_t requestid() const;
void set_requestid(uint64_t value);
private:
uint64_t _internal_requestid() const;
void _internal_set_requestid(uint64_t value);
public:
// @@protoc_insertion_point(class_scope:WebSocketProtos.WebSocketRequestMessage)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> headers_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr verb_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr path_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_;
uint64_t requestid_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_WebSocketResources_2eproto;
};
// -------------------------------------------------------------------
class WebSocketResponseMessage final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:WebSocketProtos.WebSocketResponseMessage) */ {
public:
inline WebSocketResponseMessage() : WebSocketResponseMessage(nullptr) {}
~WebSocketResponseMessage() override;
explicit PROTOBUF_CONSTEXPR WebSocketResponseMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
WebSocketResponseMessage(const WebSocketResponseMessage& from);
WebSocketResponseMessage(WebSocketResponseMessage&& from) noexcept
: WebSocketResponseMessage() {
*this = ::std::move(from);
}
inline WebSocketResponseMessage& operator=(const WebSocketResponseMessage& from) {
CopyFrom(from);
return *this;
}
inline WebSocketResponseMessage& operator=(WebSocketResponseMessage&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const std::string& unknown_fields() const {
return _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString);
}
inline std::string* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
static const WebSocketResponseMessage& default_instance() {
return *internal_default_instance();
}
static inline const WebSocketResponseMessage* internal_default_instance() {
return reinterpret_cast<const WebSocketResponseMessage*>(
&_WebSocketResponseMessage_default_instance_);
}
static constexpr int kIndexInFileMessages =
1;
friend void swap(WebSocketResponseMessage& a, WebSocketResponseMessage& b) {
a.Swap(&b);
}
inline void Swap(WebSocketResponseMessage* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(WebSocketResponseMessage* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
WebSocketResponseMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<WebSocketResponseMessage>(arena);
}
void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const WebSocketResponseMessage& from);
void MergeFrom(const WebSocketResponseMessage& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(WebSocketResponseMessage* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "WebSocketProtos.WebSocketResponseMessage";
}
protected:
explicit WebSocketResponseMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
std::string GetTypeName() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kHeadersFieldNumber = 5,
kMessageFieldNumber = 3,
kBodyFieldNumber = 4,
kRequestIdFieldNumber = 1,
kStatusFieldNumber = 2,
};
// repeated string headers = 5;
int headers_size() const;
private:
int _internal_headers_size() const;
public:
void clear_headers();
const std::string& headers(int index) const;
std::string* mutable_headers(int index);
void set_headers(int index, const std::string& value);
void set_headers(int index, std::string&& value);
void set_headers(int index, const char* value);
void set_headers(int index, const char* value, size_t size);
std::string* add_headers();
void add_headers(const std::string& value);
void add_headers(std::string&& value);
void add_headers(const char* value);
void add_headers(const char* value, size_t size);
const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& headers() const;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_headers();
private:
const std::string& _internal_headers(int index) const;
std::string* _internal_add_headers();
public:
// optional string message = 3;
bool has_message() const;
private:
bool _internal_has_message() const;
public:
void clear_message();
const std::string& message() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_message(ArgT0&& arg0, ArgT... args);
std::string* mutable_message();
PROTOBUF_NODISCARD std::string* release_message();
void set_allocated_message(std::string* message);
private:
const std::string& _internal_message() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_message(const std::string& value);
std::string* _internal_mutable_message();
public:
// optional bytes body = 4;
bool has_body() const;
private:
bool _internal_has_body() const;
public:
void clear_body();
const std::string& body() const;
template <typename ArgT0 = const std::string&, typename... ArgT>
void set_body(ArgT0&& arg0, ArgT... args);
std::string* mutable_body();
PROTOBUF_NODISCARD std::string* release_body();
void set_allocated_body(std::string* body);
private:
const std::string& _internal_body() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_body(const std::string& value);
std::string* _internal_mutable_body();
public:
// optional uint64 requestId = 1;
bool has_requestid() const;
private:
bool _internal_has_requestid() const;
public:
void clear_requestid();
uint64_t requestid() const;
void set_requestid(uint64_t value);
private:
uint64_t _internal_requestid() const;
void _internal_set_requestid(uint64_t value);
public:
// optional uint32 status = 2;
bool has_status() const;
private:
bool _internal_has_status() const;
public:
void clear_status();
uint32_t status() const;
void set_status(uint32_t value);
private:
uint32_t _internal_status() const;
void _internal_set_status(uint32_t value);
public:
// @@protoc_insertion_point(class_scope:WebSocketProtos.WebSocketResponseMessage)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> headers_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr body_;
uint64_t requestid_;
uint32_t status_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_WebSocketResources_2eproto;
};
// -------------------------------------------------------------------
class WebSocketMessage final :
public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:WebSocketProtos.WebSocketMessage) */ {
public:
inline WebSocketMessage() : WebSocketMessage(nullptr) {}
~WebSocketMessage() override;
explicit PROTOBUF_CONSTEXPR WebSocketMessage(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
WebSocketMessage(const WebSocketMessage& from);
WebSocketMessage(WebSocketMessage&& from) noexcept
: WebSocketMessage() {
*this = ::std::move(from);
}
inline WebSocketMessage& operator=(const WebSocketMessage& from) {
CopyFrom(from);
return *this;
}
inline WebSocketMessage& operator=(WebSocketMessage&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const std::string& unknown_fields() const {
return _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString);
}
inline std::string* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields<std::string>();
}
static const WebSocketMessage& default_instance() {
return *internal_default_instance();
}
static inline const WebSocketMessage* internal_default_instance() {
return reinterpret_cast<const WebSocketMessage*>(
&_WebSocketMessage_default_instance_);
}
static constexpr int kIndexInFileMessages =
2;
friend void swap(WebSocketMessage& a, WebSocketMessage& b) {
a.Swap(&b);
}
inline void Swap(WebSocketMessage* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(WebSocketMessage* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
WebSocketMessage* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<WebSocketMessage>(arena);
}
void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final;
void CopyFrom(const WebSocketMessage& from);
void MergeFrom(const WebSocketMessage& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const;
void InternalSwap(WebSocketMessage* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "WebSocketProtos.WebSocketMessage";
}
protected:
explicit WebSocketMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
std::string GetTypeName() const final;
// nested types ----------------------------------------------------
typedef WebSocketMessage_Type Type;
static constexpr Type UNKNOWN =
WebSocketMessage_Type_UNKNOWN;
static constexpr Type REQUEST =
WebSocketMessage_Type_REQUEST;
static constexpr Type RESPONSE =
WebSocketMessage_Type_RESPONSE;
static inline bool Type_IsValid(int value) {
return WebSocketMessage_Type_IsValid(value);
}
static constexpr Type Type_MIN =
WebSocketMessage_Type_Type_MIN;
static constexpr Type Type_MAX =
WebSocketMessage_Type_Type_MAX;
static constexpr int Type_ARRAYSIZE =
WebSocketMessage_Type_Type_ARRAYSIZE;
template<typename T>
static inline const std::string& Type_Name(T enum_t_value) {
static_assert(::std::is_same<T, Type>::value ||
::std::is_integral<T>::value,
"Incorrect type passed to function Type_Name.");
return WebSocketMessage_Type_Name(enum_t_value);
}
static inline bool Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,
Type* value) {
return WebSocketMessage_Type_Parse(name, value);
}
// accessors -------------------------------------------------------
enum : int {
kRequestFieldNumber = 2,
kResponseFieldNumber = 3,
kTypeFieldNumber = 1,
};
// optional .WebSocketProtos.WebSocketRequestMessage request = 2;
bool has_request() const;
private:
bool _internal_has_request() const;
public:
void clear_request();
const ::WebSocketProtos::WebSocketRequestMessage& request() const;
PROTOBUF_NODISCARD ::WebSocketProtos::WebSocketRequestMessage* release_request();
::WebSocketProtos::WebSocketRequestMessage* mutable_request();
void set_allocated_request(::WebSocketProtos::WebSocketRequestMessage* request);
private:
const ::WebSocketProtos::WebSocketRequestMessage& _internal_request() const;
::WebSocketProtos::WebSocketRequestMessage* _internal_mutable_request();
public:
void unsafe_arena_set_allocated_request(
::WebSocketProtos::WebSocketRequestMessage* request);
::WebSocketProtos::WebSocketRequestMessage* unsafe_arena_release_request();
// optional .WebSocketProtos.WebSocketResponseMessage response = 3;
bool has_response() const;
private:
bool _internal_has_response() const;
public:
void clear_response();
const ::WebSocketProtos::WebSocketResponseMessage& response() const;
PROTOBUF_NODISCARD ::WebSocketProtos::WebSocketResponseMessage* release_response();
::WebSocketProtos::WebSocketResponseMessage* mutable_response();
void set_allocated_response(::WebSocketProtos::WebSocketResponseMessage* response);
private:
const ::WebSocketProtos::WebSocketResponseMessage& _internal_response() const;
::WebSocketProtos::WebSocketResponseMessage* _internal_mutable_response();
public:
void unsafe_arena_set_allocated_response(
::WebSocketProtos::WebSocketResponseMessage* response);
::WebSocketProtos::WebSocketResponseMessage* unsafe_arena_release_response();
// optional .WebSocketProtos.WebSocketMessage.Type type = 1;
bool has_type() const;
private:
bool _internal_has_type() const;
public:
void clear_type();
::WebSocketProtos::WebSocketMessage_Type type() const;
void set_type(::WebSocketProtos::WebSocketMessage_Type value);
private:
::WebSocketProtos::WebSocketMessage_Type _internal_type() const;
void _internal_set_type(::WebSocketProtos::WebSocketMessage_Type value);
public:
// @@protoc_insertion_point(class_scope:WebSocketProtos.WebSocketMessage)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
::WebSocketProtos::WebSocketRequestMessage* request_;
::WebSocketProtos::WebSocketResponseMessage* response_;
int type_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_WebSocketResources_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// WebSocketRequestMessage
// optional string verb = 1;
inline bool WebSocketRequestMessage::_internal_has_verb() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool WebSocketRequestMessage::has_verb() const {
return _internal_has_verb();
}
inline void WebSocketRequestMessage::clear_verb() {
_impl_.verb_.ClearToEmpty();
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& WebSocketRequestMessage::verb() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketRequestMessage.verb)
return _internal_verb();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void WebSocketRequestMessage::set_verb(ArgT0&& arg0, ArgT... args) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.verb_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketRequestMessage.verb)
}
inline std::string* WebSocketRequestMessage::mutable_verb() {
std::string* _s = _internal_mutable_verb();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketRequestMessage.verb)
return _s;
}
inline const std::string& WebSocketRequestMessage::_internal_verb() const {
return _impl_.verb_.Get();
}
inline void WebSocketRequestMessage::_internal_set_verb(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.verb_.Set(value, GetArenaForAllocation());
}
inline std::string* WebSocketRequestMessage::_internal_mutable_verb() {
_impl_._has_bits_[0] |= 0x00000001u;
return _impl_.verb_.Mutable(GetArenaForAllocation());
}
inline std::string* WebSocketRequestMessage::release_verb() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketRequestMessage.verb)
if (!_internal_has_verb()) {
return nullptr;
}
_impl_._has_bits_[0] &= ~0x00000001u;
auto* p = _impl_.verb_.Release();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.verb_.IsDefault()) {
_impl_.verb_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
return p;
}
inline void WebSocketRequestMessage::set_allocated_verb(std::string* verb) {
if (verb != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.verb_.SetAllocated(verb, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.verb_.IsDefault()) {
_impl_.verb_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketRequestMessage.verb)
}
// optional string path = 2;
inline bool WebSocketRequestMessage::_internal_has_path() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool WebSocketRequestMessage::has_path() const {
return _internal_has_path();
}
inline void WebSocketRequestMessage::clear_path() {
_impl_.path_.ClearToEmpty();
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline const std::string& WebSocketRequestMessage::path() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketRequestMessage.path)
return _internal_path();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void WebSocketRequestMessage::set_path(ArgT0&& arg0, ArgT... args) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.path_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketRequestMessage.path)
}
inline std::string* WebSocketRequestMessage::mutable_path() {
std::string* _s = _internal_mutable_path();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketRequestMessage.path)
return _s;
}
inline const std::string& WebSocketRequestMessage::_internal_path() const {
return _impl_.path_.Get();
}
inline void WebSocketRequestMessage::_internal_set_path(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.path_.Set(value, GetArenaForAllocation());
}
inline std::string* WebSocketRequestMessage::_internal_mutable_path() {
_impl_._has_bits_[0] |= 0x00000002u;
return _impl_.path_.Mutable(GetArenaForAllocation());
}
inline std::string* WebSocketRequestMessage::release_path() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketRequestMessage.path)
if (!_internal_has_path()) {
return nullptr;
}
_impl_._has_bits_[0] &= ~0x00000002u;
auto* p = _impl_.path_.Release();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.path_.IsDefault()) {
_impl_.path_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
return p;
}
inline void WebSocketRequestMessage::set_allocated_path(std::string* path) {
if (path != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
_impl_.path_.SetAllocated(path, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.path_.IsDefault()) {
_impl_.path_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketRequestMessage.path)
}
// optional bytes body = 3;
inline bool WebSocketRequestMessage::_internal_has_body() const {
bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool WebSocketRequestMessage::has_body() const {
return _internal_has_body();
}
inline void WebSocketRequestMessage::clear_body() {
_impl_.body_.ClearToEmpty();
_impl_._has_bits_[0] &= ~0x00000004u;
}
inline const std::string& WebSocketRequestMessage::body() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketRequestMessage.body)
return _internal_body();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void WebSocketRequestMessage::set_body(ArgT0&& arg0, ArgT... args) {
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.body_.SetBytes(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketRequestMessage.body)
}
inline std::string* WebSocketRequestMessage::mutable_body() {
std::string* _s = _internal_mutable_body();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketRequestMessage.body)
return _s;
}
inline const std::string& WebSocketRequestMessage::_internal_body() const {
return _impl_.body_.Get();
}
inline void WebSocketRequestMessage::_internal_set_body(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.body_.Set(value, GetArenaForAllocation());
}
inline std::string* WebSocketRequestMessage::_internal_mutable_body() {
_impl_._has_bits_[0] |= 0x00000004u;
return _impl_.body_.Mutable(GetArenaForAllocation());
}
inline std::string* WebSocketRequestMessage::release_body() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketRequestMessage.body)
if (!_internal_has_body()) {
return nullptr;
}
_impl_._has_bits_[0] &= ~0x00000004u;
auto* p = _impl_.body_.Release();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.body_.IsDefault()) {
_impl_.body_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
return p;
}
inline void WebSocketRequestMessage::set_allocated_body(std::string* body) {
if (body != nullptr) {
_impl_._has_bits_[0] |= 0x00000004u;
} else {
_impl_._has_bits_[0] &= ~0x00000004u;
}
_impl_.body_.SetAllocated(body, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.body_.IsDefault()) {
_impl_.body_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketRequestMessage.body)
}
// repeated string headers = 5;
inline int WebSocketRequestMessage::_internal_headers_size() const {
return _impl_.headers_.size();
}
inline int WebSocketRequestMessage::headers_size() const {
return _internal_headers_size();
}
inline void WebSocketRequestMessage::clear_headers() {
_impl_.headers_.Clear();
}
inline std::string* WebSocketRequestMessage::add_headers() {
std::string* _s = _internal_add_headers();
// @@protoc_insertion_point(field_add_mutable:WebSocketProtos.WebSocketRequestMessage.headers)
return _s;
}
inline const std::string& WebSocketRequestMessage::_internal_headers(int index) const {
return _impl_.headers_.Get(index);
}
inline const std::string& WebSocketRequestMessage::headers(int index) const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketRequestMessage.headers)
return _internal_headers(index);
}
inline std::string* WebSocketRequestMessage::mutable_headers(int index) {
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketRequestMessage.headers)
return _impl_.headers_.Mutable(index);
}
inline void WebSocketRequestMessage::set_headers(int index, const std::string& value) {
_impl_.headers_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline void WebSocketRequestMessage::set_headers(int index, std::string&& value) {
_impl_.headers_.Mutable(index)->assign(std::move(value));
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline void WebSocketRequestMessage::set_headers(int index, const char* value) {
GOOGLE_DCHECK(value != nullptr);
_impl_.headers_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline void WebSocketRequestMessage::set_headers(int index, const char* value, size_t size) {
_impl_.headers_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline std::string* WebSocketRequestMessage::_internal_add_headers() {
return _impl_.headers_.Add();
}
inline void WebSocketRequestMessage::add_headers(const std::string& value) {
_impl_.headers_.Add()->assign(value);
// @@protoc_insertion_point(field_add:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline void WebSocketRequestMessage::add_headers(std::string&& value) {
_impl_.headers_.Add(std::move(value));
// @@protoc_insertion_point(field_add:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline void WebSocketRequestMessage::add_headers(const char* value) {
GOOGLE_DCHECK(value != nullptr);
_impl_.headers_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline void WebSocketRequestMessage::add_headers(const char* value, size_t size) {
_impl_.headers_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:WebSocketProtos.WebSocketRequestMessage.headers)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
WebSocketRequestMessage::headers() const {
// @@protoc_insertion_point(field_list:WebSocketProtos.WebSocketRequestMessage.headers)
return _impl_.headers_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
WebSocketRequestMessage::mutable_headers() {
// @@protoc_insertion_point(field_mutable_list:WebSocketProtos.WebSocketRequestMessage.headers)
return &_impl_.headers_;
}
// optional uint64 requestId = 4;
inline bool WebSocketRequestMessage::_internal_has_requestid() const {
bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
return value;
}
inline bool WebSocketRequestMessage::has_requestid() const {
return _internal_has_requestid();
}
inline void WebSocketRequestMessage::clear_requestid() {
_impl_.requestid_ = uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000008u;
}
inline uint64_t WebSocketRequestMessage::_internal_requestid() const {
return _impl_.requestid_;
}
inline uint64_t WebSocketRequestMessage::requestid() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketRequestMessage.requestId)
return _internal_requestid();
}
inline void WebSocketRequestMessage::_internal_set_requestid(uint64_t value) {
_impl_._has_bits_[0] |= 0x00000008u;
_impl_.requestid_ = value;
}
inline void WebSocketRequestMessage::set_requestid(uint64_t value) {
_internal_set_requestid(value);
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketRequestMessage.requestId)
}
// -------------------------------------------------------------------
// WebSocketResponseMessage
// optional uint64 requestId = 1;
inline bool WebSocketResponseMessage::_internal_has_requestid() const {
bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool WebSocketResponseMessage::has_requestid() const {
return _internal_has_requestid();
}
inline void WebSocketResponseMessage::clear_requestid() {
_impl_.requestid_ = uint64_t{0u};
_impl_._has_bits_[0] &= ~0x00000004u;
}
inline uint64_t WebSocketResponseMessage::_internal_requestid() const {
return _impl_.requestid_;
}
inline uint64_t WebSocketResponseMessage::requestid() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketResponseMessage.requestId)
return _internal_requestid();
}
inline void WebSocketResponseMessage::_internal_set_requestid(uint64_t value) {
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.requestid_ = value;
}
inline void WebSocketResponseMessage::set_requestid(uint64_t value) {
_internal_set_requestid(value);
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketResponseMessage.requestId)
}
// optional uint32 status = 2;
inline bool WebSocketResponseMessage::_internal_has_status() const {
bool value = (_impl_._has_bits_[0] & 0x00000008u) != 0;
return value;
}
inline bool WebSocketResponseMessage::has_status() const {
return _internal_has_status();
}
inline void WebSocketResponseMessage::clear_status() {
_impl_.status_ = 0u;
_impl_._has_bits_[0] &= ~0x00000008u;
}
inline uint32_t WebSocketResponseMessage::_internal_status() const {
return _impl_.status_;
}
inline uint32_t WebSocketResponseMessage::status() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketResponseMessage.status)
return _internal_status();
}
inline void WebSocketResponseMessage::_internal_set_status(uint32_t value) {
_impl_._has_bits_[0] |= 0x00000008u;
_impl_.status_ = value;
}
inline void WebSocketResponseMessage::set_status(uint32_t value) {
_internal_set_status(value);
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketResponseMessage.status)
}
// optional string message = 3;
inline bool WebSocketResponseMessage::_internal_has_message() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
return value;
}
inline bool WebSocketResponseMessage::has_message() const {
return _internal_has_message();
}
inline void WebSocketResponseMessage::clear_message() {
_impl_.message_.ClearToEmpty();
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline const std::string& WebSocketResponseMessage::message() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketResponseMessage.message)
return _internal_message();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void WebSocketResponseMessage::set_message(ArgT0&& arg0, ArgT... args) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.message_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketResponseMessage.message)
}
inline std::string* WebSocketResponseMessage::mutable_message() {
std::string* _s = _internal_mutable_message();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketResponseMessage.message)
return _s;
}
inline const std::string& WebSocketResponseMessage::_internal_message() const {
return _impl_.message_.Get();
}
inline void WebSocketResponseMessage::_internal_set_message(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000001u;
_impl_.message_.Set(value, GetArenaForAllocation());
}
inline std::string* WebSocketResponseMessage::_internal_mutable_message() {
_impl_._has_bits_[0] |= 0x00000001u;
return _impl_.message_.Mutable(GetArenaForAllocation());
}
inline std::string* WebSocketResponseMessage::release_message() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketResponseMessage.message)
if (!_internal_has_message()) {
return nullptr;
}
_impl_._has_bits_[0] &= ~0x00000001u;
auto* p = _impl_.message_.Release();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.message_.IsDefault()) {
_impl_.message_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
return p;
}
inline void WebSocketResponseMessage::set_allocated_message(std::string* message) {
if (message != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.message_.SetAllocated(message, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.message_.IsDefault()) {
_impl_.message_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketResponseMessage.message)
}
// repeated string headers = 5;
inline int WebSocketResponseMessage::_internal_headers_size() const {
return _impl_.headers_.size();
}
inline int WebSocketResponseMessage::headers_size() const {
return _internal_headers_size();
}
inline void WebSocketResponseMessage::clear_headers() {
_impl_.headers_.Clear();
}
inline std::string* WebSocketResponseMessage::add_headers() {
std::string* _s = _internal_add_headers();
// @@protoc_insertion_point(field_add_mutable:WebSocketProtos.WebSocketResponseMessage.headers)
return _s;
}
inline const std::string& WebSocketResponseMessage::_internal_headers(int index) const {
return _impl_.headers_.Get(index);
}
inline const std::string& WebSocketResponseMessage::headers(int index) const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketResponseMessage.headers)
return _internal_headers(index);
}
inline std::string* WebSocketResponseMessage::mutable_headers(int index) {
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketResponseMessage.headers)
return _impl_.headers_.Mutable(index);
}
inline void WebSocketResponseMessage::set_headers(int index, const std::string& value) {
_impl_.headers_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline void WebSocketResponseMessage::set_headers(int index, std::string&& value) {
_impl_.headers_.Mutable(index)->assign(std::move(value));
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline void WebSocketResponseMessage::set_headers(int index, const char* value) {
GOOGLE_DCHECK(value != nullptr);
_impl_.headers_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline void WebSocketResponseMessage::set_headers(int index, const char* value, size_t size) {
_impl_.headers_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline std::string* WebSocketResponseMessage::_internal_add_headers() {
return _impl_.headers_.Add();
}
inline void WebSocketResponseMessage::add_headers(const std::string& value) {
_impl_.headers_.Add()->assign(value);
// @@protoc_insertion_point(field_add:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline void WebSocketResponseMessage::add_headers(std::string&& value) {
_impl_.headers_.Add(std::move(value));
// @@protoc_insertion_point(field_add:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline void WebSocketResponseMessage::add_headers(const char* value) {
GOOGLE_DCHECK(value != nullptr);
_impl_.headers_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline void WebSocketResponseMessage::add_headers(const char* value, size_t size) {
_impl_.headers_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:WebSocketProtos.WebSocketResponseMessage.headers)
}
inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
WebSocketResponseMessage::headers() const {
// @@protoc_insertion_point(field_list:WebSocketProtos.WebSocketResponseMessage.headers)
return _impl_.headers_;
}
inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
WebSocketResponseMessage::mutable_headers() {
// @@protoc_insertion_point(field_mutable_list:WebSocketProtos.WebSocketResponseMessage.headers)
return &_impl_.headers_;
}
// optional bytes body = 4;
inline bool WebSocketResponseMessage::_internal_has_body() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
return value;
}
inline bool WebSocketResponseMessage::has_body() const {
return _internal_has_body();
}
inline void WebSocketResponseMessage::clear_body() {
_impl_.body_.ClearToEmpty();
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline const std::string& WebSocketResponseMessage::body() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketResponseMessage.body)
return _internal_body();
}
template <typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE
void WebSocketResponseMessage::set_body(ArgT0&& arg0, ArgT... args) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.body_.SetBytes(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketResponseMessage.body)
}
inline std::string* WebSocketResponseMessage::mutable_body() {
std::string* _s = _internal_mutable_body();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketResponseMessage.body)
return _s;
}
inline const std::string& WebSocketResponseMessage::_internal_body() const {
return _impl_.body_.Get();
}
inline void WebSocketResponseMessage::_internal_set_body(const std::string& value) {
_impl_._has_bits_[0] |= 0x00000002u;
_impl_.body_.Set(value, GetArenaForAllocation());
}
inline std::string* WebSocketResponseMessage::_internal_mutable_body() {
_impl_._has_bits_[0] |= 0x00000002u;
return _impl_.body_.Mutable(GetArenaForAllocation());
}
inline std::string* WebSocketResponseMessage::release_body() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketResponseMessage.body)
if (!_internal_has_body()) {
return nullptr;
}
_impl_._has_bits_[0] &= ~0x00000002u;
auto* p = _impl_.body_.Release();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.body_.IsDefault()) {
_impl_.body_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
return p;
}
inline void WebSocketResponseMessage::set_allocated_body(std::string* body) {
if (body != nullptr) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
_impl_.body_.SetAllocated(body, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (_impl_.body_.IsDefault()) {
_impl_.body_.Set("", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketResponseMessage.body)
}
// -------------------------------------------------------------------
// WebSocketMessage
// optional .WebSocketProtos.WebSocketMessage.Type type = 1;
inline bool WebSocketMessage::_internal_has_type() const {
bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0;
return value;
}
inline bool WebSocketMessage::has_type() const {
return _internal_has_type();
}
inline void WebSocketMessage::clear_type() {
_impl_.type_ = 0;
_impl_._has_bits_[0] &= ~0x00000004u;
}
inline ::WebSocketProtos::WebSocketMessage_Type WebSocketMessage::_internal_type() const {
return static_cast< ::WebSocketProtos::WebSocketMessage_Type >(_impl_.type_);
}
inline ::WebSocketProtos::WebSocketMessage_Type WebSocketMessage::type() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketMessage.type)
return _internal_type();
}
inline void WebSocketMessage::_internal_set_type(::WebSocketProtos::WebSocketMessage_Type value) {
assert(::WebSocketProtos::WebSocketMessage_Type_IsValid(value));
_impl_._has_bits_[0] |= 0x00000004u;
_impl_.type_ = value;
}
inline void WebSocketMessage::set_type(::WebSocketProtos::WebSocketMessage_Type value) {
_internal_set_type(value);
// @@protoc_insertion_point(field_set:WebSocketProtos.WebSocketMessage.type)
}
// optional .WebSocketProtos.WebSocketRequestMessage request = 2;
inline bool WebSocketMessage::_internal_has_request() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
PROTOBUF_ASSUME(!value || _impl_.request_ != nullptr);
return value;
}
inline bool WebSocketMessage::has_request() const {
return _internal_has_request();
}
inline void WebSocketMessage::clear_request() {
if (_impl_.request_ != nullptr) _impl_.request_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
}
inline const ::WebSocketProtos::WebSocketRequestMessage& WebSocketMessage::_internal_request() const {
const ::WebSocketProtos::WebSocketRequestMessage* p = _impl_.request_;
return p != nullptr ? *p : reinterpret_cast<const ::WebSocketProtos::WebSocketRequestMessage&>(
::WebSocketProtos::_WebSocketRequestMessage_default_instance_);
}
inline const ::WebSocketProtos::WebSocketRequestMessage& WebSocketMessage::request() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketMessage.request)
return _internal_request();
}
inline void WebSocketMessage::unsafe_arena_set_allocated_request(
::WebSocketProtos::WebSocketRequestMessage* request) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.request_);
}
_impl_.request_ = request;
if (request) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:WebSocketProtos.WebSocketMessage.request)
}
inline ::WebSocketProtos::WebSocketRequestMessage* WebSocketMessage::release_request() {
_impl_._has_bits_[0] &= ~0x00000001u;
::WebSocketProtos::WebSocketRequestMessage* temp = _impl_.request_;
_impl_.request_ = 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; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::WebSocketProtos::WebSocketRequestMessage* WebSocketMessage::unsafe_arena_release_request() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketMessage.request)
_impl_._has_bits_[0] &= ~0x00000001u;
::WebSocketProtos::WebSocketRequestMessage* temp = _impl_.request_;
_impl_.request_ = nullptr;
return temp;
}
inline ::WebSocketProtos::WebSocketRequestMessage* WebSocketMessage::_internal_mutable_request() {
_impl_._has_bits_[0] |= 0x00000001u;
if (_impl_.request_ == nullptr) {
auto* p = CreateMaybeMessage<::WebSocketProtos::WebSocketRequestMessage>(GetArenaForAllocation());
_impl_.request_ = p;
}
return _impl_.request_;
}
inline ::WebSocketProtos::WebSocketRequestMessage* WebSocketMessage::mutable_request() {
::WebSocketProtos::WebSocketRequestMessage* _msg = _internal_mutable_request();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketMessage.request)
return _msg;
}
inline void WebSocketMessage::set_allocated_request(::WebSocketProtos::WebSocketRequestMessage* request) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete _impl_.request_;
}
if (request) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(request);
if (message_arena != submessage_arena) {
request = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, request, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.request_ = request;
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketMessage.request)
}
// optional .WebSocketProtos.WebSocketResponseMessage response = 3;
inline bool WebSocketMessage::_internal_has_response() const {
bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0;
PROTOBUF_ASSUME(!value || _impl_.response_ != nullptr);
return value;
}
inline bool WebSocketMessage::has_response() const {
return _internal_has_response();
}
inline void WebSocketMessage::clear_response() {
if (_impl_.response_ != nullptr) _impl_.response_->Clear();
_impl_._has_bits_[0] &= ~0x00000002u;
}
inline const ::WebSocketProtos::WebSocketResponseMessage& WebSocketMessage::_internal_response() const {
const ::WebSocketProtos::WebSocketResponseMessage* p = _impl_.response_;
return p != nullptr ? *p : reinterpret_cast<const ::WebSocketProtos::WebSocketResponseMessage&>(
::WebSocketProtos::_WebSocketResponseMessage_default_instance_);
}
inline const ::WebSocketProtos::WebSocketResponseMessage& WebSocketMessage::response() const {
// @@protoc_insertion_point(field_get:WebSocketProtos.WebSocketMessage.response)
return _internal_response();
}
inline void WebSocketMessage::unsafe_arena_set_allocated_response(
::WebSocketProtos::WebSocketResponseMessage* response) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.response_);
}
_impl_.response_ = response;
if (response) {
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:WebSocketProtos.WebSocketMessage.response)
}
inline ::WebSocketProtos::WebSocketResponseMessage* WebSocketMessage::release_response() {
_impl_._has_bits_[0] &= ~0x00000002u;
::WebSocketProtos::WebSocketResponseMessage* temp = _impl_.response_;
_impl_.response_ = 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; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::WebSocketProtos::WebSocketResponseMessage* WebSocketMessage::unsafe_arena_release_response() {
// @@protoc_insertion_point(field_release:WebSocketProtos.WebSocketMessage.response)
_impl_._has_bits_[0] &= ~0x00000002u;
::WebSocketProtos::WebSocketResponseMessage* temp = _impl_.response_;
_impl_.response_ = nullptr;
return temp;
}
inline ::WebSocketProtos::WebSocketResponseMessage* WebSocketMessage::_internal_mutable_response() {
_impl_._has_bits_[0] |= 0x00000002u;
if (_impl_.response_ == nullptr) {
auto* p = CreateMaybeMessage<::WebSocketProtos::WebSocketResponseMessage>(GetArenaForAllocation());
_impl_.response_ = p;
}
return _impl_.response_;
}
inline ::WebSocketProtos::WebSocketResponseMessage* WebSocketMessage::mutable_response() {
::WebSocketProtos::WebSocketResponseMessage* _msg = _internal_mutable_response();
// @@protoc_insertion_point(field_mutable:WebSocketProtos.WebSocketMessage.response)
return _msg;
}
inline void WebSocketMessage::set_allocated_response(::WebSocketProtos::WebSocketResponseMessage* response) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete _impl_.response_;
}
if (response) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(response);
if (message_arena != submessage_arena) {
response = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, response, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000002u;
} else {
_impl_._has_bits_[0] &= ~0x00000002u;
}
_impl_.response_ = response;
// @@protoc_insertion_point(field_set_allocated:WebSocketProtos.WebSocketMessage.response)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
} // namespace WebSocketProtos
PROTOBUF_NAMESPACE_OPEN
template <> struct is_proto_enum< ::WebSocketProtos::WebSocketMessage_Type> : ::std::true_type {};
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_WebSocketResources_2eproto