types/cpp/stream.pb.cc

541 lines
18 KiB
C++
Raw Permalink Normal View History

// 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)