The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1736 lines
56 KiB

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "route_guide.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>
#include <grpc++/async_unary_call.h>
#include <grpc++/channel_interface.h>
#include <grpc++/impl/client_unary_call.h>
#include <grpc++/impl/rpc_method.h>
#include <grpc++/impl/rpc_service_method.h>
#include <grpc++/impl/service_type.h>
#include <grpc++/stream.h>
// @@protoc_insertion_point(includes)
namespace examples {
namespace {
const ::google::protobuf::Descriptor* Point_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Point_reflection_ = NULL;
const ::google::protobuf::Descriptor* Rectangle_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Rectangle_reflection_ = NULL;
const ::google::protobuf::Descriptor* Feature_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
Feature_reflection_ = NULL;
const ::google::protobuf::Descriptor* RouteNote_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RouteNote_reflection_ = NULL;
const ::google::protobuf::Descriptor* RouteSummary_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RouteSummary_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_route_5fguide_2eproto() {
protobuf_AddDesc_route_5fguide_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"route_guide.proto");
GOOGLE_CHECK(file != NULL);
Point_descriptor_ = file->message_type(0);
static const int Point_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Point, latitude_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Point, longitude_),
};
Point_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
Point_descriptor_,
Point::default_instance_,
Point_offsets_,
-1,
-1,
-1,
sizeof(Point),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Point, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Point, _is_default_instance_));
Rectangle_descriptor_ = file->message_type(1);
static const int Rectangle_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Rectangle, lo_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Rectangle, hi_),
};
Rectangle_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
Rectangle_descriptor_,
Rectangle::default_instance_,
Rectangle_offsets_,
-1,
-1,
-1,
sizeof(Rectangle),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Rectangle, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Rectangle, _is_default_instance_));
Feature_descriptor_ = file->message_type(2);
static const int Feature_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Feature, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Feature, location_),
};
Feature_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
Feature_descriptor_,
Feature::default_instance_,
Feature_offsets_,
-1,
-1,
-1,
sizeof(Feature),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Feature, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Feature, _is_default_instance_));
RouteNote_descriptor_ = file->message_type(3);
static const int RouteNote_offsets_[2] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteNote, location_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteNote, message_),
};
RouteNote_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
RouteNote_descriptor_,
RouteNote::default_instance_,
RouteNote_offsets_,
-1,
-1,
-1,
sizeof(RouteNote),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteNote, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteNote, _is_default_instance_));
RouteSummary_descriptor_ = file->message_type(4);
static const int RouteSummary_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteSummary, point_count_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteSummary, feature_count_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteSummary, distance_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteSummary, elapsed_time_),
};
RouteSummary_reflection_ =
::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
RouteSummary_descriptor_,
RouteSummary::default_instance_,
RouteSummary_offsets_,
-1,
-1,
-1,
sizeof(RouteSummary),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteSummary, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RouteSummary, _is_default_instance_));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_route_5fguide_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Point_descriptor_, &Point::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Rectangle_descriptor_, &Rectangle::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
Feature_descriptor_, &Feature::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RouteNote_descriptor_, &RouteNote::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RouteSummary_descriptor_, &RouteSummary::default_instance());
}
} // namespace
void protobuf_ShutdownFile_route_5fguide_2eproto() {
delete Point::default_instance_;
delete Point_reflection_;
delete Rectangle::default_instance_;
delete Rectangle_reflection_;
delete Feature::default_instance_;
delete Feature_reflection_;
delete RouteNote::default_instance_;
delete RouteNote_reflection_;
delete RouteSummary::default_instance_;
delete RouteSummary_reflection_;
}
void protobuf_AddDesc_route_5fguide_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\021route_guide.proto\022\010examples\",\n\005Point\022\020"
"\n\010latitude\030\001 \001(\005\022\021\n\tlongitude\030\002 \001(\005\"E\n\tR"
"ectangle\022\033\n\002lo\030\001 \001(\0132\017.examples.Point\022\033\n"
"\002hi\030\002 \001(\0132\017.examples.Point\":\n\007Feature\022\014\n"
"\004name\030\001 \001(\t\022!\n\010location\030\002 \001(\0132\017.examples"
".Point\"\?\n\tRouteNote\022!\n\010location\030\001 \001(\0132\017."
"examples.Point\022\017\n\007message\030\002 \001(\t\"b\n\014Route"
"Summary\022\023\n\013point_count\030\001 \001(\005\022\025\n\rfeature_"
"count\030\002 \001(\005\022\020\n\010distance\030\003 \001(\005\022\024\n\014elapsed"
"_time\030\004 \001(\0052\365\001\n\nRouteGuide\0222\n\nGetFeature"
"\022\017.examples.Point\032\021.examples.Feature\"\000\022:"
"\n\014ListFeatures\022\023.examples.Rectangle\032\021.ex"
"amples.Feature\"\0000\001\022:\n\013RecordRoute\022\017.exam"
"ples.Point\032\026.examples.RouteSummary\"\000(\001\022;"
"\n\tRouteChat\022\023.examples.RouteNote\032\023.examp"
"les.RouteNote\"\000(\0010\001B\t\n\007ex.grpcb\006proto3", 638);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"route_guide.proto", &protobuf_RegisterTypes);
Point::default_instance_ = new Point();
Rectangle::default_instance_ = new Rectangle();
Feature::default_instance_ = new Feature();
RouteNote::default_instance_ = new RouteNote();
RouteSummary::default_instance_ = new RouteSummary();
Point::default_instance_->InitAsDefaultInstance();
Rectangle::default_instance_->InitAsDefaultInstance();
Feature::default_instance_->InitAsDefaultInstance();
RouteNote::default_instance_->InitAsDefaultInstance();
RouteSummary::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_route_5fguide_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_route_5fguide_2eproto {
StaticDescriptorInitializer_route_5fguide_2eproto() {
protobuf_AddDesc_route_5fguide_2eproto();
}
} static_descriptor_initializer_route_5fguide_2eproto_;
namespace {
static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD;
static void MergeFromFail(int line) {
GOOGLE_CHECK(false) << __FILE__ << ":" << line;
}
} // namespace
// ===================================================================
#ifndef _MSC_VER
const int Point::kLatitudeFieldNumber;
const int Point::kLongitudeFieldNumber;
#endif // !_MSC_VER
Point::Point()
: ::google::protobuf::Message() , _internal_metadata_(NULL) {
SharedCtor();
// @@protoc_insertion_point(constructor:examples.Point)
}
void Point::InitAsDefaultInstance() {
_is_default_instance_ = true;
}
Point::Point(const Point& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:examples.Point)
}
void Point::SharedCtor() {
_is_default_instance_ = false;
_cached_size_ = 0;
latitude_ = 0;
longitude_ = 0;
}
Point::~Point() {
// @@protoc_insertion_point(destructor:examples.Point)
SharedDtor();
}
void Point::SharedDtor() {
if (this != default_instance_) {
}
}
void Point::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Point::descriptor() {
protobuf_AssignDescriptorsOnce();
return Point_descriptor_;
}
const Point& Point::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_route_5fguide_2eproto();
return *default_instance_;
}
Point* Point::default_instance_ = NULL;
Point* Point::New(::google::protobuf::Arena* arena) const {
Point* n = new Point;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void Point::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<Point*>(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_(latitude_, longitude_);
#undef OFFSET_OF_FIELD_
#undef ZR_
}
bool Point::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:examples.Point)
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)) {
// optional int32 latitude = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &latitude_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_longitude;
break;
}
// optional int32 longitude = 2;
case 2: {
if (tag == 16) {
parse_longitude:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &longitude_)));
} 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::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:examples.Point)
return true;
failure:
// @@protoc_insertion_point(parse_failure:examples.Point)
return false;
#undef DO_
}
void Point::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:examples.Point)
// optional int32 latitude = 1;
if (this->latitude() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->latitude(), output);
}
// optional int32 longitude = 2;
if (this->longitude() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->longitude(), output);
}
// @@protoc_insertion_point(serialize_end:examples.Point)
}
::google::protobuf::uint8* Point::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:examples.Point)
// optional int32 latitude = 1;
if (this->latitude() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->latitude(), target);
}
// optional int32 longitude = 2;
if (this->longitude() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->longitude(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:examples.Point)
return target;
}
int Point::ByteSize() const {
int total_size = 0;
// optional int32 latitude = 1;
if (this->latitude() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->latitude());
}
// optional int32 longitude = 2;
if (this->longitude() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->longitude());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Point::MergeFrom(const ::google::protobuf::Message& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const Point* source =
::google::protobuf::internal::dynamic_cast_if_available<const Point*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Point::MergeFrom(const Point& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
if (from.latitude() != 0) {
set_latitude(from.latitude());
}
if (from.longitude() != 0) {
set_longitude(from.longitude());
}
}
void Point::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Point::CopyFrom(const Point& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Point::IsInitialized() const {
return true;
}
void Point::Swap(Point* other) {
if (other == this) return;
InternalSwap(other);
}
void Point::InternalSwap(Point* other) {
std::swap(latitude_, other->latitude_);
std::swap(longitude_, other->longitude_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata Point::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Point_descriptor_;
metadata.reflection = Point_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int Rectangle::kLoFieldNumber;
const int Rectangle::kHiFieldNumber;
#endif // !_MSC_VER
Rectangle::Rectangle()
: ::google::protobuf::Message() , _internal_metadata_(NULL) {
SharedCtor();
// @@protoc_insertion_point(constructor:examples.Rectangle)
}
void Rectangle::InitAsDefaultInstance() {
_is_default_instance_ = true;
lo_ = const_cast< ::examples::Point*>(&::examples::Point::default_instance());
hi_ = const_cast< ::examples::Point*>(&::examples::Point::default_instance());
}
Rectangle::Rectangle(const Rectangle& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:examples.Rectangle)
}
void Rectangle::SharedCtor() {
_is_default_instance_ = false;
_cached_size_ = 0;
lo_ = NULL;
hi_ = NULL;
}
Rectangle::~Rectangle() {
// @@protoc_insertion_point(destructor:examples.Rectangle)
SharedDtor();
}
void Rectangle::SharedDtor() {
if (this != default_instance_) {
delete lo_;
delete hi_;
}
}
void Rectangle::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Rectangle::descriptor() {
protobuf_AssignDescriptorsOnce();
return Rectangle_descriptor_;
}
const Rectangle& Rectangle::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_route_5fguide_2eproto();
return *default_instance_;
}
Rectangle* Rectangle::default_instance_ = NULL;
Rectangle* Rectangle::New(::google::protobuf::Arena* arena) const {
Rectangle* n = new Rectangle;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void Rectangle::Clear() {
if (lo_ != NULL) delete lo_;
lo_ = NULL;
if (hi_ != NULL) delete hi_;
hi_ = NULL;
}
bool Rectangle::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:examples.Rectangle)
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)) {
// optional .examples.Point lo = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_lo()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_hi;
break;
}
// optional .examples.Point hi = 2;
case 2: {
if (tag == 18) {
parse_hi:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_hi()));
} 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::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:examples.Rectangle)
return true;
failure:
// @@protoc_insertion_point(parse_failure:examples.Rectangle)
return false;
#undef DO_
}
void Rectangle::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:examples.Rectangle)
// optional .examples.Point lo = 1;
if (this->has_lo()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, *this->lo_, output);
}
// optional .examples.Point hi = 2;
if (this->has_hi()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *this->hi_, output);
}
// @@protoc_insertion_point(serialize_end:examples.Rectangle)
}
::google::protobuf::uint8* Rectangle::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:examples.Rectangle)
// optional .examples.Point lo = 1;
if (this->has_lo()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
1, *this->lo_, target);
}
// optional .examples.Point hi = 2;
if (this->has_hi()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, *this->hi_, target);
}
// @@protoc_insertion_point(serialize_to_array_end:examples.Rectangle)
return target;
}
int Rectangle::ByteSize() const {
int total_size = 0;
// optional .examples.Point lo = 1;
if (this->has_lo()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
*this->lo_);
}
// optional .examples.Point hi = 2;
if (this->has_hi()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
*this->hi_);
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Rectangle::MergeFrom(const ::google::protobuf::Message& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const Rectangle* source =
::google::protobuf::internal::dynamic_cast_if_available<const Rectangle*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Rectangle::MergeFrom(const Rectangle& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
if (from.has_lo()) {
mutable_lo()->::examples::Point::MergeFrom(from.lo());
}
if (from.has_hi()) {
mutable_hi()->::examples::Point::MergeFrom(from.hi());
}
}
void Rectangle::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Rectangle::CopyFrom(const Rectangle& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Rectangle::IsInitialized() const {
return true;
}
void Rectangle::Swap(Rectangle* other) {
if (other == this) return;
InternalSwap(other);
}
void Rectangle::InternalSwap(Rectangle* other) {
std::swap(lo_, other->lo_);
std::swap(hi_, other->hi_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata Rectangle::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Rectangle_descriptor_;
metadata.reflection = Rectangle_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int Feature::kNameFieldNumber;
const int Feature::kLocationFieldNumber;
#endif // !_MSC_VER
Feature::Feature()
: ::google::protobuf::Message() , _internal_metadata_(NULL) {
SharedCtor();
// @@protoc_insertion_point(constructor:examples.Feature)
}
void Feature::InitAsDefaultInstance() {
_is_default_instance_ = true;
location_ = const_cast< ::examples::Point*>(&::examples::Point::default_instance());
}
Feature::Feature(const Feature& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:examples.Feature)
}
void Feature::SharedCtor() {
_is_default_instance_ = false;
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
location_ = NULL;
}
Feature::~Feature() {
// @@protoc_insertion_point(destructor:examples.Feature)
SharedDtor();
}
void Feature::SharedDtor() {
name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (this != default_instance_) {
delete location_;
}
}
void Feature::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Feature::descriptor() {
protobuf_AssignDescriptorsOnce();
return Feature_descriptor_;
}
const Feature& Feature::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_route_5fguide_2eproto();
return *default_instance_;
}
Feature* Feature::default_instance_ = NULL;
Feature* Feature::New(::google::protobuf::Arena* arena) const {
Feature* n = new Feature;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void Feature::Clear() {
name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (location_ != NULL) delete location_;
location_ = NULL;
}
bool Feature::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:examples.Feature)
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)) {
// optional string name = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_name()));
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormat::PARSE,
"examples.Feature.name");
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_location;
break;
}
// optional .examples.Point location = 2;
case 2: {
if (tag == 18) {
parse_location:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_location()));
} 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::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:examples.Feature)
return true;
failure:
// @@protoc_insertion_point(parse_failure:examples.Feature)
return false;
#undef DO_
}
void Feature::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:examples.Feature)
// optional string name = 1;
if (this->name().size() > 0) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"examples.Feature.name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
// optional .examples.Point location = 2;
if (this->has_location()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *this->location_, output);
}
// @@protoc_insertion_point(serialize_end:examples.Feature)
}
::google::protobuf::uint8* Feature::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:examples.Feature)
// optional string name = 1;
if (this->name().size() > 0) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->name().data(), this->name().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"examples.Feature.name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
}
// optional .examples.Point location = 2;
if (this->has_location()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
2, *this->location_, target);
}
// @@protoc_insertion_point(serialize_to_array_end:examples.Feature)
return target;
}
int Feature::ByteSize() const {
int total_size = 0;
// optional string name = 1;
if (this->name().size() > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->name());
}
// optional .examples.Point location = 2;
if (this->has_location()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
*this->location_);
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void Feature::MergeFrom(const ::google::protobuf::Message& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const Feature* source =
::google::protobuf::internal::dynamic_cast_if_available<const Feature*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void Feature::MergeFrom(const Feature& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
if (from.name().size() > 0) {
name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
}
if (from.has_location()) {
mutable_location()->::examples::Point::MergeFrom(from.location());
}
}
void Feature::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Feature::CopyFrom(const Feature& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Feature::IsInitialized() const {
return true;
}
void Feature::Swap(Feature* other) {
if (other == this) return;
InternalSwap(other);
}
void Feature::InternalSwap(Feature* other) {
name_.Swap(&other->name_);
std::swap(location_, other->location_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata Feature::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = Feature_descriptor_;
metadata.reflection = Feature_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int RouteNote::kLocationFieldNumber;
const int RouteNote::kMessageFieldNumber;
#endif // !_MSC_VER
RouteNote::RouteNote()
: ::google::protobuf::Message() , _internal_metadata_(NULL) {
SharedCtor();
// @@protoc_insertion_point(constructor:examples.RouteNote)
}
void RouteNote::InitAsDefaultInstance() {
_is_default_instance_ = true;
location_ = const_cast< ::examples::Point*>(&::examples::Point::default_instance());
}
RouteNote::RouteNote(const RouteNote& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:examples.RouteNote)
}
void RouteNote::SharedCtor() {
_is_default_instance_ = false;
::google::protobuf::internal::GetEmptyString();
_cached_size_ = 0;
location_ = NULL;
message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
RouteNote::~RouteNote() {
// @@protoc_insertion_point(destructor:examples.RouteNote)
SharedDtor();
}
void RouteNote::SharedDtor() {
message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
if (this != default_instance_) {
delete location_;
}
}
void RouteNote::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RouteNote::descriptor() {
protobuf_AssignDescriptorsOnce();
return RouteNote_descriptor_;
}
const RouteNote& RouteNote::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_route_5fguide_2eproto();
return *default_instance_;
}
RouteNote* RouteNote::default_instance_ = NULL;
RouteNote* RouteNote::New(::google::protobuf::Arena* arena) const {
RouteNote* n = new RouteNote;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void RouteNote::Clear() {
if (location_ != NULL) delete location_;
location_ = NULL;
message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
bool RouteNote::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:examples.RouteNote)
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)) {
// optional .examples.Point location = 1;
case 1: {
if (tag == 10) {
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, mutable_location()));
} else {
goto handle_unusual;
}
if (input->ExpectTag(18)) goto parse_message;
break;
}
// optional string message = 2;
case 2: {
if (tag == 18) {
parse_message:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_message()));
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::PARSE,
"examples.RouteNote.message");
} 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::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:examples.RouteNote)
return true;
failure:
// @@protoc_insertion_point(parse_failure:examples.RouteNote)
return false;
#undef DO_
}
void RouteNote::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:examples.RouteNote)
// optional .examples.Point location = 1;
if (this->has_location()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, *this->location_, output);
}
// optional string message = 2;
if (this->message().size() > 0) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"examples.RouteNote.message");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->message(), output);
}
// @@protoc_insertion_point(serialize_end:examples.RouteNote)
}
::google::protobuf::uint8* RouteNote::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:examples.RouteNote)
// optional .examples.Point location = 1;
if (this->has_location()) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
1, *this->location_, target);
}
// optional string message = 2;
if (this->message().size() > 0) {
::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
this->message().data(), this->message().length(),
::google::protobuf::internal::WireFormat::SERIALIZE,
"examples.RouteNote.message");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->message(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:examples.RouteNote)
return target;
}
int RouteNote::ByteSize() const {
int total_size = 0;
// optional .examples.Point location = 1;
if (this->has_location()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
*this->location_);
}
// optional string message = 2;
if (this->message().size() > 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->message());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RouteNote::MergeFrom(const ::google::protobuf::Message& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const RouteNote* source =
::google::protobuf::internal::dynamic_cast_if_available<const RouteNote*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RouteNote::MergeFrom(const RouteNote& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
if (from.has_location()) {
mutable_location()->::examples::Point::MergeFrom(from.location());
}
if (from.message().size() > 0) {
message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.message_);
}
}
void RouteNote::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RouteNote::CopyFrom(const RouteNote& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RouteNote::IsInitialized() const {
return true;
}
void RouteNote::Swap(RouteNote* other) {
if (other == this) return;
InternalSwap(other);
}
void RouteNote::InternalSwap(RouteNote* other) {
std::swap(location_, other->location_);
message_.Swap(&other->message_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata RouteNote::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RouteNote_descriptor_;
metadata.reflection = RouteNote_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int RouteSummary::kPointCountFieldNumber;
const int RouteSummary::kFeatureCountFieldNumber;
const int RouteSummary::kDistanceFieldNumber;
const int RouteSummary::kElapsedTimeFieldNumber;
#endif // !_MSC_VER
RouteSummary::RouteSummary()
: ::google::protobuf::Message() , _internal_metadata_(NULL) {
SharedCtor();
// @@protoc_insertion_point(constructor:examples.RouteSummary)
}
void RouteSummary::InitAsDefaultInstance() {
_is_default_instance_ = true;
}
RouteSummary::RouteSummary(const RouteSummary& from)
: ::google::protobuf::Message(),
_internal_metadata_(NULL) {
SharedCtor();
MergeFrom(from);
// @@protoc_insertion_point(copy_constructor:examples.RouteSummary)
}
void RouteSummary::SharedCtor() {
_is_default_instance_ = false;
_cached_size_ = 0;
point_count_ = 0;
feature_count_ = 0;
distance_ = 0;
elapsed_time_ = 0;
}
RouteSummary::~RouteSummary() {
// @@protoc_insertion_point(destructor:examples.RouteSummary)
SharedDtor();
}
void RouteSummary::SharedDtor() {
if (this != default_instance_) {
}
}
void RouteSummary::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RouteSummary::descriptor() {
protobuf_AssignDescriptorsOnce();
return RouteSummary_descriptor_;
}
const RouteSummary& RouteSummary::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_route_5fguide_2eproto();
return *default_instance_;
}
RouteSummary* RouteSummary::default_instance_ = NULL;
RouteSummary* RouteSummary::New(::google::protobuf::Arena* arena) const {
RouteSummary* n = new RouteSummary;
if (arena != NULL) {
arena->Own(n);
}
return n;
}
void RouteSummary::Clear() {
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \
&reinterpret_cast<RouteSummary*>(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_(point_count_, elapsed_time_);
#undef OFFSET_OF_FIELD_
#undef ZR_
}
bool RouteSummary::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:examples.RouteSummary)
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)) {
// optional int32 point_count = 1;
case 1: {
if (tag == 8) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &point_count_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(16)) goto parse_feature_count;
break;
}
// optional int32 feature_count = 2;
case 2: {
if (tag == 16) {
parse_feature_count:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &feature_count_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(24)) goto parse_distance;
break;
}
// optional int32 distance = 3;
case 3: {
if (tag == 24) {
parse_distance:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &distance_)));
} else {
goto handle_unusual;
}
if (input->ExpectTag(32)) goto parse_elapsed_time;
break;
}
// optional int32 elapsed_time = 4;
case 4: {
if (tag == 32) {
parse_elapsed_time:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &elapsed_time_)));
} 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::WireFormatLite::SkipField(input, tag));
break;
}
}
}
success:
// @@protoc_insertion_point(parse_success:examples.RouteSummary)
return true;
failure:
// @@protoc_insertion_point(parse_failure:examples.RouteSummary)
return false;
#undef DO_
}
void RouteSummary::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:examples.RouteSummary)
// optional int32 point_count = 1;
if (this->point_count() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->point_count(), output);
}
// optional int32 feature_count = 2;
if (this->feature_count() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->feature_count(), output);
}
// optional int32 distance = 3;
if (this->distance() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->distance(), output);
}
// optional int32 elapsed_time = 4;
if (this->elapsed_time() != 0) {
::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->elapsed_time(), output);
}
// @@protoc_insertion_point(serialize_end:examples.RouteSummary)
}
::google::protobuf::uint8* RouteSummary::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// @@protoc_insertion_point(serialize_to_array_start:examples.RouteSummary)
// optional int32 point_count = 1;
if (this->point_count() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->point_count(), target);
}
// optional int32 feature_count = 2;
if (this->feature_count() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->feature_count(), target);
}
// optional int32 distance = 3;
if (this->distance() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->distance(), target);
}
// optional int32 elapsed_time = 4;
if (this->elapsed_time() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->elapsed_time(), target);
}
// @@protoc_insertion_point(serialize_to_array_end:examples.RouteSummary)
return target;
}
int RouteSummary::ByteSize() const {
int total_size = 0;
// optional int32 point_count = 1;
if (this->point_count() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->point_count());
}
// optional int32 feature_count = 2;
if (this->feature_count() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->feature_count());
}
// optional int32 distance = 3;
if (this->distance() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->distance());
}
// optional int32 elapsed_time = 4;
if (this->elapsed_time() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->elapsed_time());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RouteSummary::MergeFrom(const ::google::protobuf::Message& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
const RouteSummary* source =
::google::protobuf::internal::dynamic_cast_if_available<const RouteSummary*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RouteSummary::MergeFrom(const RouteSummary& from) {
if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__);
if (from.point_count() != 0) {
set_point_count(from.point_count());
}
if (from.feature_count() != 0) {
set_feature_count(from.feature_count());
}
if (from.distance() != 0) {
set_distance(from.distance());
}
if (from.elapsed_time() != 0) {
set_elapsed_time(from.elapsed_time());
}
}
void RouteSummary::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RouteSummary::CopyFrom(const RouteSummary& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RouteSummary::IsInitialized() const {
return true;
}
void RouteSummary::Swap(RouteSummary* other) {
if (other == this) return;
InternalSwap(other);
}
void RouteSummary::InternalSwap(RouteSummary* other) {
std::swap(point_count_, other->point_count_);
std::swap(feature_count_, other->feature_count_);
std::swap(distance_, other->distance_);
std::swap(elapsed_time_, other->elapsed_time_);
_internal_metadata_.Swap(&other->_internal_metadata_);
std::swap(_cached_size_, other->_cached_size_);
}
::google::protobuf::Metadata RouteSummary::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RouteSummary_descriptor_;
metadata.reflection = RouteSummary_reflection_;
return metadata;
}
static const char* RouteGuide_method_names[] = {
"/examples.RouteGuide/GetFeature",
"/examples.RouteGuide/ListFeatures",
"/examples.RouteGuide/RecordRoute",
"/examples.RouteGuide/RouteChat",
};
RouteGuide::Stub* RouteGuide::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) {
RouteGuide::Stub* stub = new RouteGuide::Stub();
stub->set_channel(channel);
return stub;
};
::grpc::Status RouteGuide::Stub::GetFeature(::grpc::ClientContext* context, const ::examples::Point& request, ::examples::Feature* response) {
return ::grpc::BlockingUnaryCall(channel(),::grpc::RpcMethod(RouteGuide_method_names[0]), context, request, response);
}
::grpc::ClientAsyncResponseReader< ::examples::Feature>* RouteGuide::Stub::GetFeature(::grpc::ClientContext* context, const ::examples::Point& request, ::grpc::CompletionQueue* cq, void* tag) {
return new ::grpc::ClientAsyncResponseReader< ::examples::Feature>(channel(), cq, ::grpc::RpcMethod(RouteGuide_method_names[0]), context, request, tag);
}
::grpc::ClientReader< ::examples::Feature>* RouteGuide::Stub::ListFeatures(::grpc::ClientContext* context, const ::examples::Rectangle& request) {
return new ::grpc::ClientReader< ::examples::Feature>(channel(),::grpc::RpcMethod(RouteGuide_method_names[1], ::grpc::RpcMethod::RpcType::SERVER_STREAMING), context, request);
}
::grpc::ClientAsyncReader< ::examples::Feature>* RouteGuide::Stub::ListFeatures(::grpc::ClientContext* context, const ::examples::Rectangle& request, ::grpc::CompletionQueue* cq, void* tag) {
return new ::grpc::ClientAsyncReader< ::examples::Feature>(channel(), cq, ::grpc::RpcMethod(RouteGuide_method_names[1], ::grpc::RpcMethod::RpcType::SERVER_STREAMING), context, request, tag);
}
::grpc::ClientWriter< ::examples::Point>* RouteGuide::Stub::RecordRoute(::grpc::ClientContext* context, ::examples::RouteSummary* response) {
return new ::grpc::ClientWriter< ::examples::Point>(channel(),::grpc::RpcMethod(RouteGuide_method_names[2], ::grpc::RpcMethod::RpcType::CLIENT_STREAMING), context, response);
}
::grpc::ClientAsyncWriter< ::examples::Point>* RouteGuide::Stub::RecordRoute(::grpc::ClientContext* context, ::examples::RouteSummary* response, ::grpc::CompletionQueue* cq, void* tag) {
return new ::grpc::ClientAsyncWriter< ::examples::Point>(channel(), cq, ::grpc::RpcMethod(RouteGuide_method_names[2], ::grpc::RpcMethod::RpcType::CLIENT_STREAMING), context, response, tag);
}
::grpc::ClientReaderWriter< ::examples::RouteNote, ::examples::RouteNote>* RouteGuide::Stub::RouteChat(::grpc::ClientContext* context) {
return new ::grpc::ClientReaderWriter< ::examples::RouteNote, ::examples::RouteNote>(channel(),::grpc::RpcMethod(RouteGuide_method_names[3], ::grpc::RpcMethod::RpcType::BIDI_STREAMING), context);
}
::grpc::ClientAsyncReaderWriter< ::examples::RouteNote, ::examples::RouteNote>* RouteGuide::Stub::RouteChat(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) {
return new ::grpc::ClientAsyncReaderWriter< ::examples::RouteNote, ::examples::RouteNote>(channel(), cq, ::grpc::RpcMethod(RouteGuide_method_names[3], ::grpc::RpcMethod::RpcType::BIDI_STREAMING), context, tag);
}
RouteGuide::AsyncService::AsyncService(::grpc::CompletionQueue* cq) : ::grpc::AsynchronousService(cq, RouteGuide_method_names, 4) {}
RouteGuide::Service::~Service() {
delete service_;
}
::grpc::Status RouteGuide::Service::GetFeature(::grpc::ServerContext* context, const ::examples::Point* request, ::examples::Feature* response) {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED);
}
void RouteGuide::AsyncService::RequestGetFeature(::grpc::ServerContext* context, ::examples::Point* request, ::grpc::ServerAsyncResponseWriter< ::examples::Feature>* response, ::grpc::CompletionQueue* cq, void* tag) {
AsynchronousService::RequestAsyncUnary(0, context, request, response, cq, tag);
}
::grpc::Status RouteGuide::Service::ListFeatures(::grpc::ServerContext* context, const ::examples::Rectangle* request, ::grpc::ServerWriter< ::examples::Feature>* writer) {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED);
}
void RouteGuide::AsyncService::RequestListFeatures(::grpc::ServerContext* context, ::examples::Rectangle* request, ::grpc::ServerAsyncWriter< ::examples::Feature>* writer, ::grpc::CompletionQueue* cq, void* tag) {
AsynchronousService::RequestServerStreaming(1, context, request, writer, cq, tag);
}
::grpc::Status RouteGuide::Service::RecordRoute(::grpc::ServerContext* context, ::grpc::ServerReader< ::examples::Point>* reader, ::examples::RouteSummary* response) {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED);
}
void RouteGuide::AsyncService::RequestRecordRoute(::grpc::ServerContext* context, ::grpc::ServerAsyncReader< ::examples::RouteSummary, ::examples::Point>* reader, ::grpc::CompletionQueue* cq, void* tag) {
AsynchronousService::RequestClientStreaming(2, context, reader, cq, tag);
}
::grpc::Status RouteGuide::Service::RouteChat(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::examples::RouteNote, ::examples::RouteNote>* stream) {
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED);
}
void RouteGuide::AsyncService::RequestRouteChat(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::examples::RouteNote, ::examples::RouteNote>* stream, ::grpc::CompletionQueue* cq, void *tag) {
AsynchronousService::RequestBidiStreaming(3, context, stream, cq, tag);
}
::grpc::RpcService* RouteGuide::Service::service() {
if (service_ != nullptr) {
return service_;
}
service_ = new ::grpc::RpcService();
service_->AddMethod(new ::grpc::RpcServiceMethod(
RouteGuide_method_names[0],
::grpc::RpcMethod::NORMAL_RPC,
new ::grpc::RpcMethodHandler< RouteGuide::Service, ::examples::Point, ::examples::Feature>(
std::function< ::grpc::Status(RouteGuide::Service*, ::grpc::ServerContext*, const ::examples::Point*, ::examples::Feature*)>(&RouteGuide::Service::GetFeature), this),
new ::examples::Point, new ::examples::Feature));
service_->AddMethod(new ::grpc::RpcServiceMethod(
RouteGuide_method_names[1],
::grpc::RpcMethod::SERVER_STREAMING,
new ::grpc::ServerStreamingHandler< RouteGuide::Service, ::examples::Rectangle, ::examples::Feature>(
std::function< ::grpc::Status(RouteGuide::Service*, ::grpc::ServerContext*, const ::examples::Rectangle*, ::grpc::ServerWriter< ::examples::Feature>*)>(&RouteGuide::Service::ListFeatures), this),
new ::examples::Rectangle, new ::examples::Feature));
service_->AddMethod(new ::grpc::RpcServiceMethod(
RouteGuide_method_names[2],
::grpc::RpcMethod::CLIENT_STREAMING,
new ::grpc::ClientStreamingHandler< RouteGuide::Service, ::examples::Point, ::examples::RouteSummary>(
std::function< ::grpc::Status(RouteGuide::Service*, ::grpc::ServerContext*, ::grpc::ServerReader< ::examples::Point>*, ::examples::RouteSummary*)>(&RouteGuide::Service::RecordRoute), this),
new ::examples::Point, new ::examples::RouteSummary));
service_->AddMethod(new ::grpc::RpcServiceMethod(
RouteGuide_method_names[3],
::grpc::RpcMethod::BIDI_STREAMING,
new ::grpc::BidiStreamingHandler< RouteGuide::Service, ::examples::RouteNote, ::examples::RouteNote>(
std::function< ::grpc::Status(RouteGuide::Service*, ::grpc::ServerContext*, ::grpc::ServerReaderWriter< ::examples::RouteNote, ::examples::RouteNote>*)>(&RouteGuide::Service::RouteChat), this),
new ::examples::RouteNote, new ::examples::RouteNote));
return service_;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace examples
// @@protoc_insertion_point(global_scope)