From ad6fdf99c86150a0e72c5094d1379b39b83a148d Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 16 Aug 2014 21:29:30 +0100 Subject: protocol buffer map --- protocol_buffer_map/map.pb.cc | 594 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 594 insertions(+) create mode 100644 protocol_buffer_map/map.pb.cc (limited to 'protocol_buffer_map/map.pb.cc') diff --git a/protocol_buffer_map/map.pb.cc b/protocol_buffer_map/map.pb.cc new file mode 100644 index 0000000..7b355a2 --- /dev/null +++ b/protocol_buffer_map/map.pb.cc @@ -0,0 +1,594 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: map.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "map.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace { + +const ::google::protobuf::Descriptor* Pair_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Pair_reflection_ = NULL; +const ::google::protobuf::Descriptor* Map_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Map_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_map_2eproto() { + protobuf_AddDesc_map_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "map.proto"); + GOOGLE_CHECK(file != NULL); + Pair_descriptor_ = file->message_type(0); + static const int Pair_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Pair, key_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Pair, value_), + }; + Pair_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Pair_descriptor_, + Pair::default_instance_, + Pair_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Pair, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Pair, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Pair)); + Map_descriptor_ = file->message_type(1); + static const int Map_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Map, pairs_), + }; + Map_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Map_descriptor_, + Map::default_instance_, + Map_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Map, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Map, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Map)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_map_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Pair_descriptor_, &Pair::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Map_descriptor_, &Map::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_map_2eproto() { + delete Pair::default_instance_; + delete Pair_reflection_; + delete Map::default_instance_; + delete Map_reflection_; +} + +void protobuf_AddDesc_map_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\tmap.proto\"\"\n\004Pair\022\013\n\003key\030\001 \002(\t\022\r\n\005valu" + "e\030\002 \002(\005\"\033\n\003Map\022\024\n\005pairs\030\001 \003(\0132\005.Pair", 76); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "map.proto", &protobuf_RegisterTypes); + Pair::default_instance_ = new Pair(); + Map::default_instance_ = new Map(); + Pair::default_instance_->InitAsDefaultInstance(); + Map::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_map_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_map_2eproto { + StaticDescriptorInitializer_map_2eproto() { + protobuf_AddDesc_map_2eproto(); + } +} static_descriptor_initializer_map_2eproto_; + +// =================================================================== + +#ifndef _MSC_VER +const int Pair::kKeyFieldNumber; +const int Pair::kValueFieldNumber; +#endif // !_MSC_VER + +Pair::Pair() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Pair::InitAsDefaultInstance() { +} + +Pair::Pair(const Pair& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Pair::SharedCtor() { + _cached_size_ = 0; + key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + value_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Pair::~Pair() { + SharedDtor(); +} + +void Pair::SharedDtor() { + if (key_ != &::google::protobuf::internal::kEmptyString) { + delete key_; + } + if (this != default_instance_) { + } +} + +void Pair::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Pair::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Pair_descriptor_; +} + +const Pair& Pair::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_map_2eproto(); + return *default_instance_; +} + +Pair* Pair::default_instance_ = NULL; + +Pair* Pair::New() const { + return new Pair; +} + +void Pair::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (has_key()) { + if (key_ != &::google::protobuf::internal::kEmptyString) { + key_->clear(); + } + } + value_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Pair::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string key = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_key())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->key().data(), this->key().length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_value; + break; + } + + // required int32 value = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &value_))); + set_has_value(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } + return true; +#undef DO_ +} + +void Pair::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required string key = 1; + if (has_key()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->key().data(), this->key().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 1, this->key(), output); + } + + // required int32 value = 2; + if (has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->value(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Pair::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required string key = 1; + if (has_key()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->key().data(), this->key().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->key(), target); + } + + // required int32 value = 2; + if (has_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->value(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Pair::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string key = 1; + if (has_key()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->key()); + } + + // required int32 value = 2; + if (has_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->value()); + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Pair::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Pair* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Pair::MergeFrom(const Pair& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_key()) { + set_key(from.key()); + } + if (from.has_value()) { + set_value(from.value()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Pair::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Pair::CopyFrom(const Pair& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Pair::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void Pair::Swap(Pair* other) { + if (other != this) { + std::swap(key_, other->key_); + std::swap(value_, other->value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Pair::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Pair_descriptor_; + metadata.reflection = Pair_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Map::kPairsFieldNumber; +#endif // !_MSC_VER + +Map::Map() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Map::InitAsDefaultInstance() { +} + +Map::Map(const Map& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Map::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Map::~Map() { + SharedDtor(); +} + +void Map::SharedDtor() { + if (this != default_instance_) { + } +} + +void Map::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Map::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Map_descriptor_; +} + +const Map& Map::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_map_2eproto(); + return *default_instance_; +} + +Map* Map::default_instance_ = NULL; + +Map* Map::New() const { + return new Map; +} + +void Map::Clear() { + pairs_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Map::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .Pair pairs = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_pairs: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_pairs())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(10)) goto parse_pairs; + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } + return true; +#undef DO_ +} + +void Map::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // repeated .Pair pairs = 1; + for (int i = 0; i < this->pairs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->pairs(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Map::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // repeated .Pair pairs = 1; + for (int i = 0; i < this->pairs_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->pairs(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Map::ByteSize() const { + int total_size = 0; + + // repeated .Pair pairs = 1; + total_size += 1 * this->pairs_size(); + for (int i = 0; i < this->pairs_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pairs(i)); + } + + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void Map::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Map* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Map::MergeFrom(const Map& from) { + GOOGLE_CHECK_NE(&from, this); + pairs_.MergeFrom(from.pairs_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Map::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Map::CopyFrom(const Map& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Map::IsInitialized() const { + + for (int i = 0; i < pairs_size(); i++) { + if (!this->pairs(i).IsInitialized()) return false; + } + return true; +} + +void Map::Swap(Map* other) { + if (other != this) { + pairs_.Swap(&other->pairs_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata Map::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Map_descriptor_; + metadata.reflection = Map_reflection_; + return metadata; +} + + +// @@protoc_insertion_point(namespace_scope) + +// @@protoc_insertion_point(global_scope) -- cgit v1.2.3