[zeromq-dev] Regarding Issue in Initialising Repeated Fields
yogesh fulsunge
yogesh.fulsunge at gmail.com
Thu Jun 9 18:07:12 CEST 2016
Dear Team,
Please find my detailed problem:
I have a schema which handles repeated fields as shown below, i am facing
problems for Initialising the repeated fields.
In my schema, i have one Rack inside that i have multiple Shelf and inside
one shelf i have multiple Cards and Slots.
how to handle this kind of scenario in C++ APIs?
I generated the C++ code and for handling repeated fields it makes use of
google::protobuf::RepeatedPtrField which i am not able to Initialise in
code.
can you help me with some sample C++ code to understand the usage? whether
i am using correct approach?? please let me know.
is there a way i can generate JSON data structure instead of Templates i
guess it will be easier can you please help me in this??
I have attached the proto file and C++ generated files.
message RackRequest {
required ReqType req_type = 1;
required float rheight = 2;
required float rwidth = 3;
repeated Shelf shelf_in = 4;
enum ReqType {
SEARCH = 0;
ADD = 1;
MODIFY = 2;
DELETE = 3;
}
}
message RackResponse {
required RespType resp_type = 1;
required float rheight = 2;
required float rwidth = 3;
repeated Shelf shelf_in = 4;
enum RespType {
SEARCH = 0;
ADD = 1;
MODIFY = 2;
DELETE = 3;
}
required int32 result_code = 7;
}
message Shelf {
required float sxaxis = 1;
required float syaxis = 2;
required float sheight = 3;
required float swidth = 4;
required bool sconfigurable = 5;
repeated Card card_in = 6;
repeated Slot slot_in = 7;
}
message Card {
required float cxaxis = 1;
required float cyaxis = 2;
required float cheight = 3;
required float cwidth = 4;
required bool cconfigurable = 5;
repeated int32 port = 6;
}
message Slot {
required float cxaxis = 1;
required float cyaxis = 2;
required float cheight = 3;
required float cwidth = 4;
required bool cconfigurable = 5;
repeated int32 port = 6;
}
Regards,
Yogesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160609/d5df2446/attachment.htm>
-------------- next part --------------
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: Rack.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "Rack.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.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>
// @@protoc_insertion_point(includes)
namespace {
const ::google::protobuf::Descriptor* RackRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RackRequest_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* RackRequest_ReqType_descriptor_ = NULL;
const ::google::protobuf::Descriptor* RackResponse_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RackResponse_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* RackResponse_RespType_descriptor_ = NULL;
const ::google::protobuf::Descriptor* Shelf_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Shelf_reflection_ = NULL;
const ::google::protobuf::Descriptor* Card_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Card_reflection_ = NULL;
const ::google::protobuf::Descriptor* Slot_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Slot_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_Rack_2eproto() {
protobuf_AddDesc_Rack_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"Rack.proto");
GOOGLE_CHECK(file != NULL);
RackRequest_descriptor_ = file->message_type(0);
static const int RackRequest_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackRequest, req_type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackRequest, rheight_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackRequest, rwidth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackRequest, shelf_in_),
};
RackRequest_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RackRequest_descriptor_,
RackRequest::default_instance_,
RackRequest_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackRequest, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackRequest, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RackRequest));
RackRequest_ReqType_descriptor_ = RackRequest_descriptor_->enum_type(0);
RackResponse_descriptor_ = file->message_type(1);
static const int RackResponse_offsets_[5] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, resp_type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, rheight_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, rwidth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, shelf_in_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, result_code_),
};
RackResponse_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RackResponse_descriptor_,
RackResponse::default_instance_,
RackResponse_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RackResponse, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RackResponse));
RackResponse_RespType_descriptor_ = RackResponse_descriptor_->enum_type(0);
Shelf_descriptor_ = file->message_type(2);
static const int Shelf_offsets_[7] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, sxaxis_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, syaxis_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, sheight_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, swidth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, sconfigurable_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, card_in_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, slot_in_),
};
Shelf_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Shelf_descriptor_,
Shelf::default_instance_,
Shelf_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Shelf, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Shelf));
Card_descriptor_ = file->message_type(3);
static const int Card_offsets_[6] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, cxaxis_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, cyaxis_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, cheight_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, cwidth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, cconfigurable_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, port_),
};
Card_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Card_descriptor_,
Card::default_instance_,
Card_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Card, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Card));
Slot_descriptor_ = file->message_type(4);
static const int Slot_offsets_[6] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, cxaxis_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, cyaxis_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, cheight_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, cwidth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, cconfigurable_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, port_),
};
Slot_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
Slot_descriptor_,
Slot::default_instance_,
Slot_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Slot, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(Slot));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_Rack_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RackRequest_descriptor_, &RackRequest::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RackResponse_descriptor_, &RackResponse::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Shelf_descriptor_, &Shelf::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Card_descriptor_, &Card::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Slot_descriptor_, &Slot::default_instance());
}
} // namespace
void protobuf_ShutdownFile_Rack_2eproto() {
delete RackRequest::default_instance_;
delete RackRequest_reflection_;
delete RackResponse::default_instance_;
delete RackResponse_reflection_;
delete Shelf::default_instance_;
delete Shelf_reflection_;
delete Card::default_instance_;
delete Card_reflection_;
delete Slot::default_instance_;
delete Slot_reflection_;
}
void protobuf_AddDesc_Rack_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\nRack.proto\"\250\001\n\013RackRequest\022&\n\010req_type"
"\030\001 \002(\0162\024.RackRequest.ReqType\022\017\n\007rheight\030"
"\002 \002(\002\022\016\n\006rwidth\030\003 \002(\002\022\030\n\010shelf_in\030\004 \003(\0132"
"\006.Shelf\"6\n\007ReqType\022\n\n\006SEARCH\020\000\022\007\n\003ADD\020\001\022"
"\n\n\006MODIFY\020\002\022\n\n\006DELETE\020\003\"\302\001\n\014RackResponse"
"\022)\n\tresp_type\030\001 \002(\0162\026.RackResponse.RespT"
"ype\022\017\n\007rheight\030\002 \002(\002\022\016\n\006rwidth\030\003 \002(\002\022\030\n\010"
"shelf_in\030\004 \003(\0132\006.Shelf\022\023\n\013result_code\030\007 "
"\002(\005\"7\n\010RespType\022\n\n\006SEARCH\020\000\022\007\n\003ADD\020\001\022\n\n\006"
"MODIFY\020\002\022\n\n\006DELETE\020\003\"\217\001\n\005Shelf\022\016\n\006sxaxis"
"\030\001 \002(\002\022\016\n\006syaxis\030\002 \002(\002\022\017\n\007sheight\030\003 \002(\002\022"
"\016\n\006swidth\030\004 \002(\002\022\025\n\rsconfigurable\030\005 \002(\010\022\026"
"\n\007card_in\030\006 \003(\0132\005.Card\022\026\n\007slot_in\030\007 \003(\0132"
"\005.Slot\"l\n\004Card\022\016\n\006cxaxis\030\001 \002(\002\022\016\n\006cyaxis"
"\030\002 \002(\002\022\017\n\007cheight\030\003 \002(\002\022\016\n\006cwidth\030\004 \002(\002\022"
"\025\n\rcconfigurable\030\005 \002(\010\022\014\n\004port\030\006 \003(\005\"l\n\004"
"Slot\022\016\n\006cxaxis\030\001 \002(\002\022\016\n\006cyaxis\030\002 \002(\002\022\017\n\007"
"cheight\030\003 \002(\002\022\016\n\006cwidth\030\004 \002(\002\022\025\n\rcconfig"
"urable\030\005 \002(\010\022\014\n\004port\030\006 \003(\005", 746);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"Rack.proto", &protobuf_RegisterTypes);
RackRequest::default_instance_ = new RackRequest();
RackResponse::default_instance_ = new RackResponse();
Shelf::default_instance_ = new Shelf();
Card::default_instance_ = new Card();
Slot::default_instance_ = new Slot();
RackRequest::default_instance_->InitAsDefaultInstance();
RackResponse::default_instance_->InitAsDefaultInstance();
Shelf::default_instance_->InitAsDefaultInstance();
Card::default_instance_->InitAsDefaultInstance();
Slot::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Rack_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_Rack_2eproto {
StaticDescriptorInitializer_Rack_2eproto() {
protobuf_AddDesc_Rack_2eproto();
}
} static_descriptor_initializer_Rack_2eproto_;
// ===================================================================
const ::google::protobuf::EnumDescriptor* RackRequest_ReqType_descriptor() {
protobuf_AssignDescriptorsOnce();
return RackRequest_ReqType_descriptor_;
}
bool RackRequest_ReqType_IsValid(int value) {
switch(value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const RackRequest_ReqType RackRequest::SEARCH;
const RackRequest_ReqType RackRequest::ADD;
const RackRequest_ReqType RackRequest::MODIFY;
const RackRequest_ReqType RackRequest::DELETE;
const RackRequest_ReqType RackRequest::ReqType_MIN;
const RackRequest_ReqType RackRequest::ReqType_MAX;
const int RackRequest::ReqType_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int RackRequest::kReqTypeFieldNumber;
const int RackRequest::kRheightFieldNumber;
const int RackRequest::kRwidthFieldNumber;
const int RackRequest::kShelfInFieldNumber;
#endif // !_MSC_VER
RackRequest::RackRequest()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:RackRequest)
}
void RackRequest::InitAsDefaultInstance() {
}
RackRequest::RackRequest(const RackRequest& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:RackRequest)
}
void RackRequest::SharedCtor() {
_cached_size_ = 0;
req_type_ = 0;
rheight_ = 0;
rwidth_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RackRequest::~RackRequest() {
// @@protoc_insertion_point(destructor:RackRequest)
SharedDtor();
}
void RackRequest::SharedDtor() {
if (this != default_instance_) {
}
}
void RackRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RackRequest::descriptor() {
protobuf_AssignDescriptorsOnce();
return RackRequest_descriptor_;
}
const RackRequest& RackRequest::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Rack_2eproto();
return *default_instance_;
}
RackRequest* RackRequest::default_instance_ = NULL;
RackRequest* RackRequest::New() const {
return new RackRequest;
}
void RackRequest::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<RackRequest*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if (_has_bits_[0 / 32] & 7) {
ZR_(req_type_, rheight_);
rwidth_ = 0;
}
#undef OFFSET_OF_FIELD_
#undef ZR_
shelf_in_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RackRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:RackRequest)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .RackRequest.ReqType req_type = 1;
case 1: {
if (tag == 8) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::RackRequest_ReqType_IsValid(value)) {
set_req_type(static_cast< ::RackRequest_ReqType >(value));
} else {
mutable_unknown_fields()->AddVarint(1, value);
}
} else {
goto handle_unusual;
}
if (input->ExpectTag(21)) goto parse_rheight;
break;
}
// required float rheight = 2;
case 2: {
if (tag == 21) {
parse_rheight:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rheight_)));
set_has_rheight();
} else {
goto handle_unusual;
}
if (input->ExpectTag(29)) goto parse_rwidth;
break;
}
// required float rwidth = 3;
case 3: {
if (tag == 29) {
parse_rwidth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rwidth_)));
set_has_rwidth();
} else {
goto handle_unusual;
}
if (input->ExpectTag(34)) goto parse_shelf_in;
break;
}
// repeated .Shelf shelf_in = 4;
case 4: {
if (tag == 34) {
parse_shelf_in:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_shelf_in()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(34)) goto parse_shelf_in;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:RackRequest)
return true;
failure:
// @@protoc_insertion_point(parse_failure:RackRequest)
return false;
#undef DO_
}
void RackRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:RackRequest)
// required .RackRequest.ReqType req_type = 1;
if (has_req_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->req_type(), output);
}
// required float rheight = 2;
if (has_rheight()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->rheight(), output);
}
// required float rwidth = 3;
if (has_rwidth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->rwidth(), output);
}
// repeated .Shelf shelf_in = 4;
for (int i = 0; i < this->shelf_in_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->shelf_in(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:RackRequest)
}
::google::protobuf::uint8* RackRequest::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:RackRequest)
// required .RackRequest.ReqType req_type = 1;
if (has_req_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->req_type(), target);
}
// required float rheight = 2;
if (has_rheight()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->rheight(), target);
}
// required float rwidth = 3;
if (has_rwidth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->rwidth(), target);
}
// repeated .Shelf shelf_in = 4;
for (int i = 0; i < this->shelf_in_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
4, this->shelf_in(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:RackRequest)
return target;
}
int RackRequest::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .RackRequest.ReqType req_type = 1;
if (has_req_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->req_type());
}
// required float rheight = 2;
if (has_rheight()) {
total_size += 1 + 4;
}
// required float rwidth = 3;
if (has_rwidth()) {
total_size += 1 + 4;
}
}
// repeated .Shelf shelf_in = 4;
total_size += 1 * this->shelf_in_size();
for (int i = 0; i < this->shelf_in_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->shelf_in(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 RackRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RackRequest* source =
::google::protobuf::internal::dynamic_cast_if_available<const RackRequest*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RackRequest::MergeFrom(const RackRequest& from) {
GOOGLE_CHECK_NE(&from, this);
shelf_in_.MergeFrom(from.shelf_in_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_req_type()) {
set_req_type(from.req_type());
}
if (from.has_rheight()) {
set_rheight(from.rheight());
}
if (from.has_rwidth()) {
set_rwidth(from.rwidth());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RackRequest::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RackRequest::CopyFrom(const RackRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RackRequest::IsInitialized() const {
if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->shelf_in())) return false;
return true;
}
void RackRequest::Swap(RackRequest* other) {
if (other != this) {
std::swap(req_type_, other->req_type_);
std::swap(rheight_, other->rheight_);
std::swap(rwidth_, other->rwidth_);
shelf_in_.Swap(&other->shelf_in_);
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 RackRequest::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RackRequest_descriptor_;
metadata.reflection = RackRequest_reflection_;
return metadata;
}
// ===================================================================
const ::google::protobuf::EnumDescriptor* RackResponse_RespType_descriptor() {
protobuf_AssignDescriptorsOnce();
return RackResponse_RespType_descriptor_;
}
bool RackResponse_RespType_IsValid(int value) {
switch(value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#ifndef _MSC_VER
const RackResponse_RespType RackResponse::SEARCH;
const RackResponse_RespType RackResponse::ADD;
const RackResponse_RespType RackResponse::MODIFY;
const RackResponse_RespType RackResponse::DELETE;
const RackResponse_RespType RackResponse::RespType_MIN;
const RackResponse_RespType RackResponse::RespType_MAX;
const int RackResponse::RespType_ARRAYSIZE;
#endif // _MSC_VER
#ifndef _MSC_VER
const int RackResponse::kRespTypeFieldNumber;
const int RackResponse::kRheightFieldNumber;
const int RackResponse::kRwidthFieldNumber;
const int RackResponse::kShelfInFieldNumber;
const int RackResponse::kResultCodeFieldNumber;
#endif // !_MSC_VER
RackResponse::RackResponse()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:RackResponse)
}
void RackResponse::InitAsDefaultInstance() {
}
RackResponse::RackResponse(const RackResponse& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:RackResponse)
}
void RackResponse::SharedCtor() {
_cached_size_ = 0;
resp_type_ = 0;
rheight_ = 0;
rwidth_ = 0;
result_code_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RackResponse::~RackResponse() {
// @@protoc_insertion_point(destructor:RackResponse)
SharedDtor();
}
void RackResponse::SharedDtor() {
if (this != default_instance_) {
}
}
void RackResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RackResponse::descriptor() {
protobuf_AssignDescriptorsOnce();
return RackResponse_descriptor_;
}
const RackResponse& RackResponse::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Rack_2eproto();
return *default_instance_;
}
RackResponse* RackResponse::default_instance_ = NULL;
RackResponse* RackResponse::New() const {
return new RackResponse;
}
void RackResponse::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<RackResponse*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
ZR_(resp_type_, rheight_);
ZR_(rwidth_, result_code_);
#undef OFFSET_OF_FIELD_
#undef ZR_
shelf_in_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RackResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:RackResponse)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required .RackResponse.RespType resp_type = 1;
case 1: {
if (tag == 8) {
int value;
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
if (::RackResponse_RespType_IsValid(value)) {
set_resp_type(static_cast< ::RackResponse_RespType >(value));
} else {
mutable_unknown_fields()->AddVarint(1, value);
}
} else {
goto handle_unusual;
}
if (input->ExpectTag(21)) goto parse_rheight;
break;
}
// required float rheight = 2;
case 2: {
if (tag == 21) {
parse_rheight:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rheight_)));
set_has_rheight();
} else {
goto handle_unusual;
}
if (input->ExpectTag(29)) goto parse_rwidth;
break;
}
// required float rwidth = 3;
case 3: {
if (tag == 29) {
parse_rwidth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &rwidth_)));
set_has_rwidth();
} else {
goto handle_unusual;
}
if (input->ExpectTag(34)) goto parse_shelf_in;
break;
}
// repeated .Shelf shelf_in = 4;
case 4: {
if (tag == 34) {
parse_shelf_in:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_shelf_in()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(34)) goto parse_shelf_in;
if (input->ExpectTag(56)) goto parse_result_code;
break;
}
// required int32 result_code = 7;
case 7: {
if (tag == 56) {
parse_result_code:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &result_code_)));
set_has_result_code();
} else {
goto handle_unusual;
}
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:RackResponse)
return true;
failure:
// @@protoc_insertion_point(parse_failure:RackResponse)
return false;
#undef DO_
}
void RackResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:RackResponse)
// required .RackResponse.RespType resp_type = 1;
if (has_resp_type()) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->resp_type(), output);
}
// required float rheight = 2;
if (has_rheight()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->rheight(), output);
}
// required float rwidth = 3;
if (has_rwidth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->rwidth(), output);
}
// repeated .Shelf shelf_in = 4;
for (int i = 0; i < this->shelf_in_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, this->shelf_in(i), output);
}
// required int32 result_code = 7;
if (has_result_code()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(7, this->result_code(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:RackResponse)
}
::google::protobuf::uint8* RackResponse::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:RackResponse)
// required .RackResponse.RespType resp_type = 1;
if (has_resp_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->resp_type(), target);
}
// required float rheight = 2;
if (has_rheight()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->rheight(), target);
}
// required float rwidth = 3;
if (has_rwidth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->rwidth(), target);
}
// repeated .Shelf shelf_in = 4;
for (int i = 0; i < this->shelf_in_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
4, this->shelf_in(i), target);
}
// required int32 result_code = 7;
if (has_result_code()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7, this->result_code(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:RackResponse)
return target;
}
int RackResponse::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required .RackResponse.RespType resp_type = 1;
if (has_resp_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->resp_type());
}
// required float rheight = 2;
if (has_rheight()) {
total_size += 1 + 4;
}
// required float rwidth = 3;
if (has_rwidth()) {
total_size += 1 + 4;
}
// required int32 result_code = 7;
if (has_result_code()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->result_code());
}
}
// repeated .Shelf shelf_in = 4;
total_size += 1 * this->shelf_in_size();
for (int i = 0; i < this->shelf_in_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->shelf_in(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 RackResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RackResponse* source =
::google::protobuf::internal::dynamic_cast_if_available<const RackResponse*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RackResponse::MergeFrom(const RackResponse& from) {
GOOGLE_CHECK_NE(&from, this);
shelf_in_.MergeFrom(from.shelf_in_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_resp_type()) {
set_resp_type(from.resp_type());
}
if (from.has_rheight()) {
set_rheight(from.rheight());
}
if (from.has_rwidth()) {
set_rwidth(from.rwidth());
}
if (from.has_result_code()) {
set_result_code(from.result_code());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RackResponse::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RackResponse::CopyFrom(const RackResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RackResponse::IsInitialized() const {
if ((_has_bits_[0] & 0x00000017) != 0x00000017) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->shelf_in())) return false;
return true;
}
void RackResponse::Swap(RackResponse* other) {
if (other != this) {
std::swap(resp_type_, other->resp_type_);
std::swap(rheight_, other->rheight_);
std::swap(rwidth_, other->rwidth_);
shelf_in_.Swap(&other->shelf_in_);
std::swap(result_code_, other->result_code_);
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 RackResponse::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RackResponse_descriptor_;
metadata.reflection = RackResponse_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int Shelf::kSxaxisFieldNumber;
const int Shelf::kSyaxisFieldNumber;
const int Shelf::kSheightFieldNumber;
const int Shelf::kSwidthFieldNumber;
const int Shelf::kSconfigurableFieldNumber;
const int Shelf::kCardInFieldNumber;
const int Shelf::kSlotInFieldNumber;
#endif // !_MSC_VER
Shelf::Shelf()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:Shelf)
}
void Shelf::InitAsDefaultInstance() {
}
Shelf::Shelf(const Shelf& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:Shelf)
}
void Shelf::SharedCtor() {
_cached_size_ = 0;
sxaxis_ = 0;
syaxis_ = 0;
sheight_ = 0;
swidth_ = 0;
sconfigurable_ = false;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Shelf::~Shelf() {
// @@protoc_insertion_point(destructor:Shelf)
SharedDtor();
}
void Shelf::SharedDtor() {
if (this != default_instance_) {
}
}
void Shelf::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Shelf::descriptor() {
protobuf_AssignDescriptorsOnce();
return Shelf_descriptor_;
}
const Shelf& Shelf::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Rack_2eproto();
return *default_instance_;
}
Shelf* Shelf::default_instance_ = NULL;
Shelf* Shelf::New() const {
return new Shelf;
}
void Shelf::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<Shelf*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if (_has_bits_[0 / 32] & 31) {
ZR_(sxaxis_, swidth_);
sconfigurable_ = false;
}
#undef OFFSET_OF_FIELD_
#undef ZR_
card_in_.Clear();
slot_in_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Shelf::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:Shelf)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required float sxaxis = 1;
case 1: {
if (tag == 13) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &sxaxis_)));
set_has_sxaxis();
} else {
goto handle_unusual;
}
if (input->ExpectTag(21)) goto parse_syaxis;
break;
}
// required float syaxis = 2;
case 2: {
if (tag == 21) {
parse_syaxis:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &syaxis_)));
set_has_syaxis();
} else {
goto handle_unusual;
}
if (input->ExpectTag(29)) goto parse_sheight;
break;
}
// required float sheight = 3;
case 3: {
if (tag == 29) {
parse_sheight:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &sheight_)));
set_has_sheight();
} else {
goto handle_unusual;
}
if (input->ExpectTag(37)) goto parse_swidth;
break;
}
// required float swidth = 4;
case 4: {
if (tag == 37) {
parse_swidth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &swidth_)));
set_has_swidth();
} else {
goto handle_unusual;
}
if (input->ExpectTag(40)) goto parse_sconfigurable;
break;
}
// required bool sconfigurable = 5;
case 5: {
if (tag == 40) {
parse_sconfigurable:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &sconfigurable_)));
set_has_sconfigurable();
} else {
goto handle_unusual;
}
if (input->ExpectTag(50)) goto parse_card_in;
break;
}
// repeated .Card card_in = 6;
case 6: {
if (tag == 50) {
parse_card_in:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_card_in()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(50)) goto parse_card_in;
if (input->ExpectTag(58)) goto parse_slot_in;
break;
}
// repeated .Slot slot_in = 7;
case 7: {
if (tag == 58) {
parse_slot_in:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_slot_in()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(58)) goto parse_slot_in;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:Shelf)
return true;
failure:
// @@protoc_insertion_point(parse_failure:Shelf)
return false;
#undef DO_
}
void Shelf::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:Shelf)
// required float sxaxis = 1;
if (has_sxaxis()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->sxaxis(), output);
}
// required float syaxis = 2;
if (has_syaxis()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->syaxis(), output);
}
// required float sheight = 3;
if (has_sheight()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->sheight(), output);
}
// required float swidth = 4;
if (has_swidth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->swidth(), output);
}
// required bool sconfigurable = 5;
if (has_sconfigurable()) {
::google::protobuf::internal::WireFormatLite::WriteBool(5, this->sconfigurable(), output);
}
// repeated .Card card_in = 6;
for (int i = 0; i < this->card_in_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
6, this->card_in(i), output);
}
// repeated .Slot slot_in = 7;
for (int i = 0; i < this->slot_in_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
7, this->slot_in(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:Shelf)
}
::google::protobuf::uint8* Shelf::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:Shelf)
// required float sxaxis = 1;
if (has_sxaxis()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->sxaxis(), target);
}
// required float syaxis = 2;
if (has_syaxis()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->syaxis(), target);
}
// required float sheight = 3;
if (has_sheight()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->sheight(), target);
}
// required float swidth = 4;
if (has_swidth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->swidth(), target);
}
// required bool sconfigurable = 5;
if (has_sconfigurable()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->sconfigurable(), target);
}
// repeated .Card card_in = 6;
for (int i = 0; i < this->card_in_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
6, this->card_in(i), target);
}
// repeated .Slot slot_in = 7;
for (int i = 0; i < this->slot_in_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
7, this->slot_in(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:Shelf)
return target;
}
int Shelf::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required float sxaxis = 1;
if (has_sxaxis()) {
total_size += 1 + 4;
}
// required float syaxis = 2;
if (has_syaxis()) {
total_size += 1 + 4;
}
// required float sheight = 3;
if (has_sheight()) {
total_size += 1 + 4;
}
// required float swidth = 4;
if (has_swidth()) {
total_size += 1 + 4;
}
// required bool sconfigurable = 5;
if (has_sconfigurable()) {
total_size += 1 + 1;
}
}
// repeated .Card card_in = 6;
total_size += 1 * this->card_in_size();
for (int i = 0; i < this->card_in_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->card_in(i));
}
// repeated .Slot slot_in = 7;
total_size += 1 * this->slot_in_size();
for (int i = 0; i < this->slot_in_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->slot_in(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 Shelf::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Shelf* source =
::google::protobuf::internal::dynamic_cast_if_available<const Shelf*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Shelf::MergeFrom(const Shelf& from) {
GOOGLE_CHECK_NE(&from, this);
card_in_.MergeFrom(from.card_in_);
slot_in_.MergeFrom(from.slot_in_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_sxaxis()) {
set_sxaxis(from.sxaxis());
}
if (from.has_syaxis()) {
set_syaxis(from.syaxis());
}
if (from.has_sheight()) {
set_sheight(from.sheight());
}
if (from.has_swidth()) {
set_swidth(from.swidth());
}
if (from.has_sconfigurable()) {
set_sconfigurable(from.sconfigurable());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Shelf::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Shelf::CopyFrom(const Shelf& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Shelf::IsInitialized() const {
if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->card_in())) return false;
if (!::google::protobuf::internal::AllAreInitialized(this->slot_in())) return false;
return true;
}
void Shelf::Swap(Shelf* other) {
if (other != this) {
std::swap(sxaxis_, other->sxaxis_);
std::swap(syaxis_, other->syaxis_);
std::swap(sheight_, other->sheight_);
std::swap(swidth_, other->swidth_);
std::swap(sconfigurable_, other->sconfigurable_);
card_in_.Swap(&other->card_in_);
slot_in_.Swap(&other->slot_in_);
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 Shelf::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Shelf_descriptor_;
metadata.reflection = Shelf_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int Card::kCxaxisFieldNumber;
const int Card::kCyaxisFieldNumber;
const int Card::kCheightFieldNumber;
const int Card::kCwidthFieldNumber;
const int Card::kCconfigurableFieldNumber;
const int Card::kPortFieldNumber;
#endif // !_MSC_VER
Card::Card()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:Card)
}
void Card::InitAsDefaultInstance() {
}
Card::Card(const Card& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:Card)
}
void Card::SharedCtor() {
_cached_size_ = 0;
cxaxis_ = 0;
cyaxis_ = 0;
cheight_ = 0;
cwidth_ = 0;
cconfigurable_ = false;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Card::~Card() {
// @@protoc_insertion_point(destructor:Card)
SharedDtor();
}
void Card::SharedDtor() {
if (this != default_instance_) {
}
}
void Card::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Card::descriptor() {
protobuf_AssignDescriptorsOnce();
return Card_descriptor_;
}
const Card& Card::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Rack_2eproto();
return *default_instance_;
}
Card* Card::default_instance_ = NULL;
Card* Card::New() const {
return new Card;
}
void Card::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<Card*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if (_has_bits_[0 / 32] & 31) {
ZR_(cxaxis_, cwidth_);
cconfigurable_ = false;
}
#undef OFFSET_OF_FIELD_
#undef ZR_
port_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Card::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:Card)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required float cxaxis = 1;
case 1: {
if (tag == 13) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cxaxis_)));
set_has_cxaxis();
} else {
goto handle_unusual;
}
if (input->ExpectTag(21)) goto parse_cyaxis;
break;
}
// required float cyaxis = 2;
case 2: {
if (tag == 21) {
parse_cyaxis:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cyaxis_)));
set_has_cyaxis();
} else {
goto handle_unusual;
}
if (input->ExpectTag(29)) goto parse_cheight;
break;
}
// required float cheight = 3;
case 3: {
if (tag == 29) {
parse_cheight:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cheight_)));
set_has_cheight();
} else {
goto handle_unusual;
}
if (input->ExpectTag(37)) goto parse_cwidth;
break;
}
// required float cwidth = 4;
case 4: {
if (tag == 37) {
parse_cwidth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cwidth_)));
set_has_cwidth();
} else {
goto handle_unusual;
}
if (input->ExpectTag(40)) goto parse_cconfigurable;
break;
}
// required bool cconfigurable = 5;
case 5: {
if (tag == 40) {
parse_cconfigurable:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &cconfigurable_)));
set_has_cconfigurable();
} else {
goto handle_unusual;
}
if (input->ExpectTag(48)) goto parse_port;
break;
}
// repeated int32 port = 6;
case 6: {
if (tag == 48) {
parse_port:
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1, 48, input, this->mutable_port())));
} else if (tag == 50) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, this->mutable_port())));
} else {
goto handle_unusual;
}
if (input->ExpectTag(48)) goto parse_port;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:Card)
return true;
failure:
// @@protoc_insertion_point(parse_failure:Card)
return false;
#undef DO_
}
void Card::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:Card)
// required float cxaxis = 1;
if (has_cxaxis()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->cxaxis(), output);
}
// required float cyaxis = 2;
if (has_cyaxis()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->cyaxis(), output);
}
// required float cheight = 3;
if (has_cheight()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->cheight(), output);
}
// required float cwidth = 4;
if (has_cwidth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->cwidth(), output);
}
// required bool cconfigurable = 5;
if (has_cconfigurable()) {
::google::protobuf::internal::WireFormatLite::WriteBool(5, this->cconfigurable(), output);
}
// repeated int32 port = 6;
for (int i = 0; i < this->port_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteInt32(
6, this->port(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:Card)
}
::google::protobuf::uint8* Card::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:Card)
// required float cxaxis = 1;
if (has_cxaxis()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->cxaxis(), target);
}
// required float cyaxis = 2;
if (has_cyaxis()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->cyaxis(), target);
}
// required float cheight = 3;
if (has_cheight()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->cheight(), target);
}
// required float cwidth = 4;
if (has_cwidth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->cwidth(), target);
}
// required bool cconfigurable = 5;
if (has_cconfigurable()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->cconfigurable(), target);
}
// repeated int32 port = 6;
for (int i = 0; i < this->port_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32ToArray(6, this->port(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:Card)
return target;
}
int Card::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required float cxaxis = 1;
if (has_cxaxis()) {
total_size += 1 + 4;
}
// required float cyaxis = 2;
if (has_cyaxis()) {
total_size += 1 + 4;
}
// required float cheight = 3;
if (has_cheight()) {
total_size += 1 + 4;
}
// required float cwidth = 4;
if (has_cwidth()) {
total_size += 1 + 4;
}
// required bool cconfigurable = 5;
if (has_cconfigurable()) {
total_size += 1 + 1;
}
}
// repeated int32 port = 6;
{
int data_size = 0;
for (int i = 0; i < this->port_size(); i++) {
data_size += ::google::protobuf::internal::WireFormatLite::
Int32Size(this->port(i));
}
total_size += 1 * this->port_size() + data_size;
}
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 Card::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Card* source =
::google::protobuf::internal::dynamic_cast_if_available<const Card*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Card::MergeFrom(const Card& from) {
GOOGLE_CHECK_NE(&from, this);
port_.MergeFrom(from.port_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cxaxis()) {
set_cxaxis(from.cxaxis());
}
if (from.has_cyaxis()) {
set_cyaxis(from.cyaxis());
}
if (from.has_cheight()) {
set_cheight(from.cheight());
}
if (from.has_cwidth()) {
set_cwidth(from.cwidth());
}
if (from.has_cconfigurable()) {
set_cconfigurable(from.cconfigurable());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Card::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Card::CopyFrom(const Card& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Card::IsInitialized() const {
if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
return true;
}
void Card::Swap(Card* other) {
if (other != this) {
std::swap(cxaxis_, other->cxaxis_);
std::swap(cyaxis_, other->cyaxis_);
std::swap(cheight_, other->cheight_);
std::swap(cwidth_, other->cwidth_);
std::swap(cconfigurable_, other->cconfigurable_);
port_.Swap(&other->port_);
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 Card::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Card_descriptor_;
metadata.reflection = Card_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int Slot::kCxaxisFieldNumber;
const int Slot::kCyaxisFieldNumber;
const int Slot::kCheightFieldNumber;
const int Slot::kCwidthFieldNumber;
const int Slot::kCconfigurableFieldNumber;
const int Slot::kPortFieldNumber;
#endif // !_MSC_VER
Slot::Slot()
: ::google::protobuf::Message() {
SharedCtor();
// @@protoc_insertion_point(constructor:Slot)
}
void Slot::InitAsDefaultInstance() {
}
Slot::Slot(const Slot& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:Slot)
}
void Slot::SharedCtor() {
_cached_size_ = 0;
cxaxis_ = 0;
cyaxis_ = 0;
cheight_ = 0;
cwidth_ = 0;
cconfigurable_ = false;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
Slot::~Slot() {
// @@protoc_insertion_point(destructor:Slot)
SharedDtor();
}
void Slot::SharedDtor() {
if (this != default_instance_) {
}
}
void Slot::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Slot::descriptor() {
protobuf_AssignDescriptorsOnce();
return Slot_descriptor_;
}
const Slot& Slot::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_Rack_2eproto();
return *default_instance_;
}
Slot* Slot::default_instance_ = NULL;
Slot* Slot::New() const {
return new Slot;
}
void Slot::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<Slot*>(16)->f) - \
reinterpret_cast<char*>(16))
#define ZR_(first, last) do { \
size_t f = OFFSET_OF_FIELD_(first); \
size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \
::memset(&first, 0, n); \
} while (0)
if (_has_bits_[0 / 32] & 31) {
ZR_(cxaxis_, cwidth_);
cconfigurable_ = false;
}
#undef OFFSET_OF_FIELD_
#undef ZR_
port_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool Slot::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:Slot)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// required float cxaxis = 1;
case 1: {
if (tag == 13) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cxaxis_)));
set_has_cxaxis();
} else {
goto handle_unusual;
}
if (input->ExpectTag(21)) goto parse_cyaxis;
break;
}
// required float cyaxis = 2;
case 2: {
if (tag == 21) {
parse_cyaxis:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cyaxis_)));
set_has_cyaxis();
} else {
goto handle_unusual;
}
if (input->ExpectTag(29)) goto parse_cheight;
break;
}
// required float cheight = 3;
case 3: {
if (tag == 29) {
parse_cheight:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cheight_)));
set_has_cheight();
} else {
goto handle_unusual;
}
if (input->ExpectTag(37)) goto parse_cwidth;
break;
}
// required float cwidth = 4;
case 4: {
if (tag == 37) {
parse_cwidth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &cwidth_)));
set_has_cwidth();
} else {
goto handle_unusual;
}
if (input->ExpectTag(40)) goto parse_cconfigurable;
break;
}
// required bool cconfigurable = 5;
case 5: {
if (tag == 40) {
parse_cconfigurable:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &cconfigurable_)));
set_has_cconfigurable();
} else {
goto handle_unusual;
}
if (input->ExpectTag(48)) goto parse_port;
break;
}
// repeated int32 port = 6;
case 6: {
if (tag == 48) {
parse_port:
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
1, 48, input, this->mutable_port())));
} else if (tag == 50) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, this->mutable_port())));
} else {
goto handle_unusual;
}
if (input->ExpectTag(48)) goto parse_port;
if (input->ExpectAtEnd()) goto success;
break;
}
default: {
handle_unusual:
if (tag == 0 ||
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
goto success;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:Slot)
return true;
failure:
// @@protoc_insertion_point(parse_failure:Slot)
return false;
#undef DO_
}
void Slot::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:Slot)
// required float cxaxis = 1;
if (has_cxaxis()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->cxaxis(), output);
}
// required float cyaxis = 2;
if (has_cyaxis()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->cyaxis(), output);
}
// required float cheight = 3;
if (has_cheight()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->cheight(), output);
}
// required float cwidth = 4;
if (has_cwidth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->cwidth(), output);
}
// required bool cconfigurable = 5;
if (has_cconfigurable()) {
::google::protobuf::internal::WireFormatLite::WriteBool(5, this->cconfigurable(), output);
}
// repeated int32 port = 6;
for (int i = 0; i < this->port_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteInt32(
6, this->port(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
// @@protoc_insertion_point(serialize_end:Slot)
}
::google::protobuf::uint8* Slot::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:Slot)
// required float cxaxis = 1;
if (has_cxaxis()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->cxaxis(), target);
}
// required float cyaxis = 2;
if (has_cyaxis()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->cyaxis(), target);
}
// required float cheight = 3;
if (has_cheight()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->cheight(), target);
}
// required float cwidth = 4;
if (has_cwidth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->cwidth(), target);
}
// required bool cconfigurable = 5;
if (has_cconfigurable()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->cconfigurable(), target);
}
// repeated int32 port = 6;
for (int i = 0; i < this->port_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteInt32ToArray(6, this->port(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:Slot)
return target;
}
int Slot::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// required float cxaxis = 1;
if (has_cxaxis()) {
total_size += 1 + 4;
}
// required float cyaxis = 2;
if (has_cyaxis()) {
total_size += 1 + 4;
}
// required float cheight = 3;
if (has_cheight()) {
total_size += 1 + 4;
}
// required float cwidth = 4;
if (has_cwidth()) {
total_size += 1 + 4;
}
// required bool cconfigurable = 5;
if (has_cconfigurable()) {
total_size += 1 + 1;
}
}
// repeated int32 port = 6;
{
int data_size = 0;
for (int i = 0; i < this->port_size(); i++) {
data_size += ::google::protobuf::internal::WireFormatLite::
Int32Size(this->port(i));
}
total_size += 1 * this->port_size() + data_size;
}
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 Slot::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const Slot* source =
::google::protobuf::internal::dynamic_cast_if_available<const Slot*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Slot::MergeFrom(const Slot& from) {
GOOGLE_CHECK_NE(&from, this);
port_.MergeFrom(from.port_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_cxaxis()) {
set_cxaxis(from.cxaxis());
}
if (from.has_cyaxis()) {
set_cyaxis(from.cyaxis());
}
if (from.has_cheight()) {
set_cheight(from.cheight());
}
if (from.has_cwidth()) {
set_cwidth(from.cwidth());
}
if (from.has_cconfigurable()) {
set_cconfigurable(from.cconfigurable());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void Slot::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Slot::CopyFrom(const Slot& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Slot::IsInitialized() const {
if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
return true;
}
void Slot::Swap(Slot* other) {
if (other != this) {
std::swap(cxaxis_, other->cxaxis_);
std::swap(cyaxis_, other->cyaxis_);
std::swap(cheight_, other->cheight_);
std::swap(cwidth_, other->cwidth_);
std::swap(cconfigurable_, other->cconfigurable_);
port_.Swap(&other->port_);
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 Slot::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Slot_descriptor_;
metadata.reflection = Slot_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
// @@protoc_insertion_point(global_scope)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rack.proto
Type: application/octet-stream
Size: 1177 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160609/d5df2446/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rack.pb.h
Type: text/x-chdr
Size: 46687 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160609/d5df2446/attachment.h>
More information about the zeromq-dev
mailing list