Merge pull request #5 from Akash4927/c++-protobuf-code

Add C++ protobuf generated code
This commit is contained in:
Alex Grin 2018-10-01 13:59:38 -04:00 committed by GitHub
commit 733f6512e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 9509 additions and 2 deletions

View file

@ -24,7 +24,7 @@ hash protoc-gen-go 2>/dev/null || go get -u github.com/golang/protobuf/protoc-ge
hash protoc-gen-go 2>/dev/null || { echo >&2 'error: Make sure $GOPATH/bin is in your $PATH'; exit 1; }
find $DIR/go $DIR/python $DIR/js -type f -delete
find $DIR/go $DIR/python $DIR/js $DIR/cpp -type f -delete
protoc --proto_path="$DIR/proto" --python_out="$DIR/python" --go_out="$DIR/go" --js_out="import_style=commonjs,binary:$DIR/js" $DIR/proto/*.proto
protoc --proto_path="$DIR/proto" --python_out="$DIR/python" --go_out="$DIR/go" --js_out="import_style=commonjs,binary:$DIR/js" --cpp_out="$DIR/cpp" $DIR/proto/*.proto

530
cpp/certificate.pb.cc Normal file
View file

@ -0,0 +1,530 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: certificate.proto
#include "certificate.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace pb {
class CertificateDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Certificate>
_instance;
} _Certificate_default_instance_;
} // namespace pb
namespace protobuf_certificate_2eproto {
static void InitDefaultsCertificate() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::pb::_Certificate_default_instance_;
new (ptr) ::pb::Certificate();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::pb::Certificate::InitAsDefaultInstance();
}
::google::protobuf::internal::SCCInfo<0> scc_info_Certificate =
{{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsCertificate}, {}};
void InitDefaults() {
::google::protobuf::internal::InitSCC(&scc_info_Certificate.base);
}
::google::protobuf::Metadata file_level_metadata[1];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, keytype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Certificate, publickey_),
1,
2,
0,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 8, sizeof(::pb::Certificate)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::pb::_Certificate_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
AssignDescriptors(
"certificate.proto", schemas, file_default_instances, TableStruct::offsets,
file_level_metadata, file_level_enum_descriptors, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\021certificate.proto\022\002pb\"\224\001\n\013Certificate\022"
"(\n\007version\030\001 \002(\0162\027.pb.Certificate.Versio"
"n\022\034\n\007keyType\030\002 \002(\0162\013.pb.KeyType\022\021\n\tpubli"
"cKey\030\004 \002(\014\"*\n\007Version\022\023\n\017UNKNOWN_VERSION"
"\020\000\022\n\n\006_0_0_1\020\001*Q\n\007KeyType\022\033\n\027UNKNOWN_PUB"
"LIC_KEY_TYPE\020\000\022\014\n\010NIST256p\020\001\022\014\n\010NIST384p"
"\020\002\022\r\n\tSECP256k1\020\003"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 257);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"certificate.proto", &protobuf_RegisterTypes);
}
void AddDescriptors() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_certificate_2eproto
namespace pb {
const ::google::protobuf::EnumDescriptor* Certificate_Version_descriptor() {
protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_certificate_2eproto::file_level_enum_descriptors[0];
}
bool Certificate_Version_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Certificate_Version Certificate::UNKNOWN_VERSION;
const Certificate_Version Certificate::_0_0_1;
const Certificate_Version Certificate::Version_MIN;
const Certificate_Version Certificate::Version_MAX;
const int Certificate::Version_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* KeyType_descriptor() {
protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_certificate_2eproto::file_level_enum_descriptors[1];
}
bool KeyType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
// ===================================================================
void Certificate::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Certificate::kVersionFieldNumber;
const int Certificate::kKeyTypeFieldNumber;
const int Certificate::kPublicKeyFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Certificate::Certificate()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
::google::protobuf::internal::InitSCC(
&protobuf_certificate_2eproto::scc_info_Certificate.base);
SharedCtor();
// @@protoc_insertion_point(constructor:pb.Certificate)
}
Certificate::Certificate(const Certificate& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
publickey_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_publickey()) {
publickey_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.publickey_);
}
::memcpy(&version_, &from.version_,
static_cast<size_t>(reinterpret_cast<char*>(&keytype_) -
reinterpret_cast<char*>(&version_)) + sizeof(keytype_));
// @@protoc_insertion_point(copy_constructor:pb.Certificate)
}
void Certificate::SharedCtor() {
publickey_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&keytype_) -
reinterpret_cast<char*>(&version_)) + sizeof(keytype_));
}
Certificate::~Certificate() {
// @@protoc_insertion_point(destructor:pb.Certificate)
SharedDtor();
}
void Certificate::SharedDtor() {
publickey_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void Certificate::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Certificate::descriptor() {
::protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_certificate_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Certificate& Certificate::default_instance() {
::google::protobuf::internal::InitSCC(&protobuf_certificate_2eproto::scc_info_Certificate.base);
return *internal_default_instance();
}
void Certificate::Clear() {
// @@protoc_insertion_point(message_clear_start:pb.Certificate)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
publickey_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 6u) {
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&keytype_) -
reinterpret_cast<char*>(&version_)) + sizeof(keytype_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
bool Certificate::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:pb.Certificate)
for (;;) {
::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .pb.Certificate.Version version = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Certificate_Version_IsValid(value)) {
set_version(static_cast< ::pb::Certificate_Version >(value));
} else {
mutable_unknown_fields()->AddVarint(
1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required .pb.KeyType keyType = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::KeyType_IsValid(value)) {
set_keytype(static_cast< ::pb::KeyType >(value));
} else {
mutable_unknown_fields()->AddVarint(
2, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required bytes publicKey = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_publickey()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:pb.Certificate)
return true;
failure:
// @@protoc_insertion_point(parse_failure:pb.Certificate)
return false;
#undef DO_
}
void Certificate::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:pb.Certificate)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Certificate.Version version = 1;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->version(), output);
}
// required .pb.KeyType keyType = 2;
if (cached_has_bits & 0x00000004u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->keytype(), output);
}
// required bytes publicKey = 4;
if (cached_has_bits & 0x00000001u) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
4, this->publickey(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:pb.Certificate)
}
::google::protobuf::uint8* Certificate::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:pb.Certificate)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Certificate.Version version = 1;
if (cached_has_bits & 0x00000002u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->version(), target);
}
// required .pb.KeyType keyType = 2;
if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->keytype(), target);
}
// required bytes publicKey = 4;
if (cached_has_bits & 0x00000001u) {
target =
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
4, this->publickey(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:pb.Certificate)
return target;
}
size_t Certificate::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Certificate)
size_t total_size = 0;
if (has_publickey()) {
// required bytes publicKey = 4;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->publickey());
}
if (has_version()) {
// required .pb.Certificate.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
}
if (has_keytype()) {
// required .pb.KeyType keyType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->keytype());
}
return total_size;
}
size_t Certificate::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:pb.Certificate)
size_t total_size = 0;
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present.
// required bytes publicKey = 4;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->publickey());
// required .pb.Certificate.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
// required .pb.KeyType keyType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->keytype());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Certificate::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:pb.Certificate)
GOOGLE_DCHECK_NE(&from, this);
const Certificate* source =
::google::protobuf::internal::DynamicCastToGenerated<const Certificate>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Certificate)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Certificate)
MergeFrom(*source);
}
}
void Certificate::MergeFrom(const Certificate& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:pb.Certificate)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 7u) {
if (cached_has_bits & 0x00000001u) {
set_has_publickey();
publickey_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.publickey_);
}
if (cached_has_bits & 0x00000002u) {
version_ = from.version_;
}
if (cached_has_bits & 0x00000004u) {
keytype_ = from.keytype_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void Certificate::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:pb.Certificate)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Certificate::CopyFrom(const Certificate& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:pb.Certificate)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Certificate::IsInitialized() const {
if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
return true;
}
void Certificate::Swap(Certificate* other) {
if (other == this) return;
InternalSwap(other);
}
void Certificate::InternalSwap(Certificate* other) {
using std::swap;
publickey_.Swap(&other->publickey_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(version_, other->version_);
swap(keytype_, other->keytype_);
swap(_has_bits_[0], other->_has_bits_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
}
::google::protobuf::Metadata Certificate::GetMetadata() const {
protobuf_certificate_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_certificate_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Certificate* Arena::CreateMaybeMessage< ::pb::Certificate >(Arena* arena) {
return Arena::CreateInternal< ::pb::Certificate >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)

426
cpp/certificate.pb.h Normal file
View file

@ -0,0 +1,426 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: certificate.proto
#ifndef PROTOBUF_INCLUDED_certificate_2eproto
#define PROTOBUF_INCLUDED_certificate_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006000
#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 3006000 < GOOGLE_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/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_certificate_2eproto
namespace protobuf_certificate_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_certificate_2eproto
namespace pb {
class Certificate;
class CertificateDefaultTypeInternal;
extern CertificateDefaultTypeInternal _Certificate_default_instance_;
} // namespace pb
namespace google {
namespace protobuf {
template<> ::pb::Certificate* Arena::CreateMaybeMessage<::pb::Certificate>(Arena*);
} // namespace protobuf
} // namespace google
namespace pb {
enum Certificate_Version {
Certificate_Version_UNKNOWN_VERSION = 0,
Certificate_Version__0_0_1 = 1
};
bool Certificate_Version_IsValid(int value);
const Certificate_Version Certificate_Version_Version_MIN = Certificate_Version_UNKNOWN_VERSION;
const Certificate_Version Certificate_Version_Version_MAX = Certificate_Version__0_0_1;
const int Certificate_Version_Version_ARRAYSIZE = Certificate_Version_Version_MAX + 1;
const ::google::protobuf::EnumDescriptor* Certificate_Version_descriptor();
inline const ::std::string& Certificate_Version_Name(Certificate_Version value) {
return ::google::protobuf::internal::NameOfEnum(
Certificate_Version_descriptor(), value);
}
inline bool Certificate_Version_Parse(
const ::std::string& name, Certificate_Version* value) {
return ::google::protobuf::internal::ParseNamedEnum<Certificate_Version>(
Certificate_Version_descriptor(), name, value);
}
enum KeyType {
UNKNOWN_PUBLIC_KEY_TYPE = 0,
NIST256p = 1,
NIST384p = 2,
SECP256k1 = 3
};
bool KeyType_IsValid(int value);
const KeyType KeyType_MIN = UNKNOWN_PUBLIC_KEY_TYPE;
const KeyType KeyType_MAX = SECP256k1;
const int KeyType_ARRAYSIZE = KeyType_MAX + 1;
const ::google::protobuf::EnumDescriptor* KeyType_descriptor();
inline const ::std::string& KeyType_Name(KeyType value) {
return ::google::protobuf::internal::NameOfEnum(
KeyType_descriptor(), value);
}
inline bool KeyType_Parse(
const ::std::string& name, KeyType* value) {
return ::google::protobuf::internal::ParseNamedEnum<KeyType>(
KeyType_descriptor(), name, value);
}
// ===================================================================
class Certificate : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Certificate) */ {
public:
Certificate();
virtual ~Certificate();
Certificate(const Certificate& from);
inline Certificate& operator=(const Certificate& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
Certificate(Certificate&& from) noexcept
: Certificate() {
*this = ::std::move(from);
}
inline Certificate& operator=(Certificate&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Certificate& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Certificate* internal_default_instance() {
return reinterpret_cast<const Certificate*>(
&_Certificate_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(Certificate* other);
friend void swap(Certificate& a, Certificate& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline Certificate* New() const final {
return CreateMaybeMessage<Certificate>(NULL);
}
Certificate* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<Certificate>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const Certificate& from);
void MergeFrom(const Certificate& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Certificate* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef Certificate_Version Version;
static const Version UNKNOWN_VERSION =
Certificate_Version_UNKNOWN_VERSION;
static const Version _0_0_1 =
Certificate_Version__0_0_1;
static inline bool Version_IsValid(int value) {
return Certificate_Version_IsValid(value);
}
static const Version Version_MIN =
Certificate_Version_Version_MIN;
static const Version Version_MAX =
Certificate_Version_Version_MAX;
static const int Version_ARRAYSIZE =
Certificate_Version_Version_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Version_descriptor() {
return Certificate_Version_descriptor();
}
static inline const ::std::string& Version_Name(Version value) {
return Certificate_Version_Name(value);
}
static inline bool Version_Parse(const ::std::string& name,
Version* value) {
return Certificate_Version_Parse(name, value);
}
// accessors -------------------------------------------------------
// required bytes publicKey = 4;
bool has_publickey() const;
void clear_publickey();
static const int kPublicKeyFieldNumber = 4;
const ::std::string& publickey() const;
void set_publickey(const ::std::string& value);
#if LANG_CXX11
void set_publickey(::std::string&& value);
#endif
void set_publickey(const char* value);
void set_publickey(const void* value, size_t size);
::std::string* mutable_publickey();
::std::string* release_publickey();
void set_allocated_publickey(::std::string* publickey);
// required .pb.Certificate.Version version = 1;
bool has_version() const;
void clear_version();
static const int kVersionFieldNumber = 1;
::pb::Certificate_Version version() const;
void set_version(::pb::Certificate_Version value);
// required .pb.KeyType keyType = 2;
bool has_keytype() const;
void clear_keytype();
static const int kKeyTypeFieldNumber = 2;
::pb::KeyType keytype() const;
void set_keytype(::pb::KeyType value);
// @@protoc_insertion_point(class_scope:pb.Certificate)
private:
void set_has_version();
void clear_has_version();
void set_has_keytype();
void clear_has_keytype();
void set_has_publickey();
void clear_has_publickey();
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr publickey_;
int version_;
int keytype_;
friend struct ::protobuf_certificate_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Certificate
// required .pb.Certificate.Version version = 1;
inline bool Certificate::has_version() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Certificate::set_has_version() {
_has_bits_[0] |= 0x00000002u;
}
inline void Certificate::clear_has_version() {
_has_bits_[0] &= ~0x00000002u;
}
inline void Certificate::clear_version() {
version_ = 0;
clear_has_version();
}
inline ::pb::Certificate_Version Certificate::version() const {
// @@protoc_insertion_point(field_get:pb.Certificate.version)
return static_cast< ::pb::Certificate_Version >(version_);
}
inline void Certificate::set_version(::pb::Certificate_Version value) {
assert(::pb::Certificate_Version_IsValid(value));
set_has_version();
version_ = value;
// @@protoc_insertion_point(field_set:pb.Certificate.version)
}
// required .pb.KeyType keyType = 2;
inline bool Certificate::has_keytype() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Certificate::set_has_keytype() {
_has_bits_[0] |= 0x00000004u;
}
inline void Certificate::clear_has_keytype() {
_has_bits_[0] &= ~0x00000004u;
}
inline void Certificate::clear_keytype() {
keytype_ = 0;
clear_has_keytype();
}
inline ::pb::KeyType Certificate::keytype() const {
// @@protoc_insertion_point(field_get:pb.Certificate.keyType)
return static_cast< ::pb::KeyType >(keytype_);
}
inline void Certificate::set_keytype(::pb::KeyType value) {
assert(::pb::KeyType_IsValid(value));
set_has_keytype();
keytype_ = value;
// @@protoc_insertion_point(field_set:pb.Certificate.keyType)
}
// required bytes publicKey = 4;
inline bool Certificate::has_publickey() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Certificate::set_has_publickey() {
_has_bits_[0] |= 0x00000001u;
}
inline void Certificate::clear_has_publickey() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Certificate::clear_publickey() {
publickey_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_publickey();
}
inline const ::std::string& Certificate::publickey() const {
// @@protoc_insertion_point(field_get:pb.Certificate.publicKey)
return publickey_.GetNoArena();
}
inline void Certificate::set_publickey(const ::std::string& value) {
set_has_publickey();
publickey_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:pb.Certificate.publicKey)
}
#if LANG_CXX11
inline void Certificate::set_publickey(::std::string&& value) {
set_has_publickey();
publickey_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:pb.Certificate.publicKey)
}
#endif
inline void Certificate::set_publickey(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_publickey();
publickey_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:pb.Certificate.publicKey)
}
inline void Certificate::set_publickey(const void* value, size_t size) {
set_has_publickey();
publickey_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:pb.Certificate.publicKey)
}
inline ::std::string* Certificate::mutable_publickey() {
set_has_publickey();
// @@protoc_insertion_point(field_mutable:pb.Certificate.publicKey)
return publickey_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* Certificate::release_publickey() {
// @@protoc_insertion_point(field_release:pb.Certificate.publicKey)
if (!has_publickey()) {
return NULL;
}
clear_has_publickey();
return publickey_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void Certificate::set_allocated_publickey(::std::string* publickey) {
if (publickey != NULL) {
set_has_publickey();
} else {
clear_has_publickey();
}
publickey_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), publickey);
// @@protoc_insertion_point(field_set_allocated:pb.Certificate.publicKey)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::pb::Certificate_Version> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Certificate_Version>() {
return ::pb::Certificate_Version_descriptor();
}
template <> struct is_proto_enum< ::pb::KeyType> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::KeyType>() {
return ::pb::KeyType_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_certificate_2eproto

678
cpp/claim.pb.cc Normal file
View file

@ -0,0 +1,678 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: claim.proto
#include "claim.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace protobuf_certificate_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_certificate_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Certificate;
} // namespace protobuf_certificate_2eproto
namespace protobuf_signature_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_signature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Signature;
} // namespace protobuf_signature_2eproto
namespace protobuf_stream_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_stream_2eproto ::google::protobuf::internal::SCCInfo<2> scc_info_Stream;
} // namespace protobuf_stream_2eproto
namespace pb {
class ClaimDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Claim>
_instance;
} _Claim_default_instance_;
} // namespace pb
namespace protobuf_claim_2eproto {
static void InitDefaultsClaim() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::pb::_Claim_default_instance_;
new (ptr) ::pb::Claim();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::pb::Claim::InitAsDefaultInstance();
}
::google::protobuf::internal::SCCInfo<3> scc_info_Claim =
{{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsClaim}, {
&protobuf_stream_2eproto::scc_info_Stream.base,
&protobuf_certificate_2eproto::scc_info_Certificate.base,
&protobuf_signature_2eproto::scc_info_Signature.base,}};
void InitDefaults() {
::google::protobuf::internal::InitSCC(&scc_info_Claim.base);
}
::google::protobuf::Metadata file_level_metadata[1];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, claimtype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, stream_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, certificate_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Claim, publishersignature_),
3,
4,
0,
1,
2,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 10, sizeof(::pb::Claim)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::pb::_Claim_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
AssignDescriptors(
"claim.proto", schemas, file_default_instances, TableStruct::offsets,
file_level_metadata, file_level_enum_descriptors, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\013claim.proto\022\002pb\032\014stream.proto\032\021certifi"
"cate.proto\032\017signature.proto\"\266\002\n\005Claim\022\"\n"
"\007version\030\001 \002(\0162\021.pb.Claim.Version\022&\n\tcla"
"imType\030\002 \002(\0162\023.pb.Claim.ClaimType\022\032\n\006str"
"eam\030\003 \001(\0132\n.pb.Stream\022$\n\013certificate\030\004 \001"
"(\0132\017.pb.Certificate\022)\n\022publisherSignatur"
"e\030\005 \001(\0132\r.pb.Signature\"*\n\007Version\022\023\n\017UNK"
"NOWN_VERSION\020\000\022\n\n\006_0_0_1\020\001\"H\n\tClaimType\022"
"\026\n\022UNKNOWN_CLAIM_TYPE\020\000\022\016\n\nstreamType\020\001\022"
"\023\n\017certificateType\020\002"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 380);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"claim.proto", &protobuf_RegisterTypes);
::protobuf_stream_2eproto::AddDescriptors();
::protobuf_certificate_2eproto::AddDescriptors();
::protobuf_signature_2eproto::AddDescriptors();
}
void AddDescriptors() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_claim_2eproto
namespace pb {
const ::google::protobuf::EnumDescriptor* Claim_Version_descriptor() {
protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_claim_2eproto::file_level_enum_descriptors[0];
}
bool Claim_Version_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Claim_Version Claim::UNKNOWN_VERSION;
const Claim_Version Claim::_0_0_1;
const Claim_Version Claim::Version_MIN;
const Claim_Version Claim::Version_MAX;
const int Claim::Version_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* Claim_ClaimType_descriptor() {
protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_claim_2eproto::file_level_enum_descriptors[1];
}
bool Claim_ClaimType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Claim_ClaimType Claim::UNKNOWN_CLAIM_TYPE;
const Claim_ClaimType Claim::streamType;
const Claim_ClaimType Claim::certificateType;
const Claim_ClaimType Claim::ClaimType_MIN;
const Claim_ClaimType Claim::ClaimType_MAX;
const int Claim::ClaimType_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
// ===================================================================
void Claim::InitAsDefaultInstance() {
::pb::_Claim_default_instance_._instance.get_mutable()->stream_ = const_cast< ::pb::Stream*>(
::pb::Stream::internal_default_instance());
::pb::_Claim_default_instance_._instance.get_mutable()->certificate_ = const_cast< ::pb::Certificate*>(
::pb::Certificate::internal_default_instance());
::pb::_Claim_default_instance_._instance.get_mutable()->publishersignature_ = const_cast< ::pb::Signature*>(
::pb::Signature::internal_default_instance());
}
void Claim::clear_stream() {
if (stream_ != NULL) stream_->Clear();
clear_has_stream();
}
void Claim::clear_certificate() {
if (certificate_ != NULL) certificate_->Clear();
clear_has_certificate();
}
void Claim::clear_publishersignature() {
if (publishersignature_ != NULL) publishersignature_->Clear();
clear_has_publishersignature();
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Claim::kVersionFieldNumber;
const int Claim::kClaimTypeFieldNumber;
const int Claim::kStreamFieldNumber;
const int Claim::kCertificateFieldNumber;
const int Claim::kPublisherSignatureFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Claim::Claim()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
::google::protobuf::internal::InitSCC(
&protobuf_claim_2eproto::scc_info_Claim.base);
SharedCtor();
// @@protoc_insertion_point(constructor:pb.Claim)
}
Claim::Claim(const Claim& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from.has_stream()) {
stream_ = new ::pb::Stream(*from.stream_);
} else {
stream_ = NULL;
}
if (from.has_certificate()) {
certificate_ = new ::pb::Certificate(*from.certificate_);
} else {
certificate_ = NULL;
}
if (from.has_publishersignature()) {
publishersignature_ = new ::pb::Signature(*from.publishersignature_);
} else {
publishersignature_ = NULL;
}
::memcpy(&version_, &from.version_,
static_cast<size_t>(reinterpret_cast<char*>(&claimtype_) -
reinterpret_cast<char*>(&version_)) + sizeof(claimtype_));
// @@protoc_insertion_point(copy_constructor:pb.Claim)
}
void Claim::SharedCtor() {
::memset(&stream_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&claimtype_) -
reinterpret_cast<char*>(&stream_)) + sizeof(claimtype_));
}
Claim::~Claim() {
// @@protoc_insertion_point(destructor:pb.Claim)
SharedDtor();
}
void Claim::SharedDtor() {
if (this != internal_default_instance()) delete stream_;
if (this != internal_default_instance()) delete certificate_;
if (this != internal_default_instance()) delete publishersignature_;
}
void Claim::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Claim::descriptor() {
::protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_claim_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Claim& Claim::default_instance() {
::google::protobuf::internal::InitSCC(&protobuf_claim_2eproto::scc_info_Claim.base);
return *internal_default_instance();
}
void Claim::Clear() {
// @@protoc_insertion_point(message_clear_start:pb.Claim)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 7u) {
if (cached_has_bits & 0x00000001u) {
GOOGLE_DCHECK(stream_ != NULL);
stream_->Clear();
}
if (cached_has_bits & 0x00000002u) {
GOOGLE_DCHECK(certificate_ != NULL);
certificate_->Clear();
}
if (cached_has_bits & 0x00000004u) {
GOOGLE_DCHECK(publishersignature_ != NULL);
publishersignature_->Clear();
}
}
if (cached_has_bits & 24u) {
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&claimtype_) -
reinterpret_cast<char*>(&version_)) + sizeof(claimtype_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
bool Claim::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:pb.Claim)
for (;;) {
::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .pb.Claim.Version version = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Claim_Version_IsValid(value)) {
set_version(static_cast< ::pb::Claim_Version >(value));
} else {
mutable_unknown_fields()->AddVarint(
1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required .pb.Claim.ClaimType claimType = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Claim_ClaimType_IsValid(value)) {
set_claimtype(static_cast< ::pb::Claim_ClaimType >(value));
} else {
mutable_unknown_fields()->AddVarint(
2, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// optional .pb.Stream stream = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_stream()));
} else {
goto handle_unusual;
}
break;
}
// optional .pb.Certificate certificate = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_certificate()));
} else {
goto handle_unusual;
}
break;
}
// optional .pb.Signature publisherSignature = 5;
case 5: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_publishersignature()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:pb.Claim)
return true;
failure:
// @@protoc_insertion_point(parse_failure:pb.Claim)
return false;
#undef DO_
}
void Claim::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:pb.Claim)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Claim.Version version = 1;
if (cached_has_bits & 0x00000008u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->version(), output);
}
// required .pb.Claim.ClaimType claimType = 2;
if (cached_has_bits & 0x00000010u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->claimtype(), output);
}
// optional .pb.Stream stream = 3;
if (cached_has_bits & 0x00000001u) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->_internal_stream(), output);
}
// optional .pb.Certificate certificate = 4;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->_internal_certificate(), output);
}
// optional .pb.Signature publisherSignature = 5;
if (cached_has_bits & 0x00000004u) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
5, this->_internal_publishersignature(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:pb.Claim)
}
::google::protobuf::uint8* Claim::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:pb.Claim)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Claim.Version version = 1;
if (cached_has_bits & 0x00000008u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->version(), target);
}
// required .pb.Claim.ClaimType claimType = 2;
if (cached_has_bits & 0x00000010u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->claimtype(), target);
}
// optional .pb.Stream stream = 3;
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
3, this->_internal_stream(), deterministic, target);
}
// optional .pb.Certificate certificate = 4;
if (cached_has_bits & 0x00000002u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
4, this->_internal_certificate(), deterministic, target);
}
// optional .pb.Signature publisherSignature = 5;
if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
5, this->_internal_publishersignature(), deterministic, target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:pb.Claim)
return target;
}
size_t Claim::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Claim)
size_t total_size = 0;
if (has_version()) {
// required .pb.Claim.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
}
if (has_claimtype()) {
// required .pb.Claim.ClaimType claimType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->claimtype());
}
return total_size;
}
size_t Claim::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:pb.Claim)
size_t total_size = 0;
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
if (((_has_bits_[0] & 0x00000018) ^ 0x00000018) == 0) { // All required fields are present.
// required .pb.Claim.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
// required .pb.Claim.ClaimType claimType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->claimtype());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
if (_has_bits_[0 / 32] & 7u) {
// optional .pb.Stream stream = 3;
if (has_stream()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*stream_);
}
// optional .pb.Certificate certificate = 4;
if (has_certificate()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*certificate_);
}
// optional .pb.Signature publisherSignature = 5;
if (has_publishersignature()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*publishersignature_);
}
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Claim::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:pb.Claim)
GOOGLE_DCHECK_NE(&from, this);
const Claim* source =
::google::protobuf::internal::DynamicCastToGenerated<const Claim>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Claim)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Claim)
MergeFrom(*source);
}
}
void Claim::MergeFrom(const Claim& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:pb.Claim)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 31u) {
if (cached_has_bits & 0x00000001u) {
mutable_stream()->::pb::Stream::MergeFrom(from.stream());
}
if (cached_has_bits & 0x00000002u) {
mutable_certificate()->::pb::Certificate::MergeFrom(from.certificate());
}
if (cached_has_bits & 0x00000004u) {
mutable_publishersignature()->::pb::Signature::MergeFrom(from.publishersignature());
}
if (cached_has_bits & 0x00000008u) {
version_ = from.version_;
}
if (cached_has_bits & 0x00000010u) {
claimtype_ = from.claimtype_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void Claim::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:pb.Claim)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Claim::CopyFrom(const Claim& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:pb.Claim)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Claim::IsInitialized() const {
if ((_has_bits_[0] & 0x00000018) != 0x00000018) return false;
if (has_stream()) {
if (!this->stream_->IsInitialized()) return false;
}
if (has_certificate()) {
if (!this->certificate_->IsInitialized()) return false;
}
if (has_publishersignature()) {
if (!this->publishersignature_->IsInitialized()) return false;
}
return true;
}
void Claim::Swap(Claim* other) {
if (other == this) return;
InternalSwap(other);
}
void Claim::InternalSwap(Claim* other) {
using std::swap;
swap(stream_, other->stream_);
swap(certificate_, other->certificate_);
swap(publishersignature_, other->publishersignature_);
swap(version_, other->version_);
swap(claimtype_, other->claimtype_);
swap(_has_bits_[0], other->_has_bits_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
}
::google::protobuf::Metadata Claim::GetMetadata() const {
protobuf_claim_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_claim_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Claim* Arena::CreateMaybeMessage< ::pb::Claim >(Arena* arena) {
return Arena::CreateInternal< ::pb::Claim >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)

579
cpp/claim.pb.h Normal file
View file

@ -0,0 +1,579 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: claim.proto
#ifndef PROTOBUF_INCLUDED_claim_2eproto
#define PROTOBUF_INCLUDED_claim_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006000
#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 3006000 < GOOGLE_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/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
#include "stream.pb.h"
#include "certificate.pb.h"
#include "signature.pb.h"
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_claim_2eproto
namespace protobuf_claim_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_claim_2eproto
namespace pb {
class Claim;
class ClaimDefaultTypeInternal;
extern ClaimDefaultTypeInternal _Claim_default_instance_;
} // namespace pb
namespace google {
namespace protobuf {
template<> ::pb::Claim* Arena::CreateMaybeMessage<::pb::Claim>(Arena*);
} // namespace protobuf
} // namespace google
namespace pb {
enum Claim_Version {
Claim_Version_UNKNOWN_VERSION = 0,
Claim_Version__0_0_1 = 1
};
bool Claim_Version_IsValid(int value);
const Claim_Version Claim_Version_Version_MIN = Claim_Version_UNKNOWN_VERSION;
const Claim_Version Claim_Version_Version_MAX = Claim_Version__0_0_1;
const int Claim_Version_Version_ARRAYSIZE = Claim_Version_Version_MAX + 1;
const ::google::protobuf::EnumDescriptor* Claim_Version_descriptor();
inline const ::std::string& Claim_Version_Name(Claim_Version value) {
return ::google::protobuf::internal::NameOfEnum(
Claim_Version_descriptor(), value);
}
inline bool Claim_Version_Parse(
const ::std::string& name, Claim_Version* value) {
return ::google::protobuf::internal::ParseNamedEnum<Claim_Version>(
Claim_Version_descriptor(), name, value);
}
enum Claim_ClaimType {
Claim_ClaimType_UNKNOWN_CLAIM_TYPE = 0,
Claim_ClaimType_streamType = 1,
Claim_ClaimType_certificateType = 2
};
bool Claim_ClaimType_IsValid(int value);
const Claim_ClaimType Claim_ClaimType_ClaimType_MIN = Claim_ClaimType_UNKNOWN_CLAIM_TYPE;
const Claim_ClaimType Claim_ClaimType_ClaimType_MAX = Claim_ClaimType_certificateType;
const int Claim_ClaimType_ClaimType_ARRAYSIZE = Claim_ClaimType_ClaimType_MAX + 1;
const ::google::protobuf::EnumDescriptor* Claim_ClaimType_descriptor();
inline const ::std::string& Claim_ClaimType_Name(Claim_ClaimType value) {
return ::google::protobuf::internal::NameOfEnum(
Claim_ClaimType_descriptor(), value);
}
inline bool Claim_ClaimType_Parse(
const ::std::string& name, Claim_ClaimType* value) {
return ::google::protobuf::internal::ParseNamedEnum<Claim_ClaimType>(
Claim_ClaimType_descriptor(), name, value);
}
// ===================================================================
class Claim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Claim) */ {
public:
Claim();
virtual ~Claim();
Claim(const Claim& from);
inline Claim& operator=(const Claim& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
Claim(Claim&& from) noexcept
: Claim() {
*this = ::std::move(from);
}
inline Claim& operator=(Claim&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Claim& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Claim* internal_default_instance() {
return reinterpret_cast<const Claim*>(
&_Claim_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(Claim* other);
friend void swap(Claim& a, Claim& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline Claim* New() const final {
return CreateMaybeMessage<Claim>(NULL);
}
Claim* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<Claim>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const Claim& from);
void MergeFrom(const Claim& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Claim* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef Claim_Version Version;
static const Version UNKNOWN_VERSION =
Claim_Version_UNKNOWN_VERSION;
static const Version _0_0_1 =
Claim_Version__0_0_1;
static inline bool Version_IsValid(int value) {
return Claim_Version_IsValid(value);
}
static const Version Version_MIN =
Claim_Version_Version_MIN;
static const Version Version_MAX =
Claim_Version_Version_MAX;
static const int Version_ARRAYSIZE =
Claim_Version_Version_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Version_descriptor() {
return Claim_Version_descriptor();
}
static inline const ::std::string& Version_Name(Version value) {
return Claim_Version_Name(value);
}
static inline bool Version_Parse(const ::std::string& name,
Version* value) {
return Claim_Version_Parse(name, value);
}
typedef Claim_ClaimType ClaimType;
static const ClaimType UNKNOWN_CLAIM_TYPE =
Claim_ClaimType_UNKNOWN_CLAIM_TYPE;
static const ClaimType streamType =
Claim_ClaimType_streamType;
static const ClaimType certificateType =
Claim_ClaimType_certificateType;
static inline bool ClaimType_IsValid(int value) {
return Claim_ClaimType_IsValid(value);
}
static const ClaimType ClaimType_MIN =
Claim_ClaimType_ClaimType_MIN;
static const ClaimType ClaimType_MAX =
Claim_ClaimType_ClaimType_MAX;
static const int ClaimType_ARRAYSIZE =
Claim_ClaimType_ClaimType_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
ClaimType_descriptor() {
return Claim_ClaimType_descriptor();
}
static inline const ::std::string& ClaimType_Name(ClaimType value) {
return Claim_ClaimType_Name(value);
}
static inline bool ClaimType_Parse(const ::std::string& name,
ClaimType* value) {
return Claim_ClaimType_Parse(name, value);
}
// accessors -------------------------------------------------------
// optional .pb.Stream stream = 3;
bool has_stream() const;
void clear_stream();
static const int kStreamFieldNumber = 3;
private:
const ::pb::Stream& _internal_stream() const;
public:
const ::pb::Stream& stream() const;
::pb::Stream* release_stream();
::pb::Stream* mutable_stream();
void set_allocated_stream(::pb::Stream* stream);
// optional .pb.Certificate certificate = 4;
bool has_certificate() const;
void clear_certificate();
static const int kCertificateFieldNumber = 4;
private:
const ::pb::Certificate& _internal_certificate() const;
public:
const ::pb::Certificate& certificate() const;
::pb::Certificate* release_certificate();
::pb::Certificate* mutable_certificate();
void set_allocated_certificate(::pb::Certificate* certificate);
// optional .pb.Signature publisherSignature = 5;
bool has_publishersignature() const;
void clear_publishersignature();
static const int kPublisherSignatureFieldNumber = 5;
private:
const ::pb::Signature& _internal_publishersignature() const;
public:
const ::pb::Signature& publishersignature() const;
::pb::Signature* release_publishersignature();
::pb::Signature* mutable_publishersignature();
void set_allocated_publishersignature(::pb::Signature* publishersignature);
// required .pb.Claim.Version version = 1;
bool has_version() const;
void clear_version();
static const int kVersionFieldNumber = 1;
::pb::Claim_Version version() const;
void set_version(::pb::Claim_Version value);
// required .pb.Claim.ClaimType claimType = 2;
bool has_claimtype() const;
void clear_claimtype();
static const int kClaimTypeFieldNumber = 2;
::pb::Claim_ClaimType claimtype() const;
void set_claimtype(::pb::Claim_ClaimType value);
// @@protoc_insertion_point(class_scope:pb.Claim)
private:
void set_has_version();
void clear_has_version();
void set_has_claimtype();
void clear_has_claimtype();
void set_has_stream();
void clear_has_stream();
void set_has_certificate();
void clear_has_certificate();
void set_has_publishersignature();
void clear_has_publishersignature();
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::pb::Stream* stream_;
::pb::Certificate* certificate_;
::pb::Signature* publishersignature_;
int version_;
int claimtype_;
friend struct ::protobuf_claim_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Claim
// required .pb.Claim.Version version = 1;
inline bool Claim::has_version() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Claim::set_has_version() {
_has_bits_[0] |= 0x00000008u;
}
inline void Claim::clear_has_version() {
_has_bits_[0] &= ~0x00000008u;
}
inline void Claim::clear_version() {
version_ = 0;
clear_has_version();
}
inline ::pb::Claim_Version Claim::version() const {
// @@protoc_insertion_point(field_get:pb.Claim.version)
return static_cast< ::pb::Claim_Version >(version_);
}
inline void Claim::set_version(::pb::Claim_Version value) {
assert(::pb::Claim_Version_IsValid(value));
set_has_version();
version_ = value;
// @@protoc_insertion_point(field_set:pb.Claim.version)
}
// required .pb.Claim.ClaimType claimType = 2;
inline bool Claim::has_claimtype() const {
return (_has_bits_[0] & 0x00000010u) != 0;
}
inline void Claim::set_has_claimtype() {
_has_bits_[0] |= 0x00000010u;
}
inline void Claim::clear_has_claimtype() {
_has_bits_[0] &= ~0x00000010u;
}
inline void Claim::clear_claimtype() {
claimtype_ = 0;
clear_has_claimtype();
}
inline ::pb::Claim_ClaimType Claim::claimtype() const {
// @@protoc_insertion_point(field_get:pb.Claim.claimType)
return static_cast< ::pb::Claim_ClaimType >(claimtype_);
}
inline void Claim::set_claimtype(::pb::Claim_ClaimType value) {
assert(::pb::Claim_ClaimType_IsValid(value));
set_has_claimtype();
claimtype_ = value;
// @@protoc_insertion_point(field_set:pb.Claim.claimType)
}
// optional .pb.Stream stream = 3;
inline bool Claim::has_stream() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Claim::set_has_stream() {
_has_bits_[0] |= 0x00000001u;
}
inline void Claim::clear_has_stream() {
_has_bits_[0] &= ~0x00000001u;
}
inline const ::pb::Stream& Claim::_internal_stream() const {
return *stream_;
}
inline const ::pb::Stream& Claim::stream() const {
const ::pb::Stream* p = stream_;
// @@protoc_insertion_point(field_get:pb.Claim.stream)
return p != NULL ? *p : *reinterpret_cast<const ::pb::Stream*>(
&::pb::_Stream_default_instance_);
}
inline ::pb::Stream* Claim::release_stream() {
// @@protoc_insertion_point(field_release:pb.Claim.stream)
clear_has_stream();
::pb::Stream* temp = stream_;
stream_ = NULL;
return temp;
}
inline ::pb::Stream* Claim::mutable_stream() {
set_has_stream();
if (stream_ == NULL) {
auto* p = CreateMaybeMessage<::pb::Stream>(GetArenaNoVirtual());
stream_ = p;
}
// @@protoc_insertion_point(field_mutable:pb.Claim.stream)
return stream_;
}
inline void Claim::set_allocated_stream(::pb::Stream* stream) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(stream_);
}
if (stream) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
stream = ::google::protobuf::internal::GetOwnedMessage(
message_arena, stream, submessage_arena);
}
set_has_stream();
} else {
clear_has_stream();
}
stream_ = stream;
// @@protoc_insertion_point(field_set_allocated:pb.Claim.stream)
}
// optional .pb.Certificate certificate = 4;
inline bool Claim::has_certificate() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Claim::set_has_certificate() {
_has_bits_[0] |= 0x00000002u;
}
inline void Claim::clear_has_certificate() {
_has_bits_[0] &= ~0x00000002u;
}
inline const ::pb::Certificate& Claim::_internal_certificate() const {
return *certificate_;
}
inline const ::pb::Certificate& Claim::certificate() const {
const ::pb::Certificate* p = certificate_;
// @@protoc_insertion_point(field_get:pb.Claim.certificate)
return p != NULL ? *p : *reinterpret_cast<const ::pb::Certificate*>(
&::pb::_Certificate_default_instance_);
}
inline ::pb::Certificate* Claim::release_certificate() {
// @@protoc_insertion_point(field_release:pb.Claim.certificate)
clear_has_certificate();
::pb::Certificate* temp = certificate_;
certificate_ = NULL;
return temp;
}
inline ::pb::Certificate* Claim::mutable_certificate() {
set_has_certificate();
if (certificate_ == NULL) {
auto* p = CreateMaybeMessage<::pb::Certificate>(GetArenaNoVirtual());
certificate_ = p;
}
// @@protoc_insertion_point(field_mutable:pb.Claim.certificate)
return certificate_;
}
inline void Claim::set_allocated_certificate(::pb::Certificate* certificate) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(certificate_);
}
if (certificate) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
certificate = ::google::protobuf::internal::GetOwnedMessage(
message_arena, certificate, submessage_arena);
}
set_has_certificate();
} else {
clear_has_certificate();
}
certificate_ = certificate;
// @@protoc_insertion_point(field_set_allocated:pb.Claim.certificate)
}
// optional .pb.Signature publisherSignature = 5;
inline bool Claim::has_publishersignature() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Claim::set_has_publishersignature() {
_has_bits_[0] |= 0x00000004u;
}
inline void Claim::clear_has_publishersignature() {
_has_bits_[0] &= ~0x00000004u;
}
inline const ::pb::Signature& Claim::_internal_publishersignature() const {
return *publishersignature_;
}
inline const ::pb::Signature& Claim::publishersignature() const {
const ::pb::Signature* p = publishersignature_;
// @@protoc_insertion_point(field_get:pb.Claim.publisherSignature)
return p != NULL ? *p : *reinterpret_cast<const ::pb::Signature*>(
&::pb::_Signature_default_instance_);
}
inline ::pb::Signature* Claim::release_publishersignature() {
// @@protoc_insertion_point(field_release:pb.Claim.publisherSignature)
clear_has_publishersignature();
::pb::Signature* temp = publishersignature_;
publishersignature_ = NULL;
return temp;
}
inline ::pb::Signature* Claim::mutable_publishersignature() {
set_has_publishersignature();
if (publishersignature_ == NULL) {
auto* p = CreateMaybeMessage<::pb::Signature>(GetArenaNoVirtual());
publishersignature_ = p;
}
// @@protoc_insertion_point(field_mutable:pb.Claim.publisherSignature)
return publishersignature_;
}
inline void Claim::set_allocated_publishersignature(::pb::Signature* publishersignature) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(publishersignature_);
}
if (publishersignature) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
publishersignature = ::google::protobuf::internal::GetOwnedMessage(
message_arena, publishersignature, submessage_arena);
}
set_has_publishersignature();
} else {
clear_has_publishersignature();
}
publishersignature_ = publishersignature;
// @@protoc_insertion_point(field_set_allocated:pb.Claim.publisherSignature)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::pb::Claim_Version> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Claim_Version>() {
return ::pb::Claim_Version_descriptor();
}
template <> struct is_proto_enum< ::pb::Claim_ClaimType> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Claim_ClaimType>() {
return ::pb::Claim_ClaimType_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_claim_2eproto

577
cpp/fee.pb.cc Normal file
View file

@ -0,0 +1,577 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: fee.proto
#include "fee.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace pb {
class FeeDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Fee>
_instance;
} _Fee_default_instance_;
} // namespace pb
namespace protobuf_fee_2eproto {
static void InitDefaultsFee() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::pb::_Fee_default_instance_;
new (ptr) ::pb::Fee();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::pb::Fee::InitAsDefaultInstance();
}
::google::protobuf::internal::SCCInfo<0> scc_info_Fee =
{{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFee}, {}};
void InitDefaults() {
::google::protobuf::internal::InitSCC(&scc_info_Fee.base);
}
::google::protobuf::Metadata file_level_metadata[1];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, currency_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, address_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Fee, amount_),
1,
2,
0,
3,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 9, sizeof(::pb::Fee)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::pb::_Fee_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
AssignDescriptors(
"fee.proto", schemas, file_default_instances, TableStruct::offsets,
file_level_metadata, file_level_enum_descriptors, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\tfee.proto\022\002pb\"\325\001\n\003Fee\022 \n\007version\030\001 \002(\016"
"2\017.pb.Fee.Version\022\"\n\010currency\030\002 \002(\0162\020.pb"
".Fee.Currency\022\017\n\007address\030\003 \002(\014\022\016\n\006amount"
"\030\004 \002(\002\"*\n\007Version\022\023\n\017UNKNOWN_VERSION\020\000\022\n"
"\n\006_0_0_1\020\001\";\n\010Currency\022\024\n\020UNKNOWN_CURREN"
"CY\020\000\022\007\n\003LBC\020\001\022\007\n\003BTC\020\002\022\007\n\003USD\020\003"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 231);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"fee.proto", &protobuf_RegisterTypes);
}
void AddDescriptors() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_fee_2eproto
namespace pb {
const ::google::protobuf::EnumDescriptor* Fee_Version_descriptor() {
protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_fee_2eproto::file_level_enum_descriptors[0];
}
bool Fee_Version_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Fee_Version Fee::UNKNOWN_VERSION;
const Fee_Version Fee::_0_0_1;
const Fee_Version Fee::Version_MIN;
const Fee_Version Fee::Version_MAX;
const int Fee::Version_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* Fee_Currency_descriptor() {
protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_fee_2eproto::file_level_enum_descriptors[1];
}
bool Fee_Currency_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Fee_Currency Fee::UNKNOWN_CURRENCY;
const Fee_Currency Fee::LBC;
const Fee_Currency Fee::BTC;
const Fee_Currency Fee::USD;
const Fee_Currency Fee::Currency_MIN;
const Fee_Currency Fee::Currency_MAX;
const int Fee::Currency_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
// ===================================================================
void Fee::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Fee::kVersionFieldNumber;
const int Fee::kCurrencyFieldNumber;
const int Fee::kAddressFieldNumber;
const int Fee::kAmountFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Fee::Fee()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
::google::protobuf::internal::InitSCC(
&protobuf_fee_2eproto::scc_info_Fee.base);
SharedCtor();
// @@protoc_insertion_point(constructor:pb.Fee)
}
Fee::Fee(const Fee& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
address_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_address()) {
address_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.address_);
}
::memcpy(&version_, &from.version_,
static_cast<size_t>(reinterpret_cast<char*>(&amount_) -
reinterpret_cast<char*>(&version_)) + sizeof(amount_));
// @@protoc_insertion_point(copy_constructor:pb.Fee)
}
void Fee::SharedCtor() {
address_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&amount_) -
reinterpret_cast<char*>(&version_)) + sizeof(amount_));
}
Fee::~Fee() {
// @@protoc_insertion_point(destructor:pb.Fee)
SharedDtor();
}
void Fee::SharedDtor() {
address_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void Fee::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Fee::descriptor() {
::protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_fee_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Fee& Fee::default_instance() {
::google::protobuf::internal::InitSCC(&protobuf_fee_2eproto::scc_info_Fee.base);
return *internal_default_instance();
}
void Fee::Clear() {
// @@protoc_insertion_point(message_clear_start:pb.Fee)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 0x00000001u) {
address_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 14u) {
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&amount_) -
reinterpret_cast<char*>(&version_)) + sizeof(amount_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
bool Fee::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:pb.Fee)
for (;;) {
::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .pb.Fee.Version version = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Fee_Version_IsValid(value)) {
set_version(static_cast< ::pb::Fee_Version >(value));
} else {
mutable_unknown_fields()->AddVarint(
1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required .pb.Fee.Currency currency = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Fee_Currency_IsValid(value)) {
set_currency(static_cast< ::pb::Fee_Currency >(value));
} else {
mutable_unknown_fields()->AddVarint(
2, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required bytes address = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_address()));
} else {
goto handle_unusual;
}
break;
}
// required float amount = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
set_has_amount();
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &amount_)));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:pb.Fee)
return true;
failure:
// @@protoc_insertion_point(parse_failure:pb.Fee)
return false;
#undef DO_
}
void Fee::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:pb.Fee)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Fee.Version version = 1;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->version(), output);
}
// required .pb.Fee.Currency currency = 2;
if (cached_has_bits & 0x00000004u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->currency(), output);
}
// required bytes address = 3;
if (cached_has_bits & 0x00000001u) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
3, this->address(), output);
}
// required float amount = 4;
if (cached_has_bits & 0x00000008u) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->amount(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:pb.Fee)
}
::google::protobuf::uint8* Fee::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:pb.Fee)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Fee.Version version = 1;
if (cached_has_bits & 0x00000002u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->version(), target);
}
// required .pb.Fee.Currency currency = 2;
if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->currency(), target);
}
// required bytes address = 3;
if (cached_has_bits & 0x00000001u) {
target =
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
3, this->address(), target);
}
// required float amount = 4;
if (cached_has_bits & 0x00000008u) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->amount(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:pb.Fee)
return target;
}
size_t Fee::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Fee)
size_t total_size = 0;
if (has_address()) {
// required bytes address = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->address());
}
if (has_version()) {
// required .pb.Fee.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
}
if (has_currency()) {
// required .pb.Fee.Currency currency = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->currency());
}
if (has_amount()) {
// required float amount = 4;
total_size += 1 + 4;
}
return total_size;
}
size_t Fee::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:pb.Fee)
size_t total_size = 0;
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present.
// required bytes address = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->address());
// required .pb.Fee.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
// required .pb.Fee.Currency currency = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->currency());
// required float amount = 4;
total_size += 1 + 4;
} else {
total_size += RequiredFieldsByteSizeFallback();
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Fee::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:pb.Fee)
GOOGLE_DCHECK_NE(&from, this);
const Fee* source =
::google::protobuf::internal::DynamicCastToGenerated<const Fee>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Fee)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Fee)
MergeFrom(*source);
}
}
void Fee::MergeFrom(const Fee& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:pb.Fee)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 15u) {
if (cached_has_bits & 0x00000001u) {
set_has_address();
address_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.address_);
}
if (cached_has_bits & 0x00000002u) {
version_ = from.version_;
}
if (cached_has_bits & 0x00000004u) {
currency_ = from.currency_;
}
if (cached_has_bits & 0x00000008u) {
amount_ = from.amount_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void Fee::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:pb.Fee)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Fee::CopyFrom(const Fee& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:pb.Fee)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Fee::IsInitialized() const {
if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
return true;
}
void Fee::Swap(Fee* other) {
if (other == this) return;
InternalSwap(other);
}
void Fee::InternalSwap(Fee* other) {
using std::swap;
address_.Swap(&other->address_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(version_, other->version_);
swap(currency_, other->currency_);
swap(amount_, other->amount_);
swap(_has_bits_[0], other->_has_bits_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
}
::google::protobuf::Metadata Fee::GetMetadata() const {
protobuf_fee_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_fee_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Fee* Arena::CreateMaybeMessage< ::pb::Fee >(Arena* arena) {
return Arena::CreateInternal< ::pb::Fee >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)

490
cpp/fee.pb.h Normal file
View file

@ -0,0 +1,490 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: fee.proto
#ifndef PROTOBUF_INCLUDED_fee_2eproto
#define PROTOBUF_INCLUDED_fee_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006000
#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 3006000 < GOOGLE_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/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_fee_2eproto
namespace protobuf_fee_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_fee_2eproto
namespace pb {
class Fee;
class FeeDefaultTypeInternal;
extern FeeDefaultTypeInternal _Fee_default_instance_;
} // namespace pb
namespace google {
namespace protobuf {
template<> ::pb::Fee* Arena::CreateMaybeMessage<::pb::Fee>(Arena*);
} // namespace protobuf
} // namespace google
namespace pb {
enum Fee_Version {
Fee_Version_UNKNOWN_VERSION = 0,
Fee_Version__0_0_1 = 1
};
bool Fee_Version_IsValid(int value);
const Fee_Version Fee_Version_Version_MIN = Fee_Version_UNKNOWN_VERSION;
const Fee_Version Fee_Version_Version_MAX = Fee_Version__0_0_1;
const int Fee_Version_Version_ARRAYSIZE = Fee_Version_Version_MAX + 1;
const ::google::protobuf::EnumDescriptor* Fee_Version_descriptor();
inline const ::std::string& Fee_Version_Name(Fee_Version value) {
return ::google::protobuf::internal::NameOfEnum(
Fee_Version_descriptor(), value);
}
inline bool Fee_Version_Parse(
const ::std::string& name, Fee_Version* value) {
return ::google::protobuf::internal::ParseNamedEnum<Fee_Version>(
Fee_Version_descriptor(), name, value);
}
enum Fee_Currency {
Fee_Currency_UNKNOWN_CURRENCY = 0,
Fee_Currency_LBC = 1,
Fee_Currency_BTC = 2,
Fee_Currency_USD = 3
};
bool Fee_Currency_IsValid(int value);
const Fee_Currency Fee_Currency_Currency_MIN = Fee_Currency_UNKNOWN_CURRENCY;
const Fee_Currency Fee_Currency_Currency_MAX = Fee_Currency_USD;
const int Fee_Currency_Currency_ARRAYSIZE = Fee_Currency_Currency_MAX + 1;
const ::google::protobuf::EnumDescriptor* Fee_Currency_descriptor();
inline const ::std::string& Fee_Currency_Name(Fee_Currency value) {
return ::google::protobuf::internal::NameOfEnum(
Fee_Currency_descriptor(), value);
}
inline bool Fee_Currency_Parse(
const ::std::string& name, Fee_Currency* value) {
return ::google::protobuf::internal::ParseNamedEnum<Fee_Currency>(
Fee_Currency_descriptor(), name, value);
}
// ===================================================================
class Fee : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Fee) */ {
public:
Fee();
virtual ~Fee();
Fee(const Fee& from);
inline Fee& operator=(const Fee& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
Fee(Fee&& from) noexcept
: Fee() {
*this = ::std::move(from);
}
inline Fee& operator=(Fee&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Fee& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Fee* internal_default_instance() {
return reinterpret_cast<const Fee*>(
&_Fee_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(Fee* other);
friend void swap(Fee& a, Fee& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline Fee* New() const final {
return CreateMaybeMessage<Fee>(NULL);
}
Fee* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<Fee>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const Fee& from);
void MergeFrom(const Fee& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Fee* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef Fee_Version Version;
static const Version UNKNOWN_VERSION =
Fee_Version_UNKNOWN_VERSION;
static const Version _0_0_1 =
Fee_Version__0_0_1;
static inline bool Version_IsValid(int value) {
return Fee_Version_IsValid(value);
}
static const Version Version_MIN =
Fee_Version_Version_MIN;
static const Version Version_MAX =
Fee_Version_Version_MAX;
static const int Version_ARRAYSIZE =
Fee_Version_Version_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Version_descriptor() {
return Fee_Version_descriptor();
}
static inline const ::std::string& Version_Name(Version value) {
return Fee_Version_Name(value);
}
static inline bool Version_Parse(const ::std::string& name,
Version* value) {
return Fee_Version_Parse(name, value);
}
typedef Fee_Currency Currency;
static const Currency UNKNOWN_CURRENCY =
Fee_Currency_UNKNOWN_CURRENCY;
static const Currency LBC =
Fee_Currency_LBC;
static const Currency BTC =
Fee_Currency_BTC;
static const Currency USD =
Fee_Currency_USD;
static inline bool Currency_IsValid(int value) {
return Fee_Currency_IsValid(value);
}
static const Currency Currency_MIN =
Fee_Currency_Currency_MIN;
static const Currency Currency_MAX =
Fee_Currency_Currency_MAX;
static const int Currency_ARRAYSIZE =
Fee_Currency_Currency_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Currency_descriptor() {
return Fee_Currency_descriptor();
}
static inline const ::std::string& Currency_Name(Currency value) {
return Fee_Currency_Name(value);
}
static inline bool Currency_Parse(const ::std::string& name,
Currency* value) {
return Fee_Currency_Parse(name, value);
}
// accessors -------------------------------------------------------
// required bytes address = 3;
bool has_address() const;
void clear_address();
static const int kAddressFieldNumber = 3;
const ::std::string& address() const;
void set_address(const ::std::string& value);
#if LANG_CXX11
void set_address(::std::string&& value);
#endif
void set_address(const char* value);
void set_address(const void* value, size_t size);
::std::string* mutable_address();
::std::string* release_address();
void set_allocated_address(::std::string* address);
// required .pb.Fee.Version version = 1;
bool has_version() const;
void clear_version();
static const int kVersionFieldNumber = 1;
::pb::Fee_Version version() const;
void set_version(::pb::Fee_Version value);
// required .pb.Fee.Currency currency = 2;
bool has_currency() const;
void clear_currency();
static const int kCurrencyFieldNumber = 2;
::pb::Fee_Currency currency() const;
void set_currency(::pb::Fee_Currency value);
// required float amount = 4;
bool has_amount() const;
void clear_amount();
static const int kAmountFieldNumber = 4;
float amount() const;
void set_amount(float value);
// @@protoc_insertion_point(class_scope:pb.Fee)
private:
void set_has_version();
void clear_has_version();
void set_has_currency();
void clear_has_currency();
void set_has_address();
void clear_has_address();
void set_has_amount();
void clear_has_amount();
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr address_;
int version_;
int currency_;
float amount_;
friend struct ::protobuf_fee_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Fee
// required .pb.Fee.Version version = 1;
inline bool Fee::has_version() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Fee::set_has_version() {
_has_bits_[0] |= 0x00000002u;
}
inline void Fee::clear_has_version() {
_has_bits_[0] &= ~0x00000002u;
}
inline void Fee::clear_version() {
version_ = 0;
clear_has_version();
}
inline ::pb::Fee_Version Fee::version() const {
// @@protoc_insertion_point(field_get:pb.Fee.version)
return static_cast< ::pb::Fee_Version >(version_);
}
inline void Fee::set_version(::pb::Fee_Version value) {
assert(::pb::Fee_Version_IsValid(value));
set_has_version();
version_ = value;
// @@protoc_insertion_point(field_set:pb.Fee.version)
}
// required .pb.Fee.Currency currency = 2;
inline bool Fee::has_currency() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Fee::set_has_currency() {
_has_bits_[0] |= 0x00000004u;
}
inline void Fee::clear_has_currency() {
_has_bits_[0] &= ~0x00000004u;
}
inline void Fee::clear_currency() {
currency_ = 0;
clear_has_currency();
}
inline ::pb::Fee_Currency Fee::currency() const {
// @@protoc_insertion_point(field_get:pb.Fee.currency)
return static_cast< ::pb::Fee_Currency >(currency_);
}
inline void Fee::set_currency(::pb::Fee_Currency value) {
assert(::pb::Fee_Currency_IsValid(value));
set_has_currency();
currency_ = value;
// @@protoc_insertion_point(field_set:pb.Fee.currency)
}
// required bytes address = 3;
inline bool Fee::has_address() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Fee::set_has_address() {
_has_bits_[0] |= 0x00000001u;
}
inline void Fee::clear_has_address() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Fee::clear_address() {
address_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_address();
}
inline const ::std::string& Fee::address() const {
// @@protoc_insertion_point(field_get:pb.Fee.address)
return address_.GetNoArena();
}
inline void Fee::set_address(const ::std::string& value) {
set_has_address();
address_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:pb.Fee.address)
}
#if LANG_CXX11
inline void Fee::set_address(::std::string&& value) {
set_has_address();
address_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:pb.Fee.address)
}
#endif
inline void Fee::set_address(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_address();
address_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:pb.Fee.address)
}
inline void Fee::set_address(const void* value, size_t size) {
set_has_address();
address_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:pb.Fee.address)
}
inline ::std::string* Fee::mutable_address() {
set_has_address();
// @@protoc_insertion_point(field_mutable:pb.Fee.address)
return address_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* Fee::release_address() {
// @@protoc_insertion_point(field_release:pb.Fee.address)
if (!has_address()) {
return NULL;
}
clear_has_address();
return address_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void Fee::set_allocated_address(::std::string* address) {
if (address != NULL) {
set_has_address();
} else {
clear_has_address();
}
address_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), address);
// @@protoc_insertion_point(field_set_allocated:pb.Fee.address)
}
// required float amount = 4;
inline bool Fee::has_amount() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Fee::set_has_amount() {
_has_bits_[0] |= 0x00000008u;
}
inline void Fee::clear_has_amount() {
_has_bits_[0] &= ~0x00000008u;
}
inline void Fee::clear_amount() {
amount_ = 0;
clear_has_amount();
}
inline float Fee::amount() const {
// @@protoc_insertion_point(field_get:pb.Fee.amount)
return amount_;
}
inline void Fee::set_amount(float value) {
set_has_amount();
amount_ = value;
// @@protoc_insertion_point(field_set:pb.Fee.amount)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::pb::Fee_Version> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Fee_Version>() {
return ::pb::Fee_Version_descriptor();
}
template <> struct is_proto_enum< ::pb::Fee_Currency> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Fee_Currency>() {
return ::pb::Fee_Currency_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_fee_2eproto

1456
cpp/metadata.pb.cc Normal file

File diff suppressed because it is too large Load diff

1616
cpp/metadata.pb.h Normal file

File diff suppressed because it is too large Load diff

571
cpp/signature.pb.cc Normal file
View file

@ -0,0 +1,571 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: signature.proto
#include "signature.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace pb {
class SignatureDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Signature>
_instance;
} _Signature_default_instance_;
} // namespace pb
namespace protobuf_signature_2eproto {
static void InitDefaultsSignature() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::pb::_Signature_default_instance_;
new (ptr) ::pb::Signature();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::pb::Signature::InitAsDefaultInstance();
}
::google::protobuf::internal::SCCInfo<0> scc_info_Signature =
{{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSignature}, {}};
void InitDefaults() {
::google::protobuf::internal::InitSCC(&scc_info_Signature.base);
}
::google::protobuf::Metadata file_level_metadata[1];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, signaturetype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, signature_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Signature, certificateid_),
2,
3,
0,
1,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 9, sizeof(::pb::Signature)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::pb::_Signature_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
AssignDescriptors(
"signature.proto", schemas, file_default_instances, TableStruct::offsets,
file_level_metadata, file_level_enum_descriptors, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\017signature.proto\022\002pb\032\021certificate.proto"
"\"\255\001\n\tSignature\022&\n\007version\030\001 \002(\0162\025.pb.Sig"
"nature.Version\022\"\n\rsignatureType\030\002 \002(\0162\013."
"pb.KeyType\022\021\n\tsignature\030\003 \002(\014\022\025\n\rcertifi"
"cateId\030\004 \002(\014\"*\n\007Version\022\023\n\017UNKNOWN_VERSI"
"ON\020\000\022\n\n\006_0_0_1\020\001"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 216);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"signature.proto", &protobuf_RegisterTypes);
::protobuf_certificate_2eproto::AddDescriptors();
}
void AddDescriptors() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_signature_2eproto
namespace pb {
const ::google::protobuf::EnumDescriptor* Signature_Version_descriptor() {
protobuf_signature_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_signature_2eproto::file_level_enum_descriptors[0];
}
bool Signature_Version_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Signature_Version Signature::UNKNOWN_VERSION;
const Signature_Version Signature::_0_0_1;
const Signature_Version Signature::Version_MIN;
const Signature_Version Signature::Version_MAX;
const int Signature::Version_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
// ===================================================================
void Signature::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Signature::kVersionFieldNumber;
const int Signature::kSignatureTypeFieldNumber;
const int Signature::kSignatureFieldNumber;
const int Signature::kCertificateIdFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Signature::Signature()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
::google::protobuf::internal::InitSCC(
&protobuf_signature_2eproto::scc_info_Signature.base);
SharedCtor();
// @@protoc_insertion_point(constructor:pb.Signature)
}
Signature::Signature(const Signature& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
signature_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_signature()) {
signature_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.signature_);
}
certificateid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_certificateid()) {
certificateid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.certificateid_);
}
::memcpy(&version_, &from.version_,
static_cast<size_t>(reinterpret_cast<char*>(&signaturetype_) -
reinterpret_cast<char*>(&version_)) + sizeof(signaturetype_));
// @@protoc_insertion_point(copy_constructor:pb.Signature)
}
void Signature::SharedCtor() {
signature_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
certificateid_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&signaturetype_) -
reinterpret_cast<char*>(&version_)) + sizeof(signaturetype_));
}
Signature::~Signature() {
// @@protoc_insertion_point(destructor:pb.Signature)
SharedDtor();
}
void Signature::SharedDtor() {
signature_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
certificateid_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void Signature::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Signature::descriptor() {
::protobuf_signature_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_signature_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Signature& Signature::default_instance() {
::google::protobuf::internal::InitSCC(&protobuf_signature_2eproto::scc_info_Signature.base);
return *internal_default_instance();
}
void Signature::Clear() {
// @@protoc_insertion_point(message_clear_start:pb.Signature)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 3u) {
if (cached_has_bits & 0x00000001u) {
signature_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 0x00000002u) {
certificateid_.ClearNonDefaultToEmptyNoArena();
}
}
if (cached_has_bits & 12u) {
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&signaturetype_) -
reinterpret_cast<char*>(&version_)) + sizeof(signaturetype_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
bool Signature::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:pb.Signature)
for (;;) {
::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .pb.Signature.Version version = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Signature_Version_IsValid(value)) {
set_version(static_cast< ::pb::Signature_Version >(value));
} else {
mutable_unknown_fields()->AddVarint(
1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required .pb.KeyType signatureType = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::KeyType_IsValid(value)) {
set_signaturetype(static_cast< ::pb::KeyType >(value));
} else {
mutable_unknown_fields()->AddVarint(
2, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required bytes signature = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_signature()));
} else {
goto handle_unusual;
}
break;
}
// required bytes certificateId = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_certificateid()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:pb.Signature)
return true;
failure:
// @@protoc_insertion_point(parse_failure:pb.Signature)
return false;
#undef DO_
}
void Signature::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:pb.Signature)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Signature.Version version = 1;
if (cached_has_bits & 0x00000004u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->version(), output);
}
// required .pb.KeyType signatureType = 2;
if (cached_has_bits & 0x00000008u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->signaturetype(), output);
}
// required bytes signature = 3;
if (cached_has_bits & 0x00000001u) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
3, this->signature(), output);
}
// required bytes certificateId = 4;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
4, this->certificateid(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:pb.Signature)
}
::google::protobuf::uint8* Signature::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:pb.Signature)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Signature.Version version = 1;
if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->version(), target);
}
// required .pb.KeyType signatureType = 2;
if (cached_has_bits & 0x00000008u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->signaturetype(), target);
}
// required bytes signature = 3;
if (cached_has_bits & 0x00000001u) {
target =
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
3, this->signature(), target);
}
// required bytes certificateId = 4;
if (cached_has_bits & 0x00000002u) {
target =
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
4, this->certificateid(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:pb.Signature)
return target;
}
size_t Signature::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Signature)
size_t total_size = 0;
if (has_signature()) {
// required bytes signature = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->signature());
}
if (has_certificateid()) {
// required bytes certificateId = 4;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->certificateid());
}
if (has_version()) {
// required .pb.Signature.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
}
if (has_signaturetype()) {
// required .pb.KeyType signatureType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->signaturetype());
}
return total_size;
}
size_t Signature::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:pb.Signature)
size_t total_size = 0;
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present.
// required bytes signature = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->signature());
// required bytes certificateId = 4;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->certificateid());
// required .pb.Signature.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
// required .pb.KeyType signatureType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->signaturetype());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Signature::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:pb.Signature)
GOOGLE_DCHECK_NE(&from, this);
const Signature* source =
::google::protobuf::internal::DynamicCastToGenerated<const Signature>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Signature)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Signature)
MergeFrom(*source);
}
}
void Signature::MergeFrom(const Signature& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:pb.Signature)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 15u) {
if (cached_has_bits & 0x00000001u) {
set_has_signature();
signature_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.signature_);
}
if (cached_has_bits & 0x00000002u) {
set_has_certificateid();
certificateid_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.certificateid_);
}
if (cached_has_bits & 0x00000004u) {
version_ = from.version_;
}
if (cached_has_bits & 0x00000008u) {
signaturetype_ = from.signaturetype_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void Signature::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:pb.Signature)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Signature::CopyFrom(const Signature& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:pb.Signature)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Signature::IsInitialized() const {
if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
return true;
}
void Signature::Swap(Signature* other) {
if (other == this) return;
InternalSwap(other);
}
void Signature::InternalSwap(Signature* other) {
using std::swap;
signature_.Swap(&other->signature_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
certificateid_.Swap(&other->certificateid_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(version_, other->version_);
swap(signaturetype_, other->signaturetype_);
swap(_has_bits_[0], other->_has_bits_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
}
::google::protobuf::Metadata Signature::GetMetadata() const {
protobuf_signature_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_signature_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Signature* Arena::CreateMaybeMessage< ::pb::Signature >(Arena* arena) {
return Arena::CreateInternal< ::pb::Signature >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)

485
cpp/signature.pb.h Normal file
View file

@ -0,0 +1,485 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: signature.proto
#ifndef PROTOBUF_INCLUDED_signature_2eproto
#define PROTOBUF_INCLUDED_signature_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006000
#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 3006000 < GOOGLE_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/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
#include "certificate.pb.h"
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_signature_2eproto
namespace protobuf_signature_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_signature_2eproto
namespace pb {
class Signature;
class SignatureDefaultTypeInternal;
extern SignatureDefaultTypeInternal _Signature_default_instance_;
} // namespace pb
namespace google {
namespace protobuf {
template<> ::pb::Signature* Arena::CreateMaybeMessage<::pb::Signature>(Arena*);
} // namespace protobuf
} // namespace google
namespace pb {
enum Signature_Version {
Signature_Version_UNKNOWN_VERSION = 0,
Signature_Version__0_0_1 = 1
};
bool Signature_Version_IsValid(int value);
const Signature_Version Signature_Version_Version_MIN = Signature_Version_UNKNOWN_VERSION;
const Signature_Version Signature_Version_Version_MAX = Signature_Version__0_0_1;
const int Signature_Version_Version_ARRAYSIZE = Signature_Version_Version_MAX + 1;
const ::google::protobuf::EnumDescriptor* Signature_Version_descriptor();
inline const ::std::string& Signature_Version_Name(Signature_Version value) {
return ::google::protobuf::internal::NameOfEnum(
Signature_Version_descriptor(), value);
}
inline bool Signature_Version_Parse(
const ::std::string& name, Signature_Version* value) {
return ::google::protobuf::internal::ParseNamedEnum<Signature_Version>(
Signature_Version_descriptor(), name, value);
}
// ===================================================================
class Signature : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Signature) */ {
public:
Signature();
virtual ~Signature();
Signature(const Signature& from);
inline Signature& operator=(const Signature& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
Signature(Signature&& from) noexcept
: Signature() {
*this = ::std::move(from);
}
inline Signature& operator=(Signature&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Signature& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Signature* internal_default_instance() {
return reinterpret_cast<const Signature*>(
&_Signature_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(Signature* other);
friend void swap(Signature& a, Signature& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline Signature* New() const final {
return CreateMaybeMessage<Signature>(NULL);
}
Signature* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<Signature>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const Signature& from);
void MergeFrom(const Signature& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Signature* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef Signature_Version Version;
static const Version UNKNOWN_VERSION =
Signature_Version_UNKNOWN_VERSION;
static const Version _0_0_1 =
Signature_Version__0_0_1;
static inline bool Version_IsValid(int value) {
return Signature_Version_IsValid(value);
}
static const Version Version_MIN =
Signature_Version_Version_MIN;
static const Version Version_MAX =
Signature_Version_Version_MAX;
static const int Version_ARRAYSIZE =
Signature_Version_Version_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Version_descriptor() {
return Signature_Version_descriptor();
}
static inline const ::std::string& Version_Name(Version value) {
return Signature_Version_Name(value);
}
static inline bool Version_Parse(const ::std::string& name,
Version* value) {
return Signature_Version_Parse(name, value);
}
// accessors -------------------------------------------------------
// required bytes signature = 3;
bool has_signature() const;
void clear_signature();
static const int kSignatureFieldNumber = 3;
const ::std::string& signature() const;
void set_signature(const ::std::string& value);
#if LANG_CXX11
void set_signature(::std::string&& value);
#endif
void set_signature(const char* value);
void set_signature(const void* value, size_t size);
::std::string* mutable_signature();
::std::string* release_signature();
void set_allocated_signature(::std::string* signature);
// required bytes certificateId = 4;
bool has_certificateid() const;
void clear_certificateid();
static const int kCertificateIdFieldNumber = 4;
const ::std::string& certificateid() const;
void set_certificateid(const ::std::string& value);
#if LANG_CXX11
void set_certificateid(::std::string&& value);
#endif
void set_certificateid(const char* value);
void set_certificateid(const void* value, size_t size);
::std::string* mutable_certificateid();
::std::string* release_certificateid();
void set_allocated_certificateid(::std::string* certificateid);
// required .pb.Signature.Version version = 1;
bool has_version() const;
void clear_version();
static const int kVersionFieldNumber = 1;
::pb::Signature_Version version() const;
void set_version(::pb::Signature_Version value);
// required .pb.KeyType signatureType = 2;
bool has_signaturetype() const;
void clear_signaturetype();
static const int kSignatureTypeFieldNumber = 2;
::pb::KeyType signaturetype() const;
void set_signaturetype(::pb::KeyType value);
// @@protoc_insertion_point(class_scope:pb.Signature)
private:
void set_has_version();
void clear_has_version();
void set_has_signaturetype();
void clear_has_signaturetype();
void set_has_signature();
void clear_has_signature();
void set_has_certificateid();
void clear_has_certificateid();
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr signature_;
::google::protobuf::internal::ArenaStringPtr certificateid_;
int version_;
int signaturetype_;
friend struct ::protobuf_signature_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Signature
// required .pb.Signature.Version version = 1;
inline bool Signature::has_version() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Signature::set_has_version() {
_has_bits_[0] |= 0x00000004u;
}
inline void Signature::clear_has_version() {
_has_bits_[0] &= ~0x00000004u;
}
inline void Signature::clear_version() {
version_ = 0;
clear_has_version();
}
inline ::pb::Signature_Version Signature::version() const {
// @@protoc_insertion_point(field_get:pb.Signature.version)
return static_cast< ::pb::Signature_Version >(version_);
}
inline void Signature::set_version(::pb::Signature_Version value) {
assert(::pb::Signature_Version_IsValid(value));
set_has_version();
version_ = value;
// @@protoc_insertion_point(field_set:pb.Signature.version)
}
// required .pb.KeyType signatureType = 2;
inline bool Signature::has_signaturetype() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Signature::set_has_signaturetype() {
_has_bits_[0] |= 0x00000008u;
}
inline void Signature::clear_has_signaturetype() {
_has_bits_[0] &= ~0x00000008u;
}
inline void Signature::clear_signaturetype() {
signaturetype_ = 0;
clear_has_signaturetype();
}
inline ::pb::KeyType Signature::signaturetype() const {
// @@protoc_insertion_point(field_get:pb.Signature.signatureType)
return static_cast< ::pb::KeyType >(signaturetype_);
}
inline void Signature::set_signaturetype(::pb::KeyType value) {
assert(::pb::KeyType_IsValid(value));
set_has_signaturetype();
signaturetype_ = value;
// @@protoc_insertion_point(field_set:pb.Signature.signatureType)
}
// required bytes signature = 3;
inline bool Signature::has_signature() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Signature::set_has_signature() {
_has_bits_[0] |= 0x00000001u;
}
inline void Signature::clear_has_signature() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Signature::clear_signature() {
signature_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_signature();
}
inline const ::std::string& Signature::signature() const {
// @@protoc_insertion_point(field_get:pb.Signature.signature)
return signature_.GetNoArena();
}
inline void Signature::set_signature(const ::std::string& value) {
set_has_signature();
signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:pb.Signature.signature)
}
#if LANG_CXX11
inline void Signature::set_signature(::std::string&& value) {
set_has_signature();
signature_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:pb.Signature.signature)
}
#endif
inline void Signature::set_signature(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_signature();
signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:pb.Signature.signature)
}
inline void Signature::set_signature(const void* value, size_t size) {
set_has_signature();
signature_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:pb.Signature.signature)
}
inline ::std::string* Signature::mutable_signature() {
set_has_signature();
// @@protoc_insertion_point(field_mutable:pb.Signature.signature)
return signature_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* Signature::release_signature() {
// @@protoc_insertion_point(field_release:pb.Signature.signature)
if (!has_signature()) {
return NULL;
}
clear_has_signature();
return signature_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void Signature::set_allocated_signature(::std::string* signature) {
if (signature != NULL) {
set_has_signature();
} else {
clear_has_signature();
}
signature_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), signature);
// @@protoc_insertion_point(field_set_allocated:pb.Signature.signature)
}
// required bytes certificateId = 4;
inline bool Signature::has_certificateid() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Signature::set_has_certificateid() {
_has_bits_[0] |= 0x00000002u;
}
inline void Signature::clear_has_certificateid() {
_has_bits_[0] &= ~0x00000002u;
}
inline void Signature::clear_certificateid() {
certificateid_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_certificateid();
}
inline const ::std::string& Signature::certificateid() const {
// @@protoc_insertion_point(field_get:pb.Signature.certificateId)
return certificateid_.GetNoArena();
}
inline void Signature::set_certificateid(const ::std::string& value) {
set_has_certificateid();
certificateid_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:pb.Signature.certificateId)
}
#if LANG_CXX11
inline void Signature::set_certificateid(::std::string&& value) {
set_has_certificateid();
certificateid_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:pb.Signature.certificateId)
}
#endif
inline void Signature::set_certificateid(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_certificateid();
certificateid_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:pb.Signature.certificateId)
}
inline void Signature::set_certificateid(const void* value, size_t size) {
set_has_certificateid();
certificateid_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:pb.Signature.certificateId)
}
inline ::std::string* Signature::mutable_certificateid() {
set_has_certificateid();
// @@protoc_insertion_point(field_mutable:pb.Signature.certificateId)
return certificateid_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* Signature::release_certificateid() {
// @@protoc_insertion_point(field_release:pb.Signature.certificateId)
if (!has_certificateid()) {
return NULL;
}
clear_has_certificateid();
return certificateid_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void Signature::set_allocated_certificateid(::std::string* certificateid) {
if (certificateid != NULL) {
set_has_certificateid();
} else {
clear_has_certificateid();
}
certificateid_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), certificateid);
// @@protoc_insertion_point(field_set_allocated:pb.Signature.certificateId)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::pb::Signature_Version> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Signature_Version>() {
return ::pb::Signature_Version_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_signature_2eproto

604
cpp/source.pb.cc Normal file
View file

@ -0,0 +1,604 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: source.proto
#include "source.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace pb {
class SourceDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Source>
_instance;
} _Source_default_instance_;
} // namespace pb
namespace protobuf_source_2eproto {
static void InitDefaultsSource() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::pb::_Source_default_instance_;
new (ptr) ::pb::Source();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::pb::Source::InitAsDefaultInstance();
}
::google::protobuf::internal::SCCInfo<0> scc_info_Source =
{{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsSource}, {}};
void InitDefaults() {
::google::protobuf::internal::InitSCC(&scc_info_Source.base);
}
::google::protobuf::Metadata file_level_metadata[1];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[2];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, sourcetype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, source_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Source, contenttype_),
2,
3,
0,
1,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 9, sizeof(::pb::Source)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::pb::_Source_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
AssignDescriptors(
"source.proto", schemas, file_default_instances, TableStruct::offsets,
file_level_metadata, file_level_enum_descriptors, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\014source.proto\022\002pb\"\344\001\n\006Source\022#\n\007version"
"\030\001 \002(\0162\022.pb.Source.Version\022*\n\nsourceType"
"\030\002 \002(\0162\026.pb.Source.SourceTypes\022\016\n\006source"
"\030\003 \002(\014\022\023\n\013contentType\030\004 \002(\t\"*\n\007Version\022\023"
"\n\017UNKNOWN_VERSION\020\000\022\n\n\006_0_0_1\020\001\"8\n\013Sourc"
"eTypes\022\027\n\023UNKNOWN_SOURCE_TYPE\020\000\022\020\n\014lbry_"
"sd_hash\020\001"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 249);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"source.proto", &protobuf_RegisterTypes);
}
void AddDescriptors() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_source_2eproto
namespace pb {
const ::google::protobuf::EnumDescriptor* Source_Version_descriptor() {
protobuf_source_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_source_2eproto::file_level_enum_descriptors[0];
}
bool Source_Version_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Source_Version Source::UNKNOWN_VERSION;
const Source_Version Source::_0_0_1;
const Source_Version Source::Version_MIN;
const Source_Version Source::Version_MAX;
const int Source::Version_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
const ::google::protobuf::EnumDescriptor* Source_SourceTypes_descriptor() {
protobuf_source_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_source_2eproto::file_level_enum_descriptors[1];
}
bool Source_SourceTypes_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Source_SourceTypes Source::UNKNOWN_SOURCE_TYPE;
const Source_SourceTypes Source::lbry_sd_hash;
const Source_SourceTypes Source::SourceTypes_MIN;
const Source_SourceTypes Source::SourceTypes_MAX;
const int Source::SourceTypes_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
// ===================================================================
void Source::InitAsDefaultInstance() {
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Source::kVersionFieldNumber;
const int Source::kSourceTypeFieldNumber;
const int Source::kSourceFieldNumber;
const int Source::kContentTypeFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Source::Source()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
::google::protobuf::internal::InitSCC(
&protobuf_source_2eproto::scc_info_Source.base);
SharedCtor();
// @@protoc_insertion_point(constructor:pb.Source)
}
Source::Source(const Source& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_source()) {
source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
}
contenttype_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (from.has_contenttype()) {
contenttype_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.contenttype_);
}
::memcpy(&version_, &from.version_,
static_cast<size_t>(reinterpret_cast<char*>(&sourcetype_) -
reinterpret_cast<char*>(&version_)) + sizeof(sourcetype_));
// @@protoc_insertion_point(copy_constructor:pb.Source)
}
void Source::SharedCtor() {
source_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
contenttype_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&sourcetype_) -
reinterpret_cast<char*>(&version_)) + sizeof(sourcetype_));
}
Source::~Source() {
// @@protoc_insertion_point(destructor:pb.Source)
SharedDtor();
}
void Source::SharedDtor() {
source_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
contenttype_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
void Source::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Source::descriptor() {
::protobuf_source_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_source_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Source& Source::default_instance() {
::google::protobuf::internal::InitSCC(&protobuf_source_2eproto::scc_info_Source.base);
return *internal_default_instance();
}
void Source::Clear() {
// @@protoc_insertion_point(message_clear_start:pb.Source)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 3u) {
if (cached_has_bits & 0x00000001u) {
source_.ClearNonDefaultToEmptyNoArena();
}
if (cached_has_bits & 0x00000002u) {
contenttype_.ClearNonDefaultToEmptyNoArena();
}
}
if (cached_has_bits & 12u) {
::memset(&version_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&sourcetype_) -
reinterpret_cast<char*>(&version_)) + sizeof(sourcetype_));
}
_has_bits_.Clear();
_internal_metadata_.Clear();
}
bool Source::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:pb.Source)
for (;;) {
::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .pb.Source.Version version = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Source_Version_IsValid(value)) {
set_version(static_cast< ::pb::Source_Version >(value));
} else {
mutable_unknown_fields()->AddVarint(
1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required .pb.Source.SourceTypes sourceType = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Source_SourceTypes_IsValid(value)) {
set_sourcetype(static_cast< ::pb::Source_SourceTypes >(value));
} else {
mutable_unknown_fields()->AddVarint(
2, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required bytes source = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
input, this->mutable_source()));
} else {
goto handle_unusual;
}
break;
}
// required string contentType = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_contenttype()));
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->contenttype().data(), static_cast<int>(this->contenttype().length()),
::google::protobuf::internal::WireFormat::PARSE,
"pb.Source.contentType");
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:pb.Source)
return true;
failure:
// @@protoc_insertion_point(parse_failure:pb.Source)
return false;
#undef DO_
}
void Source::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:pb.Source)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Source.Version version = 1;
if (cached_has_bits & 0x00000004u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->version(), output);
}
// required .pb.Source.SourceTypes sourceType = 2;
if (cached_has_bits & 0x00000008u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
2, this->sourcetype(), output);
}
// required bytes source = 3;
if (cached_has_bits & 0x00000001u) {
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
3, this->source(), output);
}
// required string contentType = 4;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->contenttype().data(), static_cast<int>(this->contenttype().length()),
::google::protobuf::internal::WireFormat::SERIALIZE,
"pb.Source.contentType");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
4, this->contenttype(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:pb.Source)
}
::google::protobuf::uint8* Source::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:pb.Source)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Source.Version version = 1;
if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->version(), target);
}
// required .pb.Source.SourceTypes sourceType = 2;
if (cached_has_bits & 0x00000008u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
2, this->sourcetype(), target);
}
// required bytes source = 3;
if (cached_has_bits & 0x00000001u) {
target =
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
3, this->source(), target);
}
// required string contentType = 4;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->contenttype().data(), static_cast<int>(this->contenttype().length()),
::google::protobuf::internal::WireFormat::SERIALIZE,
"pb.Source.contentType");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4, this->contenttype(), target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:pb.Source)
return target;
}
size_t Source::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Source)
size_t total_size = 0;
if (has_source()) {
// required bytes source = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->source());
}
if (has_contenttype()) {
// required string contentType = 4;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->contenttype());
}
if (has_version()) {
// required .pb.Source.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
}
if (has_sourcetype()) {
// required .pb.Source.SourceTypes sourceType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->sourcetype());
}
return total_size;
}
size_t Source::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:pb.Source)
size_t total_size = 0;
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) { // All required fields are present.
// required bytes source = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::BytesSize(
this->source());
// required string contentType = 4;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->contenttype());
// required .pb.Source.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
// required .pb.Source.SourceTypes sourceType = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->sourcetype());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Source::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:pb.Source)
GOOGLE_DCHECK_NE(&from, this);
const Source* source =
::google::protobuf::internal::DynamicCastToGenerated<const Source>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Source)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Source)
MergeFrom(*source);
}
}
void Source::MergeFrom(const Source& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:pb.Source)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 15u) {
if (cached_has_bits & 0x00000001u) {
set_has_source();
source_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_);
}
if (cached_has_bits & 0x00000002u) {
set_has_contenttype();
contenttype_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.contenttype_);
}
if (cached_has_bits & 0x00000004u) {
version_ = from.version_;
}
if (cached_has_bits & 0x00000008u) {
sourcetype_ = from.sourcetype_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void Source::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:pb.Source)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Source::CopyFrom(const Source& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:pb.Source)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Source::IsInitialized() const {
if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false;
return true;
}
void Source::Swap(Source* other) {
if (other == this) return;
InternalSwap(other);
}
void Source::InternalSwap(Source* other) {
using std::swap;
source_.Swap(&other->source_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
contenttype_.Swap(&other->contenttype_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
GetArenaNoVirtual());
swap(version_, other->version_);
swap(sourcetype_, other->sourcetype_);
swap(_has_bits_[0], other->_has_bits_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
}
::google::protobuf::Metadata Source::GetMetadata() const {
protobuf_source_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_source_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Source* Arena::CreateMaybeMessage< ::pb::Source >(Arena* arena) {
return Arena::CreateInternal< ::pb::Source >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)

534
cpp/source.pb.h Normal file
View file

@ -0,0 +1,534 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: source.proto
#ifndef PROTOBUF_INCLUDED_source_2eproto
#define PROTOBUF_INCLUDED_source_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006000
#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 3006000 < GOOGLE_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/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_source_2eproto
namespace protobuf_source_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_source_2eproto
namespace pb {
class Source;
class SourceDefaultTypeInternal;
extern SourceDefaultTypeInternal _Source_default_instance_;
} // namespace pb
namespace google {
namespace protobuf {
template<> ::pb::Source* Arena::CreateMaybeMessage<::pb::Source>(Arena*);
} // namespace protobuf
} // namespace google
namespace pb {
enum Source_Version {
Source_Version_UNKNOWN_VERSION = 0,
Source_Version__0_0_1 = 1
};
bool Source_Version_IsValid(int value);
const Source_Version Source_Version_Version_MIN = Source_Version_UNKNOWN_VERSION;
const Source_Version Source_Version_Version_MAX = Source_Version__0_0_1;
const int Source_Version_Version_ARRAYSIZE = Source_Version_Version_MAX + 1;
const ::google::protobuf::EnumDescriptor* Source_Version_descriptor();
inline const ::std::string& Source_Version_Name(Source_Version value) {
return ::google::protobuf::internal::NameOfEnum(
Source_Version_descriptor(), value);
}
inline bool Source_Version_Parse(
const ::std::string& name, Source_Version* value) {
return ::google::protobuf::internal::ParseNamedEnum<Source_Version>(
Source_Version_descriptor(), name, value);
}
enum Source_SourceTypes {
Source_SourceTypes_UNKNOWN_SOURCE_TYPE = 0,
Source_SourceTypes_lbry_sd_hash = 1
};
bool Source_SourceTypes_IsValid(int value);
const Source_SourceTypes Source_SourceTypes_SourceTypes_MIN = Source_SourceTypes_UNKNOWN_SOURCE_TYPE;
const Source_SourceTypes Source_SourceTypes_SourceTypes_MAX = Source_SourceTypes_lbry_sd_hash;
const int Source_SourceTypes_SourceTypes_ARRAYSIZE = Source_SourceTypes_SourceTypes_MAX + 1;
const ::google::protobuf::EnumDescriptor* Source_SourceTypes_descriptor();
inline const ::std::string& Source_SourceTypes_Name(Source_SourceTypes value) {
return ::google::protobuf::internal::NameOfEnum(
Source_SourceTypes_descriptor(), value);
}
inline bool Source_SourceTypes_Parse(
const ::std::string& name, Source_SourceTypes* value) {
return ::google::protobuf::internal::ParseNamedEnum<Source_SourceTypes>(
Source_SourceTypes_descriptor(), name, value);
}
// ===================================================================
class Source : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Source) */ {
public:
Source();
virtual ~Source();
Source(const Source& from);
inline Source& operator=(const Source& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
Source(Source&& from) noexcept
: Source() {
*this = ::std::move(from);
}
inline Source& operator=(Source&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Source& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Source* internal_default_instance() {
return reinterpret_cast<const Source*>(
&_Source_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(Source* other);
friend void swap(Source& a, Source& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline Source* New() const final {
return CreateMaybeMessage<Source>(NULL);
}
Source* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<Source>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const Source& from);
void MergeFrom(const Source& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Source* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef Source_Version Version;
static const Version UNKNOWN_VERSION =
Source_Version_UNKNOWN_VERSION;
static const Version _0_0_1 =
Source_Version__0_0_1;
static inline bool Version_IsValid(int value) {
return Source_Version_IsValid(value);
}
static const Version Version_MIN =
Source_Version_Version_MIN;
static const Version Version_MAX =
Source_Version_Version_MAX;
static const int Version_ARRAYSIZE =
Source_Version_Version_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Version_descriptor() {
return Source_Version_descriptor();
}
static inline const ::std::string& Version_Name(Version value) {
return Source_Version_Name(value);
}
static inline bool Version_Parse(const ::std::string& name,
Version* value) {
return Source_Version_Parse(name, value);
}
typedef Source_SourceTypes SourceTypes;
static const SourceTypes UNKNOWN_SOURCE_TYPE =
Source_SourceTypes_UNKNOWN_SOURCE_TYPE;
static const SourceTypes lbry_sd_hash =
Source_SourceTypes_lbry_sd_hash;
static inline bool SourceTypes_IsValid(int value) {
return Source_SourceTypes_IsValid(value);
}
static const SourceTypes SourceTypes_MIN =
Source_SourceTypes_SourceTypes_MIN;
static const SourceTypes SourceTypes_MAX =
Source_SourceTypes_SourceTypes_MAX;
static const int SourceTypes_ARRAYSIZE =
Source_SourceTypes_SourceTypes_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
SourceTypes_descriptor() {
return Source_SourceTypes_descriptor();
}
static inline const ::std::string& SourceTypes_Name(SourceTypes value) {
return Source_SourceTypes_Name(value);
}
static inline bool SourceTypes_Parse(const ::std::string& name,
SourceTypes* value) {
return Source_SourceTypes_Parse(name, value);
}
// accessors -------------------------------------------------------
// required bytes source = 3;
bool has_source() const;
void clear_source();
static const int kSourceFieldNumber = 3;
const ::std::string& source() const;
void set_source(const ::std::string& value);
#if LANG_CXX11
void set_source(::std::string&& value);
#endif
void set_source(const char* value);
void set_source(const void* value, size_t size);
::std::string* mutable_source();
::std::string* release_source();
void set_allocated_source(::std::string* source);
// required string contentType = 4;
bool has_contenttype() const;
void clear_contenttype();
static const int kContentTypeFieldNumber = 4;
const ::std::string& contenttype() const;
void set_contenttype(const ::std::string& value);
#if LANG_CXX11
void set_contenttype(::std::string&& value);
#endif
void set_contenttype(const char* value);
void set_contenttype(const char* value, size_t size);
::std::string* mutable_contenttype();
::std::string* release_contenttype();
void set_allocated_contenttype(::std::string* contenttype);
// required .pb.Source.Version version = 1;
bool has_version() const;
void clear_version();
static const int kVersionFieldNumber = 1;
::pb::Source_Version version() const;
void set_version(::pb::Source_Version value);
// required .pb.Source.SourceTypes sourceType = 2;
bool has_sourcetype() const;
void clear_sourcetype();
static const int kSourceTypeFieldNumber = 2;
::pb::Source_SourceTypes sourcetype() const;
void set_sourcetype(::pb::Source_SourceTypes value);
// @@protoc_insertion_point(class_scope:pb.Source)
private:
void set_has_version();
void clear_has_version();
void set_has_sourcetype();
void clear_has_sourcetype();
void set_has_source();
void clear_has_source();
void set_has_contenttype();
void clear_has_contenttype();
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr source_;
::google::protobuf::internal::ArenaStringPtr contenttype_;
int version_;
int sourcetype_;
friend struct ::protobuf_source_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Source
// required .pb.Source.Version version = 1;
inline bool Source::has_version() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Source::set_has_version() {
_has_bits_[0] |= 0x00000004u;
}
inline void Source::clear_has_version() {
_has_bits_[0] &= ~0x00000004u;
}
inline void Source::clear_version() {
version_ = 0;
clear_has_version();
}
inline ::pb::Source_Version Source::version() const {
// @@protoc_insertion_point(field_get:pb.Source.version)
return static_cast< ::pb::Source_Version >(version_);
}
inline void Source::set_version(::pb::Source_Version value) {
assert(::pb::Source_Version_IsValid(value));
set_has_version();
version_ = value;
// @@protoc_insertion_point(field_set:pb.Source.version)
}
// required .pb.Source.SourceTypes sourceType = 2;
inline bool Source::has_sourcetype() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void Source::set_has_sourcetype() {
_has_bits_[0] |= 0x00000008u;
}
inline void Source::clear_has_sourcetype() {
_has_bits_[0] &= ~0x00000008u;
}
inline void Source::clear_sourcetype() {
sourcetype_ = 0;
clear_has_sourcetype();
}
inline ::pb::Source_SourceTypes Source::sourcetype() const {
// @@protoc_insertion_point(field_get:pb.Source.sourceType)
return static_cast< ::pb::Source_SourceTypes >(sourcetype_);
}
inline void Source::set_sourcetype(::pb::Source_SourceTypes value) {
assert(::pb::Source_SourceTypes_IsValid(value));
set_has_sourcetype();
sourcetype_ = value;
// @@protoc_insertion_point(field_set:pb.Source.sourceType)
}
// required bytes source = 3;
inline bool Source::has_source() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Source::set_has_source() {
_has_bits_[0] |= 0x00000001u;
}
inline void Source::clear_has_source() {
_has_bits_[0] &= ~0x00000001u;
}
inline void Source::clear_source() {
source_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_source();
}
inline const ::std::string& Source::source() const {
// @@protoc_insertion_point(field_get:pb.Source.source)
return source_.GetNoArena();
}
inline void Source::set_source(const ::std::string& value) {
set_has_source();
source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:pb.Source.source)
}
#if LANG_CXX11
inline void Source::set_source(::std::string&& value) {
set_has_source();
source_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:pb.Source.source)
}
#endif
inline void Source::set_source(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_source();
source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:pb.Source.source)
}
inline void Source::set_source(const void* value, size_t size) {
set_has_source();
source_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:pb.Source.source)
}
inline ::std::string* Source::mutable_source() {
set_has_source();
// @@protoc_insertion_point(field_mutable:pb.Source.source)
return source_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* Source::release_source() {
// @@protoc_insertion_point(field_release:pb.Source.source)
if (!has_source()) {
return NULL;
}
clear_has_source();
return source_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void Source::set_allocated_source(::std::string* source) {
if (source != NULL) {
set_has_source();
} else {
clear_has_source();
}
source_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source);
// @@protoc_insertion_point(field_set_allocated:pb.Source.source)
}
// required string contentType = 4;
inline bool Source::has_contenttype() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Source::set_has_contenttype() {
_has_bits_[0] |= 0x00000002u;
}
inline void Source::clear_has_contenttype() {
_has_bits_[0] &= ~0x00000002u;
}
inline void Source::clear_contenttype() {
contenttype_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_contenttype();
}
inline const ::std::string& Source::contenttype() const {
// @@protoc_insertion_point(field_get:pb.Source.contentType)
return contenttype_.GetNoArena();
}
inline void Source::set_contenttype(const ::std::string& value) {
set_has_contenttype();
contenttype_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:pb.Source.contentType)
}
#if LANG_CXX11
inline void Source::set_contenttype(::std::string&& value) {
set_has_contenttype();
contenttype_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:pb.Source.contentType)
}
#endif
inline void Source::set_contenttype(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_contenttype();
contenttype_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:pb.Source.contentType)
}
inline void Source::set_contenttype(const char* value, size_t size) {
set_has_contenttype();
contenttype_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:pb.Source.contentType)
}
inline ::std::string* Source::mutable_contenttype() {
set_has_contenttype();
// @@protoc_insertion_point(field_mutable:pb.Source.contentType)
return contenttype_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* Source::release_contenttype() {
// @@protoc_insertion_point(field_release:pb.Source.contentType)
if (!has_contenttype()) {
return NULL;
}
clear_has_contenttype();
return contenttype_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void Source::set_allocated_contenttype(::std::string* contenttype) {
if (contenttype != NULL) {
set_has_contenttype();
} else {
clear_has_contenttype();
}
contenttype_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), contenttype);
// @@protoc_insertion_point(field_set_allocated:pb.Source.contentType)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::pb::Source_Version> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Source_Version>() {
return ::pb::Source_Version_descriptor();
}
template <> struct is_proto_enum< ::pb::Source_SourceTypes> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Source_SourceTypes>() {
return ::pb::Source_SourceTypes_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_source_2eproto

540
cpp/stream.pb.cc Normal file
View file

@ -0,0 +1,540 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: stream.proto
#include "stream.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.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>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace protobuf_metadata_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_metadata_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_Metadata;
} // namespace protobuf_metadata_2eproto
namespace protobuf_source_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_source_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Source;
} // namespace protobuf_source_2eproto
namespace pb {
class StreamDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<Stream>
_instance;
} _Stream_default_instance_;
} // namespace pb
namespace protobuf_stream_2eproto {
static void InitDefaultsStream() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
{
void* ptr = &::pb::_Stream_default_instance_;
new (ptr) ::pb::Stream();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::pb::Stream::InitAsDefaultInstance();
}
::google::protobuf::internal::SCCInfo<2> scc_info_Stream =
{{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsStream}, {
&protobuf_metadata_2eproto::scc_info_Metadata.base,
&protobuf_source_2eproto::scc_info_Source.base,}};
void InitDefaults() {
::google::protobuf::internal::InitSCC(&scc_info_Stream.base);
}
::google::protobuf::Metadata file_level_metadata[1];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::pb::Stream, source_),
2,
0,
1,
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 8, sizeof(::pb::Stream)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::pb::_Stream_default_instance_),
};
void protobuf_AssignDescriptors() {
AddDescriptors();
AssignDescriptors(
"stream.proto", schemas, file_default_instances, TableStruct::offsets,
file_level_metadata, file_level_enum_descriptors, NULL);
}
void protobuf_AssignDescriptorsOnce() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}
void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
}
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\014stream.proto\022\002pb\032\016metadata.proto\032\014sour"
"ce.proto\"\225\001\n\006Stream\022#\n\007version\030\001 \002(\0162\022.p"
"b.Stream.Version\022\036\n\010metadata\030\002 \002(\0132\014.pb."
"Metadata\022\032\n\006source\030\003 \002(\0132\n.pb.Source\"*\n\007"
"Version\022\023\n\017UNKNOWN_VERSION\020\000\022\n\n\006_0_0_1\020\001"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 200);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"stream.proto", &protobuf_RegisterTypes);
::protobuf_metadata_2eproto::AddDescriptors();
::protobuf_source_2eproto::AddDescriptors();
}
void AddDescriptors() {
static ::google::protobuf::internal::once_flag once;
::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
StaticDescriptorInitializer() {
AddDescriptors();
}
} static_descriptor_initializer;
} // namespace protobuf_stream_2eproto
namespace pb {
const ::google::protobuf::EnumDescriptor* Stream_Version_descriptor() {
protobuf_stream_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_stream_2eproto::file_level_enum_descriptors[0];
}
bool Stream_Version_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Stream_Version Stream::UNKNOWN_VERSION;
const Stream_Version Stream::_0_0_1;
const Stream_Version Stream::Version_MIN;
const Stream_Version Stream::Version_MAX;
const int Stream::Version_ARRAYSIZE;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
// ===================================================================
void Stream::InitAsDefaultInstance() {
::pb::_Stream_default_instance_._instance.get_mutable()->metadata_ = const_cast< ::pb::Metadata*>(
::pb::Metadata::internal_default_instance());
::pb::_Stream_default_instance_._instance.get_mutable()->source_ = const_cast< ::pb::Source*>(
::pb::Source::internal_default_instance());
}
void Stream::clear_metadata() {
if (metadata_ != NULL) metadata_->Clear();
clear_has_metadata();
}
void Stream::clear_source() {
if (source_ != NULL) source_->Clear();
clear_has_source();
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Stream::kVersionFieldNumber;
const int Stream::kMetadataFieldNumber;
const int Stream::kSourceFieldNumber;
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
Stream::Stream()
: ::google::protobuf::Message(), _internal_metadata_(NULL) {
::google::protobuf::internal::InitSCC(
&protobuf_stream_2eproto::scc_info_Stream.base);
SharedCtor();
// @@protoc_insertion_point(constructor:pb.Stream)
}
Stream::Stream(const Stream& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from.has_metadata()) {
metadata_ = new ::pb::Metadata(*from.metadata_);
} else {
metadata_ = NULL;
}
if (from.has_source()) {
source_ = new ::pb::Source(*from.source_);
} else {
source_ = NULL;
}
version_ = from.version_;
// @@protoc_insertion_point(copy_constructor:pb.Stream)
}
void Stream::SharedCtor() {
::memset(&metadata_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&version_) -
reinterpret_cast<char*>(&metadata_)) + sizeof(version_));
}
Stream::~Stream() {
// @@protoc_insertion_point(destructor:pb.Stream)
SharedDtor();
}
void Stream::SharedDtor() {
if (this != internal_default_instance()) delete metadata_;
if (this != internal_default_instance()) delete source_;
}
void Stream::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* Stream::descriptor() {
::protobuf_stream_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_stream_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}
const Stream& Stream::default_instance() {
::google::protobuf::internal::InitSCC(&protobuf_stream_2eproto::scc_info_Stream.base);
return *internal_default_instance();
}
void Stream::Clear() {
// @@protoc_insertion_point(message_clear_start:pb.Stream)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
if (cached_has_bits & 3u) {
if (cached_has_bits & 0x00000001u) {
GOOGLE_DCHECK(metadata_ != NULL);
metadata_->Clear();
}
if (cached_has_bits & 0x00000002u) {
GOOGLE_DCHECK(source_ != NULL);
source_->Clear();
}
}
version_ = 0;
_has_bits_.Clear();
_internal_metadata_.Clear();
}
bool Stream::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:pb.Stream)
for (;;) {
::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .pb.Stream.Version version = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::pb::Stream_Version_IsValid(value)) {
set_version(static_cast< ::pb::Stream_Version >(value));
} else {
mutable_unknown_fields()->AddVarint(
1, static_cast< ::google::protobuf::uint64>(value));
}
} else {
goto handle_unusual;
}
break;
}
// required .pb.Metadata metadata = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_metadata()));
} else {
goto handle_unusual;
}
break;
}
// required .pb.Source source = 3;
case 3: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
input, mutable_source()));
} else {
goto handle_unusual;
}
break;
}
default: {
handle_unusual:
if (tag == 0) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, _internal_metadata_.mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:pb.Stream)
return true;
failure:
// @@protoc_insertion_point(parse_failure:pb.Stream)
return false;
#undef DO_
}
void Stream::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:pb.Stream)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Stream.Version version = 1;
if (cached_has_bits & 0x00000004u) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->version(), output);
}
// required .pb.Metadata metadata = 2;
if (cached_has_bits & 0x00000001u) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, this->_internal_metadata(), output);
}
// required .pb.Source source = 3;
if (cached_has_bits & 0x00000002u) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
3, this->_internal_source(), output);
}
if (_internal_metadata_.have_unknown_fields()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
_internal_metadata_.unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:pb.Stream)
}
::google::protobuf::uint8* Stream::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:pb.Stream)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// required .pb.Stream.Version version = 1;
if (cached_has_bits & 0x00000004u) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->version(), target);
}
// required .pb.Metadata metadata = 2;
if (cached_has_bits & 0x00000001u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
2, this->_internal_metadata(), deterministic, target);
}
// required .pb.Source source = 3;
if (cached_has_bits & 0x00000002u) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
3, this->_internal_source(), deterministic, target);
}
if (_internal_metadata_.have_unknown_fields()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:pb.Stream)
return target;
}
size_t Stream::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:pb.Stream)
size_t total_size = 0;
if (has_metadata()) {
// required .pb.Metadata metadata = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*metadata_);
}
if (has_source()) {
// required .pb.Source source = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*source_);
}
if (has_version()) {
// required .pb.Stream.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
}
return total_size;
}
size_t Stream::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:pb.Stream)
size_t total_size = 0;
if (_internal_metadata_.have_unknown_fields()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
_internal_metadata_.unknown_fields());
}
if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present.
// required .pb.Metadata metadata = 2;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*metadata_);
// required .pb.Source source = 3;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*source_);
// required .pb.Stream.Version version = 1;
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->version());
} else {
total_size += RequiredFieldsByteSizeFallback();
}
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Stream::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:pb.Stream)
GOOGLE_DCHECK_NE(&from, this);
const Stream* source =
::google::protobuf::internal::DynamicCastToGenerated<const Stream>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:pb.Stream)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:pb.Stream)
MergeFrom(*source);
}
}
void Stream::MergeFrom(const Stream& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:pb.Stream)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = from._has_bits_[0];
if (cached_has_bits & 7u) {
if (cached_has_bits & 0x00000001u) {
mutable_metadata()->::pb::Metadata::MergeFrom(from.metadata());
}
if (cached_has_bits & 0x00000002u) {
mutable_source()->::pb::Source::MergeFrom(from.source());
}
if (cached_has_bits & 0x00000004u) {
version_ = from.version_;
}
_has_bits_[0] |= cached_has_bits;
}
}
void Stream::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:pb.Stream)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Stream::CopyFrom(const Stream& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:pb.Stream)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Stream::IsInitialized() const {
if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
if (has_metadata()) {
if (!this->metadata_->IsInitialized()) return false;
}
if (has_source()) {
if (!this->source_->IsInitialized()) return false;
}
return true;
}
void Stream::Swap(Stream* other) {
if (other == this) return;
InternalSwap(other);
}
void Stream::InternalSwap(Stream* other) {
using std::swap;
swap(metadata_, other->metadata_);
swap(source_, other->source_);
swap(version_, other->version_);
swap(_has_bits_[0], other->_has_bits_[0]);
_internal_metadata_.Swap(&other->_internal_metadata_);
}
::google::protobuf::Metadata Stream::GetMetadata() const {
protobuf_stream_2eproto::protobuf_AssignDescriptorsOnce();
return ::protobuf_stream_2eproto::file_level_metadata[kIndexInFileMessages];
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::pb::Stream* Arena::CreateMaybeMessage< ::pb::Stream >(Arena* arena) {
return Arena::CreateInternal< ::pb::Stream >(arena);
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)

421
cpp/stream.pb.h Normal file
View file

@ -0,0 +1,421 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: stream.proto
#ifndef PROTOBUF_INCLUDED_stream_2eproto
#define PROTOBUF_INCLUDED_stream_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006000
#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 3006000 < GOOGLE_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/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/generated_enum_reflection.h>
#include <google/protobuf/unknown_field_set.h>
#include "metadata.pb.h"
#include "source.pb.h"
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_stream_2eproto
namespace protobuf_stream_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_stream_2eproto
namespace pb {
class Stream;
class StreamDefaultTypeInternal;
extern StreamDefaultTypeInternal _Stream_default_instance_;
} // namespace pb
namespace google {
namespace protobuf {
template<> ::pb::Stream* Arena::CreateMaybeMessage<::pb::Stream>(Arena*);
} // namespace protobuf
} // namespace google
namespace pb {
enum Stream_Version {
Stream_Version_UNKNOWN_VERSION = 0,
Stream_Version__0_0_1 = 1
};
bool Stream_Version_IsValid(int value);
const Stream_Version Stream_Version_Version_MIN = Stream_Version_UNKNOWN_VERSION;
const Stream_Version Stream_Version_Version_MAX = Stream_Version__0_0_1;
const int Stream_Version_Version_ARRAYSIZE = Stream_Version_Version_MAX + 1;
const ::google::protobuf::EnumDescriptor* Stream_Version_descriptor();
inline const ::std::string& Stream_Version_Name(Stream_Version value) {
return ::google::protobuf::internal::NameOfEnum(
Stream_Version_descriptor(), value);
}
inline bool Stream_Version_Parse(
const ::std::string& name, Stream_Version* value) {
return ::google::protobuf::internal::ParseNamedEnum<Stream_Version>(
Stream_Version_descriptor(), name, value);
}
// ===================================================================
class Stream : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:pb.Stream) */ {
public:
Stream();
virtual ~Stream();
Stream(const Stream& from);
inline Stream& operator=(const Stream& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
Stream(Stream&& from) noexcept
: Stream() {
*this = ::std::move(from);
}
inline Stream& operator=(Stream&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const Stream& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const Stream* internal_default_instance() {
return reinterpret_cast<const Stream*>(
&_Stream_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(Stream* other);
friend void swap(Stream& a, Stream& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline Stream* New() const final {
return CreateMaybeMessage<Stream>(NULL);
}
Stream* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<Stream>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const Stream& from);
void MergeFrom(const Stream& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Stream* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef Stream_Version Version;
static const Version UNKNOWN_VERSION =
Stream_Version_UNKNOWN_VERSION;
static const Version _0_0_1 =
Stream_Version__0_0_1;
static inline bool Version_IsValid(int value) {
return Stream_Version_IsValid(value);
}
static const Version Version_MIN =
Stream_Version_Version_MIN;
static const Version Version_MAX =
Stream_Version_Version_MAX;
static const int Version_ARRAYSIZE =
Stream_Version_Version_ARRAYSIZE;
static inline const ::google::protobuf::EnumDescriptor*
Version_descriptor() {
return Stream_Version_descriptor();
}
static inline const ::std::string& Version_Name(Version value) {
return Stream_Version_Name(value);
}
static inline bool Version_Parse(const ::std::string& name,
Version* value) {
return Stream_Version_Parse(name, value);
}
// accessors -------------------------------------------------------
// required .pb.Metadata metadata = 2;
bool has_metadata() const;
void clear_metadata();
static const int kMetadataFieldNumber = 2;
private:
const ::pb::Metadata& _internal_metadata() const;
public:
const ::pb::Metadata& metadata() const;
::pb::Metadata* release_metadata();
::pb::Metadata* mutable_metadata();
void set_allocated_metadata(::pb::Metadata* metadata);
// required .pb.Source source = 3;
bool has_source() const;
void clear_source();
static const int kSourceFieldNumber = 3;
private:
const ::pb::Source& _internal_source() const;
public:
const ::pb::Source& source() const;
::pb::Source* release_source();
::pb::Source* mutable_source();
void set_allocated_source(::pb::Source* source);
// required .pb.Stream.Version version = 1;
bool has_version() const;
void clear_version();
static const int kVersionFieldNumber = 1;
::pb::Stream_Version version() const;
void set_version(::pb::Stream_Version value);
// @@protoc_insertion_point(class_scope:pb.Stream)
private:
void set_has_version();
void clear_has_version();
void set_has_metadata();
void clear_has_metadata();
void set_has_source();
void clear_has_source();
// helper for ByteSizeLong()
size_t RequiredFieldsByteSizeFallback() const;
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::pb::Metadata* metadata_;
::pb::Source* source_;
int version_;
friend struct ::protobuf_stream_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// Stream
// required .pb.Stream.Version version = 1;
inline bool Stream::has_version() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void Stream::set_has_version() {
_has_bits_[0] |= 0x00000004u;
}
inline void Stream::clear_has_version() {
_has_bits_[0] &= ~0x00000004u;
}
inline void Stream::clear_version() {
version_ = 0;
clear_has_version();
}
inline ::pb::Stream_Version Stream::version() const {
// @@protoc_insertion_point(field_get:pb.Stream.version)
return static_cast< ::pb::Stream_Version >(version_);
}
inline void Stream::set_version(::pb::Stream_Version value) {
assert(::pb::Stream_Version_IsValid(value));
set_has_version();
version_ = value;
// @@protoc_insertion_point(field_set:pb.Stream.version)
}
// required .pb.Metadata metadata = 2;
inline bool Stream::has_metadata() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Stream::set_has_metadata() {
_has_bits_[0] |= 0x00000001u;
}
inline void Stream::clear_has_metadata() {
_has_bits_[0] &= ~0x00000001u;
}
inline const ::pb::Metadata& Stream::_internal_metadata() const {
return *metadata_;
}
inline const ::pb::Metadata& Stream::metadata() const {
const ::pb::Metadata* p = metadata_;
// @@protoc_insertion_point(field_get:pb.Stream.metadata)
return p != NULL ? *p : *reinterpret_cast<const ::pb::Metadata*>(
&::pb::_Metadata_default_instance_);
}
inline ::pb::Metadata* Stream::release_metadata() {
// @@protoc_insertion_point(field_release:pb.Stream.metadata)
clear_has_metadata();
::pb::Metadata* temp = metadata_;
metadata_ = NULL;
return temp;
}
inline ::pb::Metadata* Stream::mutable_metadata() {
set_has_metadata();
if (metadata_ == NULL) {
auto* p = CreateMaybeMessage<::pb::Metadata>(GetArenaNoVirtual());
metadata_ = p;
}
// @@protoc_insertion_point(field_mutable:pb.Stream.metadata)
return metadata_;
}
inline void Stream::set_allocated_metadata(::pb::Metadata* metadata) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(metadata_);
}
if (metadata) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
metadata = ::google::protobuf::internal::GetOwnedMessage(
message_arena, metadata, submessage_arena);
}
set_has_metadata();
} else {
clear_has_metadata();
}
metadata_ = metadata;
// @@protoc_insertion_point(field_set_allocated:pb.Stream.metadata)
}
// required .pb.Source source = 3;
inline bool Stream::has_source() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Stream::set_has_source() {
_has_bits_[0] |= 0x00000002u;
}
inline void Stream::clear_has_source() {
_has_bits_[0] &= ~0x00000002u;
}
inline const ::pb::Source& Stream::_internal_source() const {
return *source_;
}
inline const ::pb::Source& Stream::source() const {
const ::pb::Source* p = source_;
// @@protoc_insertion_point(field_get:pb.Stream.source)
return p != NULL ? *p : *reinterpret_cast<const ::pb::Source*>(
&::pb::_Source_default_instance_);
}
inline ::pb::Source* Stream::release_source() {
// @@protoc_insertion_point(field_release:pb.Stream.source)
clear_has_source();
::pb::Source* temp = source_;
source_ = NULL;
return temp;
}
inline ::pb::Source* Stream::mutable_source() {
set_has_source();
if (source_ == NULL) {
auto* p = CreateMaybeMessage<::pb::Source>(GetArenaNoVirtual());
source_ = p;
}
// @@protoc_insertion_point(field_mutable:pb.Stream.source)
return source_;
}
inline void Stream::set_allocated_source(::pb::Source* source) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_);
}
if (source) {
::google::protobuf::Arena* submessage_arena = NULL;
if (message_arena != submessage_arena) {
source = ::google::protobuf::internal::GetOwnedMessage(
message_arena, source, submessage_arena);
}
set_has_source();
} else {
clear_has_source();
}
source_ = source;
// @@protoc_insertion_point(field_set_allocated:pb.Stream.source)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace pb
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::pb::Stream_Version> : ::std::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::pb::Stream_Version>() {
return ::pb::Stream_Version_descriptor();
}
} // namespace protobuf
} // namespace google
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_stream_2eproto