From 14ae0b051b66e75f4c73a645a1a06fc9d10a2a67 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 20 Mar 2015 19:18:02 -0700 Subject: [PATCH 1/9] Add dependency to Protobuf 2.6 to the podfile --- src/objective-c/examples/Sample/Podfile | 1 + 1 file changed, 1 insertion(+) diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile index 848627ff547..4da8bc44f66 100644 --- a/src/objective-c/examples/Sample/Podfile +++ b/src/objective-c/examples/Sample/Podfile @@ -2,6 +2,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' pod 'gRPC', :path => "../../../.." +pod 'ProtocolBuffers', '~> 1.9' link_with 'Sample', 'SampleTests' From 1f1d2c36e5524edb91d9b9a71cd64e3ff2ced466 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 20 Mar 2015 21:42:14 -0700 Subject: [PATCH 2/9] Copy route_guide.proto and make it 2.6 --- .../examples/Sample/protos/route_guide.proto | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 src/objective-c/examples/Sample/protos/route_guide.proto diff --git a/src/objective-c/examples/Sample/protos/route_guide.proto b/src/objective-c/examples/Sample/protos/route_guide.proto new file mode 100644 index 00000000000..6d35e786b42 --- /dev/null +++ b/src/objective-c/examples/Sample/protos/route_guide.proto @@ -0,0 +1,122 @@ +// Copyright 2015, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto2"; + +package grpc.example.routeguide; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.routeguide"; +option java_outer_classname = "RouteGuideProto"; + +// Interface exported by the server. +service RouteGuide { + // A simple RPC. + // + // Obtains the feature at a given position. + rpc GetFeature(Point) returns (Feature) {} + + // A server-to-client streaming RPC. + // + // Obtains the Features available within the given Rectangle. Results are + // streamed rather than returned at once (e.g. in a response message with a + // repeated field), as the rectangle may cover a large area and contain a + // huge number of features. +// rpc ListFeatures(Rectangle) returns (stream Feature) {} + + // A client-to-server streaming RPC. + // + // Accepts a stream of Points on a route being traversed, returning a + // RouteSummary when traversal is completed. +// rpc RecordRoute(stream Point) returns (RouteSummary) {} + + // A Bidirectional streaming RPC. + // + // Accepts a stream of RouteNotes sent while a route is being traversed, + // while receiving other RouteNotes (e.g. from other users). +// rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} +} + +// Points are represented as latitude-longitude pairs in the E7 representation +// (degrees multiplied by 10**7 and rounded to the nearest integer). +// Latitudes should be in the range +/- 90 degrees and longitude should be in +// the range +/- 180 degrees (inclusive). +message Point { + optional int32 latitude = 1; + optional int32 longitude = 2; +} + +// A latitude-longitude rectangle, represented as two diagonally opposite +// points "lo" and "hi". +message Rectangle { + // One corner of the rectangle. + optional Point lo = 1; + + // The other corner of the rectangle. + optional Point hi = 2; +} + +// A feature names something at a given point. +// +// If a feature could not be named, the name is empty. +message Feature { + // The name of the feature. + optional string name = 1; + + // The point where the feature is detected. + optional Point location = 2; +} + +// A RouteNote is a message sent while at a given point. +message RouteNote { + // The location from which the message is sent. + optional Point location = 1; + + // The message to be sent. + optional string message = 2; +} + +// A RouteSummary is received in response to a RecordRoute rpc. +// +// It contains the number of individual points received, the number of +// detected features, and the total distance covered as the cumulative sum of +// the distance between each point. +message RouteSummary { + // The number of points received. + optional int32 point_count = 1; + + // The number of known features passed while traversing the route. + optional int32 feature_count = 2; + + // The distance covered in metres. + optional int32 distance = 3; + + // The duration of the traversal in seconds. + optional int32 elapsed_time = 4; +} \ No newline at end of file From f4ddfab3f73f7cfd821122caf58c37fa6e47f062 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 20 Mar 2015 21:43:00 -0700 Subject: [PATCH 3/9] Generated files :) --- .../examples/Sample/protos/Route_guide.pb.h | 343 ++++ .../examples/Sample/protos/Route_guide.pb.m | 1434 +++++++++++++++++ 2 files changed, 1777 insertions(+) create mode 100644 src/objective-c/examples/Sample/protos/Route_guide.pb.h create mode 100644 src/objective-c/examples/Sample/protos/Route_guide.pb.m diff --git a/src/objective-c/examples/Sample/protos/Route_guide.pb.h b/src/objective-c/examples/Sample/protos/Route_guide.pb.h new file mode 100644 index 00000000000..f1e54d02def --- /dev/null +++ b/src/objective-c/examples/Sample/protos/Route_guide.pb.h @@ -0,0 +1,343 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! + +#import + +// @@protoc_insertion_point(imports) + +@class Feature; +@class FeatureBuilder; +@class Point; +@class PointBuilder; +@class Rectangle; +@class RectangleBuilder; +@class RouteNote; +@class RouteNoteBuilder; +@class RouteSummary; +@class RouteSummaryBuilder; + + + +@interface RouteGuideRoot : NSObject { +} ++ (PBExtensionRegistry*) extensionRegistry; ++ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; +@end + +@interface Point : PBGeneratedMessage { +@private + BOOL hasLatitude_:1; + BOOL hasLongitude_:1; + SInt32 latitude; + SInt32 longitude; +} +- (BOOL) hasLatitude; +- (BOOL) hasLongitude; +@property (readonly) SInt32 latitude; +@property (readonly) SInt32 longitude; + ++ (instancetype) defaultInstance; +- (instancetype) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (PointBuilder*) builder; ++ (PointBuilder*) builder; ++ (PointBuilder*) builderWithPrototype:(Point*) prototype; +- (PointBuilder*) toBuilder; + ++ (Point*) parseFromData:(NSData*) data; ++ (Point*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (Point*) parseFromInputStream:(NSInputStream*) input; ++ (Point*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface PointBuilder : PBGeneratedMessageBuilder { +@private + Point* resultPoint; +} + +- (Point*) defaultInstance; + +- (PointBuilder*) clear; +- (PointBuilder*) clone; + +- (Point*) build; +- (Point*) buildPartial; + +- (PointBuilder*) mergeFrom:(Point*) other; +- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasLatitude; +- (SInt32) latitude; +- (PointBuilder*) setLatitude:(SInt32) value; +- (PointBuilder*) clearLatitude; + +- (BOOL) hasLongitude; +- (SInt32) longitude; +- (PointBuilder*) setLongitude:(SInt32) value; +- (PointBuilder*) clearLongitude; +@end + +@interface Rectangle : PBGeneratedMessage { +@private + BOOL hasLo_:1; + BOOL hasHi_:1; + Point* lo; + Point* hi; +} +- (BOOL) hasLo; +- (BOOL) hasHi; +@property (readonly, strong) Point* lo; +@property (readonly, strong) Point* hi; + ++ (instancetype) defaultInstance; +- (instancetype) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (RectangleBuilder*) builder; ++ (RectangleBuilder*) builder; ++ (RectangleBuilder*) builderWithPrototype:(Rectangle*) prototype; +- (RectangleBuilder*) toBuilder; + ++ (Rectangle*) parseFromData:(NSData*) data; ++ (Rectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (Rectangle*) parseFromInputStream:(NSInputStream*) input; ++ (Rectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface RectangleBuilder : PBGeneratedMessageBuilder { +@private + Rectangle* resultRectangle; +} + +- (Rectangle*) defaultInstance; + +- (RectangleBuilder*) clear; +- (RectangleBuilder*) clone; + +- (Rectangle*) build; +- (Rectangle*) buildPartial; + +- (RectangleBuilder*) mergeFrom:(Rectangle*) other; +- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasLo; +- (Point*) lo; +- (RectangleBuilder*) setLo:(Point*) value; +- (RectangleBuilder*) setLoBuilder:(PointBuilder*) builderForValue; +- (RectangleBuilder*) mergeLo:(Point*) value; +- (RectangleBuilder*) clearLo; + +- (BOOL) hasHi; +- (Point*) hi; +- (RectangleBuilder*) setHi:(Point*) value; +- (RectangleBuilder*) setHiBuilder:(PointBuilder*) builderForValue; +- (RectangleBuilder*) mergeHi:(Point*) value; +- (RectangleBuilder*) clearHi; +@end + +@interface Feature : PBGeneratedMessage { +@private + BOOL hasName_:1; + BOOL hasLocation_:1; + NSString* name; + Point* location; +} +- (BOOL) hasName; +- (BOOL) hasLocation; +@property (readonly, strong) NSString* name; +@property (readonly, strong) Point* location; + ++ (instancetype) defaultInstance; +- (instancetype) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (FeatureBuilder*) builder; ++ (FeatureBuilder*) builder; ++ (FeatureBuilder*) builderWithPrototype:(Feature*) prototype; +- (FeatureBuilder*) toBuilder; + ++ (Feature*) parseFromData:(NSData*) data; ++ (Feature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (Feature*) parseFromInputStream:(NSInputStream*) input; ++ (Feature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface FeatureBuilder : PBGeneratedMessageBuilder { +@private + Feature* resultFeature; +} + +- (Feature*) defaultInstance; + +- (FeatureBuilder*) clear; +- (FeatureBuilder*) clone; + +- (Feature*) build; +- (Feature*) buildPartial; + +- (FeatureBuilder*) mergeFrom:(Feature*) other; +- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasName; +- (NSString*) name; +- (FeatureBuilder*) setName:(NSString*) value; +- (FeatureBuilder*) clearName; + +- (BOOL) hasLocation; +- (Point*) location; +- (FeatureBuilder*) setLocation:(Point*) value; +- (FeatureBuilder*) setLocationBuilder:(PointBuilder*) builderForValue; +- (FeatureBuilder*) mergeLocation:(Point*) value; +- (FeatureBuilder*) clearLocation; +@end + +@interface RouteNote : PBGeneratedMessage { +@private + BOOL hasMessage_:1; + BOOL hasLocation_:1; + NSString* message; + Point* location; +} +- (BOOL) hasLocation; +- (BOOL) hasMessage; +@property (readonly, strong) Point* location; +@property (readonly, strong) NSString* message; + ++ (instancetype) defaultInstance; +- (instancetype) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (RouteNoteBuilder*) builder; ++ (RouteNoteBuilder*) builder; ++ (RouteNoteBuilder*) builderWithPrototype:(RouteNote*) prototype; +- (RouteNoteBuilder*) toBuilder; + ++ (RouteNote*) parseFromData:(NSData*) data; ++ (RouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RouteNote*) parseFromInputStream:(NSInputStream*) input; ++ (RouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface RouteNoteBuilder : PBGeneratedMessageBuilder { +@private + RouteNote* resultRouteNote; +} + +- (RouteNote*) defaultInstance; + +- (RouteNoteBuilder*) clear; +- (RouteNoteBuilder*) clone; + +- (RouteNote*) build; +- (RouteNote*) buildPartial; + +- (RouteNoteBuilder*) mergeFrom:(RouteNote*) other; +- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasLocation; +- (Point*) location; +- (RouteNoteBuilder*) setLocation:(Point*) value; +- (RouteNoteBuilder*) setLocationBuilder:(PointBuilder*) builderForValue; +- (RouteNoteBuilder*) mergeLocation:(Point*) value; +- (RouteNoteBuilder*) clearLocation; + +- (BOOL) hasMessage; +- (NSString*) message; +- (RouteNoteBuilder*) setMessage:(NSString*) value; +- (RouteNoteBuilder*) clearMessage; +@end + +@interface RouteSummary : PBGeneratedMessage { +@private + BOOL hasPointCount_:1; + BOOL hasFeatureCount_:1; + BOOL hasDistance_:1; + BOOL hasElapsedTime_:1; + SInt32 pointCount; + SInt32 featureCount; + SInt32 distance; + SInt32 elapsedTime; +} +- (BOOL) hasPointCount; +- (BOOL) hasFeatureCount; +- (BOOL) hasDistance; +- (BOOL) hasElapsedTime; +@property (readonly) SInt32 pointCount; +@property (readonly) SInt32 featureCount; +@property (readonly) SInt32 distance; +@property (readonly) SInt32 elapsedTime; + ++ (instancetype) defaultInstance; +- (instancetype) defaultInstance; + +- (BOOL) isInitialized; +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; +- (RouteSummaryBuilder*) builder; ++ (RouteSummaryBuilder*) builder; ++ (RouteSummaryBuilder*) builderWithPrototype:(RouteSummary*) prototype; +- (RouteSummaryBuilder*) toBuilder; + ++ (RouteSummary*) parseFromData:(NSData*) data; ++ (RouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RouteSummary*) parseFromInputStream:(NSInputStream*) input; ++ (RouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +@end + +@interface RouteSummaryBuilder : PBGeneratedMessageBuilder { +@private + RouteSummary* resultRouteSummary; +} + +- (RouteSummary*) defaultInstance; + +- (RouteSummaryBuilder*) clear; +- (RouteSummaryBuilder*) clone; + +- (RouteSummary*) build; +- (RouteSummary*) buildPartial; + +- (RouteSummaryBuilder*) mergeFrom:(RouteSummary*) other; +- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; + +- (BOOL) hasPointCount; +- (SInt32) pointCount; +- (RouteSummaryBuilder*) setPointCount:(SInt32) value; +- (RouteSummaryBuilder*) clearPointCount; + +- (BOOL) hasFeatureCount; +- (SInt32) featureCount; +- (RouteSummaryBuilder*) setFeatureCount:(SInt32) value; +- (RouteSummaryBuilder*) clearFeatureCount; + +- (BOOL) hasDistance; +- (SInt32) distance; +- (RouteSummaryBuilder*) setDistance:(SInt32) value; +- (RouteSummaryBuilder*) clearDistance; + +- (BOOL) hasElapsedTime; +- (SInt32) elapsedTime; +- (RouteSummaryBuilder*) setElapsedTime:(SInt32) value; +- (RouteSummaryBuilder*) clearElapsedTime; +@end + + +// @@protoc_insertion_point(global_scope) diff --git a/src/objective-c/examples/Sample/protos/Route_guide.pb.m b/src/objective-c/examples/Sample/protos/Route_guide.pb.m new file mode 100644 index 00000000000..d7847dfced1 --- /dev/null +++ b/src/objective-c/examples/Sample/protos/Route_guide.pb.m @@ -0,0 +1,1434 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! + +#import "Route_guide.pb.h" +// @@protoc_insertion_point(imports) + +@implementation RouteGuideRoot +static PBExtensionRegistry* extensionRegistry = nil; ++ (PBExtensionRegistry*) extensionRegistry { + return extensionRegistry; +} + ++ (void) initialize { + if (self == [RouteGuideRoot class]) { + PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry]; + [self registerAllExtensions:registry]; + extensionRegistry = registry; + } +} ++ (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry { +} +@end + +@interface Point () +@property SInt32 latitude; +@property SInt32 longitude; +@end + +@implementation Point + +- (BOOL) hasLatitude { + return !!hasLatitude_; +} +- (void) setHasLatitude:(BOOL) _value_ { + hasLatitude_ = !!_value_; +} +@synthesize latitude; +- (BOOL) hasLongitude { + return !!hasLongitude_; +} +- (void) setHasLongitude:(BOOL) _value_ { + hasLongitude_ = !!_value_; +} +@synthesize longitude; +- (instancetype) init { + if ((self = [super init])) { + self.latitude = 0; + self.longitude = 0; + } + return self; +} +static Point* defaultPointInstance = nil; ++ (void) initialize { + if (self == [Point class]) { + defaultPointInstance = [[Point alloc] init]; + } +} ++ (instancetype) defaultInstance { + return defaultPointInstance; +} +- (instancetype) defaultInstance { + return defaultPointInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasLatitude) { + [output writeInt32:1 value:self.latitude]; + } + if (self.hasLongitude) { + [output writeInt32:2 value:self.longitude]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasLatitude) { + size_ += computeInt32Size(1, self.latitude); + } + if (self.hasLongitude) { + size_ += computeInt32Size(2, self.longitude); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (Point*) parseFromData:(NSData*) data { + return (Point*)[[[Point builder] mergeFromData:data] build]; +} ++ (Point*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Point*)[[[Point builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (Point*) parseFromInputStream:(NSInputStream*) input { + return (Point*)[[[Point builder] mergeFromInputStream:input] build]; +} ++ (Point*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Point*)[[[Point builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (Point*)[[[Point builder] mergeFromCodedInputStream:input] build]; +} ++ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Point*)[[[Point builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (PointBuilder*) builder { + return [[PointBuilder alloc] init]; +} ++ (PointBuilder*) builderWithPrototype:(Point*) prototype { + return [[Point builder] mergeFrom:prototype]; +} +- (PointBuilder*) builder { + return [Point builder]; +} +- (PointBuilder*) toBuilder { + return [Point builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasLatitude) { + [output appendFormat:@"%@%@: %@\n", indent, @"latitude", [NSNumber numberWithInteger:self.latitude]]; + } + if (self.hasLongitude) { + [output appendFormat:@"%@%@: %@\n", indent, @"longitude", [NSNumber numberWithInteger:self.longitude]]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[Point class]]) { + return NO; + } + Point *otherMessage = other; + return + self.hasLatitude == otherMessage.hasLatitude && + (!self.hasLatitude || self.latitude == otherMessage.latitude) && + self.hasLongitude == otherMessage.hasLongitude && + (!self.hasLongitude || self.longitude == otherMessage.longitude) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasLatitude) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.latitude] hash]; + } + if (self.hasLongitude) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.longitude] hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface PointBuilder() +@property (strong) Point* resultPoint; +@end + +@implementation PointBuilder +@synthesize resultPoint; +- (instancetype) init { + if ((self = [super init])) { + self.resultPoint = [[Point alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return resultPoint; +} +- (PointBuilder*) clear { + self.resultPoint = [[Point alloc] init]; + return self; +} +- (PointBuilder*) clone { + return [Point builderWithPrototype:resultPoint]; +} +- (Point*) defaultInstance { + return [Point defaultInstance]; +} +- (Point*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (Point*) buildPartial { + Point* returnMe = resultPoint; + self.resultPoint = nil; + return returnMe; +} +- (PointBuilder*) mergeFrom:(Point*) other { + if (other == [Point defaultInstance]) { + return self; + } + if (other.hasLatitude) { + [self setLatitude:other.latitude]; + } + if (other.hasLongitude) { + [self setLongitude:other.longitude]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 8: { + [self setLatitude:[input readInt32]]; + break; + } + case 16: { + [self setLongitude:[input readInt32]]; + break; + } + } + } +} +- (BOOL) hasLatitude { + return resultPoint.hasLatitude; +} +- (SInt32) latitude { + return resultPoint.latitude; +} +- (PointBuilder*) setLatitude:(SInt32) value { + resultPoint.hasLatitude = YES; + resultPoint.latitude = value; + return self; +} +- (PointBuilder*) clearLatitude { + resultPoint.hasLatitude = NO; + resultPoint.latitude = 0; + return self; +} +- (BOOL) hasLongitude { + return resultPoint.hasLongitude; +} +- (SInt32) longitude { + return resultPoint.longitude; +} +- (PointBuilder*) setLongitude:(SInt32) value { + resultPoint.hasLongitude = YES; + resultPoint.longitude = value; + return self; +} +- (PointBuilder*) clearLongitude { + resultPoint.hasLongitude = NO; + resultPoint.longitude = 0; + return self; +} +@end + +@interface Rectangle () +@property (strong) Point* lo; +@property (strong) Point* hi; +@end + +@implementation Rectangle + +- (BOOL) hasLo { + return !!hasLo_; +} +- (void) setHasLo:(BOOL) _value_ { + hasLo_ = !!_value_; +} +@synthesize lo; +- (BOOL) hasHi { + return !!hasHi_; +} +- (void) setHasHi:(BOOL) _value_ { + hasHi_ = !!_value_; +} +@synthesize hi; +- (instancetype) init { + if ((self = [super init])) { + self.lo = [Point defaultInstance]; + self.hi = [Point defaultInstance]; + } + return self; +} +static Rectangle* defaultRectangleInstance = nil; ++ (void) initialize { + if (self == [Rectangle class]) { + defaultRectangleInstance = [[Rectangle alloc] init]; + } +} ++ (instancetype) defaultInstance { + return defaultRectangleInstance; +} +- (instancetype) defaultInstance { + return defaultRectangleInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasLo) { + [output writeMessage:1 value:self.lo]; + } + if (self.hasHi) { + [output writeMessage:2 value:self.hi]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasLo) { + size_ += computeMessageSize(1, self.lo); + } + if (self.hasHi) { + size_ += computeMessageSize(2, self.hi); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (Rectangle*) parseFromData:(NSData*) data { + return (Rectangle*)[[[Rectangle builder] mergeFromData:data] build]; +} ++ (Rectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Rectangle*)[[[Rectangle builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (Rectangle*) parseFromInputStream:(NSInputStream*) input { + return (Rectangle*)[[[Rectangle builder] mergeFromInputStream:input] build]; +} ++ (Rectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Rectangle*)[[[Rectangle builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (Rectangle*)[[[Rectangle builder] mergeFromCodedInputStream:input] build]; +} ++ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Rectangle*)[[[Rectangle builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (RectangleBuilder*) builder { + return [[RectangleBuilder alloc] init]; +} ++ (RectangleBuilder*) builderWithPrototype:(Rectangle*) prototype { + return [[Rectangle builder] mergeFrom:prototype]; +} +- (RectangleBuilder*) builder { + return [Rectangle builder]; +} +- (RectangleBuilder*) toBuilder { + return [Rectangle builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasLo) { + [output appendFormat:@"%@%@ {\n", indent, @"lo"]; + [self.lo writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + } + if (self.hasHi) { + [output appendFormat:@"%@%@ {\n", indent, @"hi"]; + [self.hi writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[Rectangle class]]) { + return NO; + } + Rectangle *otherMessage = other; + return + self.hasLo == otherMessage.hasLo && + (!self.hasLo || [self.lo isEqual:otherMessage.lo]) && + self.hasHi == otherMessage.hasHi && + (!self.hasHi || [self.hi isEqual:otherMessage.hi]) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasLo) { + hashCode = hashCode * 31 + [self.lo hash]; + } + if (self.hasHi) { + hashCode = hashCode * 31 + [self.hi hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface RectangleBuilder() +@property (strong) Rectangle* resultRectangle; +@end + +@implementation RectangleBuilder +@synthesize resultRectangle; +- (instancetype) init { + if ((self = [super init])) { + self.resultRectangle = [[Rectangle alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return resultRectangle; +} +- (RectangleBuilder*) clear { + self.resultRectangle = [[Rectangle alloc] init]; + return self; +} +- (RectangleBuilder*) clone { + return [Rectangle builderWithPrototype:resultRectangle]; +} +- (Rectangle*) defaultInstance { + return [Rectangle defaultInstance]; +} +- (Rectangle*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (Rectangle*) buildPartial { + Rectangle* returnMe = resultRectangle; + self.resultRectangle = nil; + return returnMe; +} +- (RectangleBuilder*) mergeFrom:(Rectangle*) other { + if (other == [Rectangle defaultInstance]) { + return self; + } + if (other.hasLo) { + [self mergeLo:other.lo]; + } + if (other.hasHi) { + [self mergeHi:other.hi]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 10: { + PointBuilder* subBuilder = [Point builder]; + if (self.hasLo) { + [subBuilder mergeFrom:self.lo]; + } + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self setLo:[subBuilder buildPartial]]; + break; + } + case 18: { + PointBuilder* subBuilder = [Point builder]; + if (self.hasHi) { + [subBuilder mergeFrom:self.hi]; + } + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self setHi:[subBuilder buildPartial]]; + break; + } + } + } +} +- (BOOL) hasLo { + return resultRectangle.hasLo; +} +- (Point*) lo { + return resultRectangle.lo; +} +- (RectangleBuilder*) setLo:(Point*) value { + resultRectangle.hasLo = YES; + resultRectangle.lo = value; + return self; +} +- (RectangleBuilder*) setLoBuilder:(PointBuilder*) builderForValue { + return [self setLo:[builderForValue build]]; +} +- (RectangleBuilder*) mergeLo:(Point*) value { + if (resultRectangle.hasLo && + resultRectangle.lo != [Point defaultInstance]) { + resultRectangle.lo = + [[[Point builderWithPrototype:resultRectangle.lo] mergeFrom:value] buildPartial]; + } else { + resultRectangle.lo = value; + } + resultRectangle.hasLo = YES; + return self; +} +- (RectangleBuilder*) clearLo { + resultRectangle.hasLo = NO; + resultRectangle.lo = [Point defaultInstance]; + return self; +} +- (BOOL) hasHi { + return resultRectangle.hasHi; +} +- (Point*) hi { + return resultRectangle.hi; +} +- (RectangleBuilder*) setHi:(Point*) value { + resultRectangle.hasHi = YES; + resultRectangle.hi = value; + return self; +} +- (RectangleBuilder*) setHiBuilder:(PointBuilder*) builderForValue { + return [self setHi:[builderForValue build]]; +} +- (RectangleBuilder*) mergeHi:(Point*) value { + if (resultRectangle.hasHi && + resultRectangle.hi != [Point defaultInstance]) { + resultRectangle.hi = + [[[Point builderWithPrototype:resultRectangle.hi] mergeFrom:value] buildPartial]; + } else { + resultRectangle.hi = value; + } + resultRectangle.hasHi = YES; + return self; +} +- (RectangleBuilder*) clearHi { + resultRectangle.hasHi = NO; + resultRectangle.hi = [Point defaultInstance]; + return self; +} +@end + +@interface Feature () +@property (strong) NSString* name; +@property (strong) Point* location; +@end + +@implementation Feature + +- (BOOL) hasName { + return !!hasName_; +} +- (void) setHasName:(BOOL) _value_ { + hasName_ = !!_value_; +} +@synthesize name; +- (BOOL) hasLocation { + return !!hasLocation_; +} +- (void) setHasLocation:(BOOL) _value_ { + hasLocation_ = !!_value_; +} +@synthesize location; +- (instancetype) init { + if ((self = [super init])) { + self.name = @""; + self.location = [Point defaultInstance]; + } + return self; +} +static Feature* defaultFeatureInstance = nil; ++ (void) initialize { + if (self == [Feature class]) { + defaultFeatureInstance = [[Feature alloc] init]; + } +} ++ (instancetype) defaultInstance { + return defaultFeatureInstance; +} +- (instancetype) defaultInstance { + return defaultFeatureInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasName) { + [output writeString:1 value:self.name]; + } + if (self.hasLocation) { + [output writeMessage:2 value:self.location]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasName) { + size_ += computeStringSize(1, self.name); + } + if (self.hasLocation) { + size_ += computeMessageSize(2, self.location); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (Feature*) parseFromData:(NSData*) data { + return (Feature*)[[[Feature builder] mergeFromData:data] build]; +} ++ (Feature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Feature*)[[[Feature builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (Feature*) parseFromInputStream:(NSInputStream*) input { + return (Feature*)[[[Feature builder] mergeFromInputStream:input] build]; +} ++ (Feature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Feature*)[[[Feature builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (Feature*)[[[Feature builder] mergeFromCodedInputStream:input] build]; +} ++ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (Feature*)[[[Feature builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (FeatureBuilder*) builder { + return [[FeatureBuilder alloc] init]; +} ++ (FeatureBuilder*) builderWithPrototype:(Feature*) prototype { + return [[Feature builder] mergeFrom:prototype]; +} +- (FeatureBuilder*) builder { + return [Feature builder]; +} +- (FeatureBuilder*) toBuilder { + return [Feature builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasName) { + [output appendFormat:@"%@%@: %@\n", indent, @"name", self.name]; + } + if (self.hasLocation) { + [output appendFormat:@"%@%@ {\n", indent, @"location"]; + [self.location writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[Feature class]]) { + return NO; + } + Feature *otherMessage = other; + return + self.hasName == otherMessage.hasName && + (!self.hasName || [self.name isEqual:otherMessage.name]) && + self.hasLocation == otherMessage.hasLocation && + (!self.hasLocation || [self.location isEqual:otherMessage.location]) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasName) { + hashCode = hashCode * 31 + [self.name hash]; + } + if (self.hasLocation) { + hashCode = hashCode * 31 + [self.location hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface FeatureBuilder() +@property (strong) Feature* resultFeature; +@end + +@implementation FeatureBuilder +@synthesize resultFeature; +- (instancetype) init { + if ((self = [super init])) { + self.resultFeature = [[Feature alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return resultFeature; +} +- (FeatureBuilder*) clear { + self.resultFeature = [[Feature alloc] init]; + return self; +} +- (FeatureBuilder*) clone { + return [Feature builderWithPrototype:resultFeature]; +} +- (Feature*) defaultInstance { + return [Feature defaultInstance]; +} +- (Feature*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (Feature*) buildPartial { + Feature* returnMe = resultFeature; + self.resultFeature = nil; + return returnMe; +} +- (FeatureBuilder*) mergeFrom:(Feature*) other { + if (other == [Feature defaultInstance]) { + return self; + } + if (other.hasName) { + [self setName:other.name]; + } + if (other.hasLocation) { + [self mergeLocation:other.location]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 10: { + [self setName:[input readString]]; + break; + } + case 18: { + PointBuilder* subBuilder = [Point builder]; + if (self.hasLocation) { + [subBuilder mergeFrom:self.location]; + } + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self setLocation:[subBuilder buildPartial]]; + break; + } + } + } +} +- (BOOL) hasName { + return resultFeature.hasName; +} +- (NSString*) name { + return resultFeature.name; +} +- (FeatureBuilder*) setName:(NSString*) value { + resultFeature.hasName = YES; + resultFeature.name = value; + return self; +} +- (FeatureBuilder*) clearName { + resultFeature.hasName = NO; + resultFeature.name = @""; + return self; +} +- (BOOL) hasLocation { + return resultFeature.hasLocation; +} +- (Point*) location { + return resultFeature.location; +} +- (FeatureBuilder*) setLocation:(Point*) value { + resultFeature.hasLocation = YES; + resultFeature.location = value; + return self; +} +- (FeatureBuilder*) setLocationBuilder:(PointBuilder*) builderForValue { + return [self setLocation:[builderForValue build]]; +} +- (FeatureBuilder*) mergeLocation:(Point*) value { + if (resultFeature.hasLocation && + resultFeature.location != [Point defaultInstance]) { + resultFeature.location = + [[[Point builderWithPrototype:resultFeature.location] mergeFrom:value] buildPartial]; + } else { + resultFeature.location = value; + } + resultFeature.hasLocation = YES; + return self; +} +- (FeatureBuilder*) clearLocation { + resultFeature.hasLocation = NO; + resultFeature.location = [Point defaultInstance]; + return self; +} +@end + +@interface RouteNote () +@property (strong) Point* location; +@property (strong) NSString* message; +@end + +@implementation RouteNote + +- (BOOL) hasLocation { + return !!hasLocation_; +} +- (void) setHasLocation:(BOOL) _value_ { + hasLocation_ = !!_value_; +} +@synthesize location; +- (BOOL) hasMessage { + return !!hasMessage_; +} +- (void) setHasMessage:(BOOL) _value_ { + hasMessage_ = !!_value_; +} +@synthesize message; +- (instancetype) init { + if ((self = [super init])) { + self.location = [Point defaultInstance]; + self.message = @""; + } + return self; +} +static RouteNote* defaultRouteNoteInstance = nil; ++ (void) initialize { + if (self == [RouteNote class]) { + defaultRouteNoteInstance = [[RouteNote alloc] init]; + } +} ++ (instancetype) defaultInstance { + return defaultRouteNoteInstance; +} +- (instancetype) defaultInstance { + return defaultRouteNoteInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasLocation) { + [output writeMessage:1 value:self.location]; + } + if (self.hasMessage) { + [output writeString:2 value:self.message]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasLocation) { + size_ += computeMessageSize(1, self.location); + } + if (self.hasMessage) { + size_ += computeStringSize(2, self.message); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (RouteNote*) parseFromData:(NSData*) data { + return (RouteNote*)[[[RouteNote builder] mergeFromData:data] build]; +} ++ (RouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RouteNote*)[[[RouteNote builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (RouteNote*) parseFromInputStream:(NSInputStream*) input { + return (RouteNote*)[[[RouteNote builder] mergeFromInputStream:input] build]; +} ++ (RouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RouteNote*)[[[RouteNote builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RouteNote*)[[[RouteNote builder] mergeFromCodedInputStream:input] build]; +} ++ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RouteNote*)[[[RouteNote builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (RouteNoteBuilder*) builder { + return [[RouteNoteBuilder alloc] init]; +} ++ (RouteNoteBuilder*) builderWithPrototype:(RouteNote*) prototype { + return [[RouteNote builder] mergeFrom:prototype]; +} +- (RouteNoteBuilder*) builder { + return [RouteNote builder]; +} +- (RouteNoteBuilder*) toBuilder { + return [RouteNote builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasLocation) { + [output appendFormat:@"%@%@ {\n", indent, @"location"]; + [self.location writeDescriptionTo:output + withIndent:[NSString stringWithFormat:@"%@ ", indent]]; + [output appendFormat:@"%@}\n", indent]; + } + if (self.hasMessage) { + [output appendFormat:@"%@%@: %@\n", indent, @"message", self.message]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[RouteNote class]]) { + return NO; + } + RouteNote *otherMessage = other; + return + self.hasLocation == otherMessage.hasLocation && + (!self.hasLocation || [self.location isEqual:otherMessage.location]) && + self.hasMessage == otherMessage.hasMessage && + (!self.hasMessage || [self.message isEqual:otherMessage.message]) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasLocation) { + hashCode = hashCode * 31 + [self.location hash]; + } + if (self.hasMessage) { + hashCode = hashCode * 31 + [self.message hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface RouteNoteBuilder() +@property (strong) RouteNote* resultRouteNote; +@end + +@implementation RouteNoteBuilder +@synthesize resultRouteNote; +- (instancetype) init { + if ((self = [super init])) { + self.resultRouteNote = [[RouteNote alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return resultRouteNote; +} +- (RouteNoteBuilder*) clear { + self.resultRouteNote = [[RouteNote alloc] init]; + return self; +} +- (RouteNoteBuilder*) clone { + return [RouteNote builderWithPrototype:resultRouteNote]; +} +- (RouteNote*) defaultInstance { + return [RouteNote defaultInstance]; +} +- (RouteNote*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (RouteNote*) buildPartial { + RouteNote* returnMe = resultRouteNote; + self.resultRouteNote = nil; + return returnMe; +} +- (RouteNoteBuilder*) mergeFrom:(RouteNote*) other { + if (other == [RouteNote defaultInstance]) { + return self; + } + if (other.hasLocation) { + [self mergeLocation:other.location]; + } + if (other.hasMessage) { + [self setMessage:other.message]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 10: { + PointBuilder* subBuilder = [Point builder]; + if (self.hasLocation) { + [subBuilder mergeFrom:self.location]; + } + [input readMessage:subBuilder extensionRegistry:extensionRegistry]; + [self setLocation:[subBuilder buildPartial]]; + break; + } + case 18: { + [self setMessage:[input readString]]; + break; + } + } + } +} +- (BOOL) hasLocation { + return resultRouteNote.hasLocation; +} +- (Point*) location { + return resultRouteNote.location; +} +- (RouteNoteBuilder*) setLocation:(Point*) value { + resultRouteNote.hasLocation = YES; + resultRouteNote.location = value; + return self; +} +- (RouteNoteBuilder*) setLocationBuilder:(PointBuilder*) builderForValue { + return [self setLocation:[builderForValue build]]; +} +- (RouteNoteBuilder*) mergeLocation:(Point*) value { + if (resultRouteNote.hasLocation && + resultRouteNote.location != [Point defaultInstance]) { + resultRouteNote.location = + [[[Point builderWithPrototype:resultRouteNote.location] mergeFrom:value] buildPartial]; + } else { + resultRouteNote.location = value; + } + resultRouteNote.hasLocation = YES; + return self; +} +- (RouteNoteBuilder*) clearLocation { + resultRouteNote.hasLocation = NO; + resultRouteNote.location = [Point defaultInstance]; + return self; +} +- (BOOL) hasMessage { + return resultRouteNote.hasMessage; +} +- (NSString*) message { + return resultRouteNote.message; +} +- (RouteNoteBuilder*) setMessage:(NSString*) value { + resultRouteNote.hasMessage = YES; + resultRouteNote.message = value; + return self; +} +- (RouteNoteBuilder*) clearMessage { + resultRouteNote.hasMessage = NO; + resultRouteNote.message = @""; + return self; +} +@end + +@interface RouteSummary () +@property SInt32 pointCount; +@property SInt32 featureCount; +@property SInt32 distance; +@property SInt32 elapsedTime; +@end + +@implementation RouteSummary + +- (BOOL) hasPointCount { + return !!hasPointCount_; +} +- (void) setHasPointCount:(BOOL) _value_ { + hasPointCount_ = !!_value_; +} +@synthesize pointCount; +- (BOOL) hasFeatureCount { + return !!hasFeatureCount_; +} +- (void) setHasFeatureCount:(BOOL) _value_ { + hasFeatureCount_ = !!_value_; +} +@synthesize featureCount; +- (BOOL) hasDistance { + return !!hasDistance_; +} +- (void) setHasDistance:(BOOL) _value_ { + hasDistance_ = !!_value_; +} +@synthesize distance; +- (BOOL) hasElapsedTime { + return !!hasElapsedTime_; +} +- (void) setHasElapsedTime:(BOOL) _value_ { + hasElapsedTime_ = !!_value_; +} +@synthesize elapsedTime; +- (instancetype) init { + if ((self = [super init])) { + self.pointCount = 0; + self.featureCount = 0; + self.distance = 0; + self.elapsedTime = 0; + } + return self; +} +static RouteSummary* defaultRouteSummaryInstance = nil; ++ (void) initialize { + if (self == [RouteSummary class]) { + defaultRouteSummaryInstance = [[RouteSummary alloc] init]; + } +} ++ (instancetype) defaultInstance { + return defaultRouteSummaryInstance; +} +- (instancetype) defaultInstance { + return defaultRouteSummaryInstance; +} +- (BOOL) isInitialized { + return YES; +} +- (void) writeToCodedOutputStream:(PBCodedOutputStream*) output { + if (self.hasPointCount) { + [output writeInt32:1 value:self.pointCount]; + } + if (self.hasFeatureCount) { + [output writeInt32:2 value:self.featureCount]; + } + if (self.hasDistance) { + [output writeInt32:3 value:self.distance]; + } + if (self.hasElapsedTime) { + [output writeInt32:4 value:self.elapsedTime]; + } + [self.unknownFields writeToCodedOutputStream:output]; +} +- (SInt32) serializedSize { + __block SInt32 size_ = memoizedSerializedSize; + if (size_ != -1) { + return size_; + } + + size_ = 0; + if (self.hasPointCount) { + size_ += computeInt32Size(1, self.pointCount); + } + if (self.hasFeatureCount) { + size_ += computeInt32Size(2, self.featureCount); + } + if (self.hasDistance) { + size_ += computeInt32Size(3, self.distance); + } + if (self.hasElapsedTime) { + size_ += computeInt32Size(4, self.elapsedTime); + } + size_ += self.unknownFields.serializedSize; + memoizedSerializedSize = size_; + return size_; +} ++ (RouteSummary*) parseFromData:(NSData*) data { + return (RouteSummary*)[[[RouteSummary builder] mergeFromData:data] build]; +} ++ (RouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RouteSummary*)[[[RouteSummary builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; +} ++ (RouteSummary*) parseFromInputStream:(NSInputStream*) input { + return (RouteSummary*)[[[RouteSummary builder] mergeFromInputStream:input] build]; +} ++ (RouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RouteSummary*)[[[RouteSummary builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RouteSummary*)[[[RouteSummary builder] mergeFromCodedInputStream:input] build]; +} ++ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RouteSummary*)[[[RouteSummary builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; +} ++ (RouteSummaryBuilder*) builder { + return [[RouteSummaryBuilder alloc] init]; +} ++ (RouteSummaryBuilder*) builderWithPrototype:(RouteSummary*) prototype { + return [[RouteSummary builder] mergeFrom:prototype]; +} +- (RouteSummaryBuilder*) builder { + return [RouteSummary builder]; +} +- (RouteSummaryBuilder*) toBuilder { + return [RouteSummary builderWithPrototype:self]; +} +- (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { + if (self.hasPointCount) { + [output appendFormat:@"%@%@: %@\n", indent, @"pointCount", [NSNumber numberWithInteger:self.pointCount]]; + } + if (self.hasFeatureCount) { + [output appendFormat:@"%@%@: %@\n", indent, @"featureCount", [NSNumber numberWithInteger:self.featureCount]]; + } + if (self.hasDistance) { + [output appendFormat:@"%@%@: %@\n", indent, @"distance", [NSNumber numberWithInteger:self.distance]]; + } + if (self.hasElapsedTime) { + [output appendFormat:@"%@%@: %@\n", indent, @"elapsedTime", [NSNumber numberWithInteger:self.elapsedTime]]; + } + [self.unknownFields writeDescriptionTo:output withIndent:indent]; +} +- (BOOL) isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[RouteSummary class]]) { + return NO; + } + RouteSummary *otherMessage = other; + return + self.hasPointCount == otherMessage.hasPointCount && + (!self.hasPointCount || self.pointCount == otherMessage.pointCount) && + self.hasFeatureCount == otherMessage.hasFeatureCount && + (!self.hasFeatureCount || self.featureCount == otherMessage.featureCount) && + self.hasDistance == otherMessage.hasDistance && + (!self.hasDistance || self.distance == otherMessage.distance) && + self.hasElapsedTime == otherMessage.hasElapsedTime && + (!self.hasElapsedTime || self.elapsedTime == otherMessage.elapsedTime) && + (self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields])); +} +- (NSUInteger) hash { + __block NSUInteger hashCode = 7; + if (self.hasPointCount) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.pointCount] hash]; + } + if (self.hasFeatureCount) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.featureCount] hash]; + } + if (self.hasDistance) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.distance] hash]; + } + if (self.hasElapsedTime) { + hashCode = hashCode * 31 + [[NSNumber numberWithInteger:self.elapsedTime] hash]; + } + hashCode = hashCode * 31 + [self.unknownFields hash]; + return hashCode; +} +@end + +@interface RouteSummaryBuilder() +@property (strong) RouteSummary* resultRouteSummary; +@end + +@implementation RouteSummaryBuilder +@synthesize resultRouteSummary; +- (instancetype) init { + if ((self = [super init])) { + self.resultRouteSummary = [[RouteSummary alloc] init]; + } + return self; +} +- (PBGeneratedMessage*) internalGetResult { + return resultRouteSummary; +} +- (RouteSummaryBuilder*) clear { + self.resultRouteSummary = [[RouteSummary alloc] init]; + return self; +} +- (RouteSummaryBuilder*) clone { + return [RouteSummary builderWithPrototype:resultRouteSummary]; +} +- (RouteSummary*) defaultInstance { + return [RouteSummary defaultInstance]; +} +- (RouteSummary*) build { + [self checkInitialized]; + return [self buildPartial]; +} +- (RouteSummary*) buildPartial { + RouteSummary* returnMe = resultRouteSummary; + self.resultRouteSummary = nil; + return returnMe; +} +- (RouteSummaryBuilder*) mergeFrom:(RouteSummary*) other { + if (other == [RouteSummary defaultInstance]) { + return self; + } + if (other.hasPointCount) { + [self setPointCount:other.pointCount]; + } + if (other.hasFeatureCount) { + [self setFeatureCount:other.featureCount]; + } + if (other.hasDistance) { + [self setDistance:other.distance]; + } + if (other.hasElapsedTime) { + [self setElapsedTime:other.elapsedTime]; + } + [self mergeUnknownFields:other.unknownFields]; + return self; +} +- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { + return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; +} +- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; + while (YES) { + SInt32 tag = [input readTag]; + switch (tag) { + case 0: + [self setUnknownFields:[unknownFields build]]; + return self; + default: { + if (![self parseUnknownField:input unknownFields:unknownFields extensionRegistry:extensionRegistry tag:tag]) { + [self setUnknownFields:[unknownFields build]]; + return self; + } + break; + } + case 8: { + [self setPointCount:[input readInt32]]; + break; + } + case 16: { + [self setFeatureCount:[input readInt32]]; + break; + } + case 24: { + [self setDistance:[input readInt32]]; + break; + } + case 32: { + [self setElapsedTime:[input readInt32]]; + break; + } + } + } +} +- (BOOL) hasPointCount { + return resultRouteSummary.hasPointCount; +} +- (SInt32) pointCount { + return resultRouteSummary.pointCount; +} +- (RouteSummaryBuilder*) setPointCount:(SInt32) value { + resultRouteSummary.hasPointCount = YES; + resultRouteSummary.pointCount = value; + return self; +} +- (RouteSummaryBuilder*) clearPointCount { + resultRouteSummary.hasPointCount = NO; + resultRouteSummary.pointCount = 0; + return self; +} +- (BOOL) hasFeatureCount { + return resultRouteSummary.hasFeatureCount; +} +- (SInt32) featureCount { + return resultRouteSummary.featureCount; +} +- (RouteSummaryBuilder*) setFeatureCount:(SInt32) value { + resultRouteSummary.hasFeatureCount = YES; + resultRouteSummary.featureCount = value; + return self; +} +- (RouteSummaryBuilder*) clearFeatureCount { + resultRouteSummary.hasFeatureCount = NO; + resultRouteSummary.featureCount = 0; + return self; +} +- (BOOL) hasDistance { + return resultRouteSummary.hasDistance; +} +- (SInt32) distance { + return resultRouteSummary.distance; +} +- (RouteSummaryBuilder*) setDistance:(SInt32) value { + resultRouteSummary.hasDistance = YES; + resultRouteSummary.distance = value; + return self; +} +- (RouteSummaryBuilder*) clearDistance { + resultRouteSummary.hasDistance = NO; + resultRouteSummary.distance = 0; + return self; +} +- (BOOL) hasElapsedTime { + return resultRouteSummary.hasElapsedTime; +} +- (SInt32) elapsedTime { + return resultRouteSummary.elapsedTime; +} +- (RouteSummaryBuilder*) setElapsedTime:(SInt32) value { + resultRouteSummary.hasElapsedTime = YES; + resultRouteSummary.elapsedTime = value; + return self; +} +- (RouteSummaryBuilder*) clearElapsedTime { + resultRouteSummary.hasElapsedTime = NO; + resultRouteSummary.elapsedTime = 0; + return self; +} +@end + + +// @@protoc_insertion_point(global_scope) From b7f970bc92966bfd237f8c6fc3d36f2f46c1da41 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 20 Mar 2015 21:49:24 -0700 Subject: [PATCH 4/9] Point the Podfile to a "generated" local podspec --- src/objective-c/examples/Sample/Podfile | 2 +- .../examples/Sample/protos/Route_guide.podspec | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/objective-c/examples/Sample/protos/Route_guide.podspec diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile index 4da8bc44f66..31bd4eb8216 100644 --- a/src/objective-c/examples/Sample/Podfile +++ b/src/objective-c/examples/Sample/Podfile @@ -2,7 +2,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' pod 'gRPC', :path => "../../../.." -pod 'ProtocolBuffers', '~> 1.9' +pod 'Route_guide', :path => "protos" link_with 'Sample', 'SampleTests' diff --git a/src/objective-c/examples/Sample/protos/Route_guide.podspec b/src/objective-c/examples/Sample/protos/Route_guide.podspec new file mode 100644 index 00000000000..3c7abf20d39 --- /dev/null +++ b/src/objective-c/examples/Sample/protos/Route_guide.podspec @@ -0,0 +1,16 @@ +Pod::Spec.new do |s| + s.name = 'Route_guide' + s.version = '0.0.1' + s.summary = 'Protobuf library generated from route_guide.proto' + s.homepage = 'https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample/protos' + s.license = 'New BSD' + s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } + + s.source_files = './*.{h,m}' + + s.platform = :ios + s.ios.deployment_target = '6.0' + s.requires_arc = true + + s.dependency 'ProtocolBuffers', '~> 1.9' +end From 0ae1f4d0ca6dd10b1ef881151193d6f29e843493 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 20 Mar 2015 22:37:22 -0700 Subject: [PATCH 5/9] Fix Route_guide to declare public headers --- src/objective-c/examples/Sample/protos/Route_guide.podspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objective-c/examples/Sample/protos/Route_guide.podspec b/src/objective-c/examples/Sample/protos/Route_guide.podspec index 3c7abf20d39..6fba1c5c1e3 100644 --- a/src/objective-c/examples/Sample/protos/Route_guide.podspec +++ b/src/objective-c/examples/Sample/protos/Route_guide.podspec @@ -6,7 +6,8 @@ Pod::Spec.new do |s| s.license = 'New BSD' s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } - s.source_files = './*.{h,m}' + s.source_files = '*.pb.{h,m}' + s.public_header_files = '*.pb.h' s.platform = :ios s.ios.deployment_target = '6.0' From aa5611bed7342e3ddc6e6ab73fbacb415b4efb77 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Fri, 20 Mar 2015 23:06:20 -0700 Subject: [PATCH 6/9] Adds Objective-C prefixes to the protos Generated with: protoc --plugin=/usr/local/bin/protoc-gen-objc route_guide.proto --proto_path=/Users/jcanizales/git/protobuf-objc/src/compiler --proto_path=. --objc_out="./" --- .../examples/Sample/protos/Route_guide.pb.h | 380 +++++++----- .../examples/Sample/protos/Route_guide.pb.m | 585 +++++++++--------- .../examples/Sample/protos/route_guide.proto | 5 +- 3 files changed, 507 insertions(+), 463 deletions(-) diff --git a/src/objective-c/examples/Sample/protos/Route_guide.pb.h b/src/objective-c/examples/Sample/protos/Route_guide.pb.h index f1e54d02def..194bfc5f2ae 100644 --- a/src/objective-c/examples/Sample/protos/Route_guide.pb.h +++ b/src/objective-c/examples/Sample/protos/Route_guide.pb.h @@ -4,26 +4,70 @@ // @@protoc_insertion_point(imports) -@class Feature; -@class FeatureBuilder; -@class Point; -@class PointBuilder; -@class Rectangle; -@class RectangleBuilder; -@class RouteNote; -@class RouteNoteBuilder; -@class RouteSummary; -@class RouteSummaryBuilder; - - - -@interface RouteGuideRoot : NSObject { +@class ObjectiveCFileOptions; +@class ObjectiveCFileOptionsBuilder; +@class PBDescriptorProto; +@class PBDescriptorProtoBuilder; +@class PBDescriptorProtoExtensionRange; +@class PBDescriptorProtoExtensionRangeBuilder; +@class PBEnumDescriptorProto; +@class PBEnumDescriptorProtoBuilder; +@class PBEnumOptions; +@class PBEnumOptionsBuilder; +@class PBEnumValueDescriptorProto; +@class PBEnumValueDescriptorProtoBuilder; +@class PBEnumValueOptions; +@class PBEnumValueOptionsBuilder; +@class PBFieldDescriptorProto; +@class PBFieldDescriptorProtoBuilder; +@class PBFieldOptions; +@class PBFieldOptionsBuilder; +@class PBFileDescriptorProto; +@class PBFileDescriptorProtoBuilder; +@class PBFileDescriptorSet; +@class PBFileDescriptorSetBuilder; +@class PBFileOptions; +@class PBFileOptionsBuilder; +@class PBMessageOptions; +@class PBMessageOptionsBuilder; +@class PBMethodDescriptorProto; +@class PBMethodDescriptorProtoBuilder; +@class PBMethodOptions; +@class PBMethodOptionsBuilder; +@class PBOneofDescriptorProto; +@class PBOneofDescriptorProtoBuilder; +@class PBServiceDescriptorProto; +@class PBServiceDescriptorProtoBuilder; +@class PBServiceOptions; +@class PBServiceOptionsBuilder; +@class PBSourceCodeInfo; +@class PBSourceCodeInfoBuilder; +@class PBSourceCodeInfoLocation; +@class PBSourceCodeInfoLocationBuilder; +@class PBUninterpretedOption; +@class PBUninterpretedOptionBuilder; +@class PBUninterpretedOptionNamePart; +@class PBUninterpretedOptionNamePartBuilder; +@class RGDFeature; +@class RGDFeatureBuilder; +@class RGDPoint; +@class RGDPointBuilder; +@class RGDRectangle; +@class RGDRectangleBuilder; +@class RGDRouteNote; +@class RGDRouteNoteBuilder; +@class RGDRouteSummary; +@class RGDRouteSummaryBuilder; + + + +@interface RGDRouteGuideRoot : NSObject { } + (PBExtensionRegistry*) extensionRegistry; + (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; @end -@interface Point : PBGeneratedMessage { +@interface RGDPoint : PBGeneratedMessage { @private BOOL hasLatitude_:1; BOOL hasLongitude_:1; @@ -40,179 +84,179 @@ - (BOOL) isInitialized; - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (PointBuilder*) builder; -+ (PointBuilder*) builder; -+ (PointBuilder*) builderWithPrototype:(Point*) prototype; -- (PointBuilder*) toBuilder; - -+ (Point*) parseFromData:(NSData*) data; -+ (Point*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (Point*) parseFromInputStream:(NSInputStream*) input; -+ (Point*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDPointBuilder*) builder; ++ (RGDPointBuilder*) builder; ++ (RGDPointBuilder*) builderWithPrototype:(RGDPoint*) prototype; +- (RGDPointBuilder*) toBuilder; + ++ (RGDPoint*) parseFromData:(NSData*) data; ++ (RGDPoint*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDPoint*) parseFromInputStream:(NSInputStream*) input; ++ (RGDPoint*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RGDPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @end -@interface PointBuilder : PBGeneratedMessageBuilder { +@interface RGDPointBuilder : PBGeneratedMessageBuilder { @private - Point* resultPoint; + RGDPoint* resultPoint; } -- (Point*) defaultInstance; +- (RGDPoint*) defaultInstance; -- (PointBuilder*) clear; -- (PointBuilder*) clone; +- (RGDPointBuilder*) clear; +- (RGDPointBuilder*) clone; -- (Point*) build; -- (Point*) buildPartial; +- (RGDPoint*) build; +- (RGDPoint*) buildPartial; -- (PointBuilder*) mergeFrom:(Point*) other; -- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDPointBuilder*) mergeFrom:(RGDPoint*) other; +- (RGDPointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RGDPointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - (BOOL) hasLatitude; - (SInt32) latitude; -- (PointBuilder*) setLatitude:(SInt32) value; -- (PointBuilder*) clearLatitude; +- (RGDPointBuilder*) setLatitude:(SInt32) value; +- (RGDPointBuilder*) clearLatitude; - (BOOL) hasLongitude; - (SInt32) longitude; -- (PointBuilder*) setLongitude:(SInt32) value; -- (PointBuilder*) clearLongitude; +- (RGDPointBuilder*) setLongitude:(SInt32) value; +- (RGDPointBuilder*) clearLongitude; @end -@interface Rectangle : PBGeneratedMessage { +@interface RGDRectangle : PBGeneratedMessage { @private BOOL hasLo_:1; BOOL hasHi_:1; - Point* lo; - Point* hi; + RGDPoint* lo; + RGDPoint* hi; } - (BOOL) hasLo; - (BOOL) hasHi; -@property (readonly, strong) Point* lo; -@property (readonly, strong) Point* hi; +@property (readonly, strong) RGDPoint* lo; +@property (readonly, strong) RGDPoint* hi; + (instancetype) defaultInstance; - (instancetype) defaultInstance; - (BOOL) isInitialized; - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RectangleBuilder*) builder; -+ (RectangleBuilder*) builder; -+ (RectangleBuilder*) builderWithPrototype:(Rectangle*) prototype; -- (RectangleBuilder*) toBuilder; - -+ (Rectangle*) parseFromData:(NSData*) data; -+ (Rectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (Rectangle*) parseFromInputStream:(NSInputStream*) input; -+ (Rectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDRectangleBuilder*) builder; ++ (RGDRectangleBuilder*) builder; ++ (RGDRectangleBuilder*) builderWithPrototype:(RGDRectangle*) prototype; +- (RGDRectangleBuilder*) toBuilder; + ++ (RGDRectangle*) parseFromData:(NSData*) data; ++ (RGDRectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDRectangle*) parseFromInputStream:(NSInputStream*) input; ++ (RGDRectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDRectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RGDRectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @end -@interface RectangleBuilder : PBGeneratedMessageBuilder { +@interface RGDRectangleBuilder : PBGeneratedMessageBuilder { @private - Rectangle* resultRectangle; + RGDRectangle* resultRectangle; } -- (Rectangle*) defaultInstance; +- (RGDRectangle*) defaultInstance; -- (RectangleBuilder*) clear; -- (RectangleBuilder*) clone; +- (RGDRectangleBuilder*) clear; +- (RGDRectangleBuilder*) clone; -- (Rectangle*) build; -- (Rectangle*) buildPartial; +- (RGDRectangle*) build; +- (RGDRectangle*) buildPartial; -- (RectangleBuilder*) mergeFrom:(Rectangle*) other; -- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDRectangleBuilder*) mergeFrom:(RGDRectangle*) other; +- (RGDRectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RGDRectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - (BOOL) hasLo; -- (Point*) lo; -- (RectangleBuilder*) setLo:(Point*) value; -- (RectangleBuilder*) setLoBuilder:(PointBuilder*) builderForValue; -- (RectangleBuilder*) mergeLo:(Point*) value; -- (RectangleBuilder*) clearLo; +- (RGDPoint*) lo; +- (RGDRectangleBuilder*) setLo:(RGDPoint*) value; +- (RGDRectangleBuilder*) setLoBuilder:(RGDPointBuilder*) builderForValue; +- (RGDRectangleBuilder*) mergeLo:(RGDPoint*) value; +- (RGDRectangleBuilder*) clearLo; - (BOOL) hasHi; -- (Point*) hi; -- (RectangleBuilder*) setHi:(Point*) value; -- (RectangleBuilder*) setHiBuilder:(PointBuilder*) builderForValue; -- (RectangleBuilder*) mergeHi:(Point*) value; -- (RectangleBuilder*) clearHi; +- (RGDPoint*) hi; +- (RGDRectangleBuilder*) setHi:(RGDPoint*) value; +- (RGDRectangleBuilder*) setHiBuilder:(RGDPointBuilder*) builderForValue; +- (RGDRectangleBuilder*) mergeHi:(RGDPoint*) value; +- (RGDRectangleBuilder*) clearHi; @end -@interface Feature : PBGeneratedMessage { +@interface RGDFeature : PBGeneratedMessage { @private BOOL hasName_:1; BOOL hasLocation_:1; NSString* name; - Point* location; + RGDPoint* location; } - (BOOL) hasName; - (BOOL) hasLocation; @property (readonly, strong) NSString* name; -@property (readonly, strong) Point* location; +@property (readonly, strong) RGDPoint* location; + (instancetype) defaultInstance; - (instancetype) defaultInstance; - (BOOL) isInitialized; - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (FeatureBuilder*) builder; -+ (FeatureBuilder*) builder; -+ (FeatureBuilder*) builderWithPrototype:(Feature*) prototype; -- (FeatureBuilder*) toBuilder; - -+ (Feature*) parseFromData:(NSData*) data; -+ (Feature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (Feature*) parseFromInputStream:(NSInputStream*) input; -+ (Feature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDFeatureBuilder*) builder; ++ (RGDFeatureBuilder*) builder; ++ (RGDFeatureBuilder*) builderWithPrototype:(RGDFeature*) prototype; +- (RGDFeatureBuilder*) toBuilder; + ++ (RGDFeature*) parseFromData:(NSData*) data; ++ (RGDFeature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDFeature*) parseFromInputStream:(NSInputStream*) input; ++ (RGDFeature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDFeature*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RGDFeature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @end -@interface FeatureBuilder : PBGeneratedMessageBuilder { +@interface RGDFeatureBuilder : PBGeneratedMessageBuilder { @private - Feature* resultFeature; + RGDFeature* resultFeature; } -- (Feature*) defaultInstance; +- (RGDFeature*) defaultInstance; -- (FeatureBuilder*) clear; -- (FeatureBuilder*) clone; +- (RGDFeatureBuilder*) clear; +- (RGDFeatureBuilder*) clone; -- (Feature*) build; -- (Feature*) buildPartial; +- (RGDFeature*) build; +- (RGDFeature*) buildPartial; -- (FeatureBuilder*) mergeFrom:(Feature*) other; -- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDFeatureBuilder*) mergeFrom:(RGDFeature*) other; +- (RGDFeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RGDFeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - (BOOL) hasName; - (NSString*) name; -- (FeatureBuilder*) setName:(NSString*) value; -- (FeatureBuilder*) clearName; +- (RGDFeatureBuilder*) setName:(NSString*) value; +- (RGDFeatureBuilder*) clearName; - (BOOL) hasLocation; -- (Point*) location; -- (FeatureBuilder*) setLocation:(Point*) value; -- (FeatureBuilder*) setLocationBuilder:(PointBuilder*) builderForValue; -- (FeatureBuilder*) mergeLocation:(Point*) value; -- (FeatureBuilder*) clearLocation; +- (RGDPoint*) location; +- (RGDFeatureBuilder*) setLocation:(RGDPoint*) value; +- (RGDFeatureBuilder*) setLocationBuilder:(RGDPointBuilder*) builderForValue; +- (RGDFeatureBuilder*) mergeLocation:(RGDPoint*) value; +- (RGDFeatureBuilder*) clearLocation; @end -@interface RouteNote : PBGeneratedMessage { +@interface RGDRouteNote : PBGeneratedMessage { @private BOOL hasMessage_:1; BOOL hasLocation_:1; NSString* message; - Point* location; + RGDPoint* location; } - (BOOL) hasLocation; - (BOOL) hasMessage; -@property (readonly, strong) Point* location; +@property (readonly, strong) RGDPoint* location; @property (readonly, strong) NSString* message; + (instancetype) defaultInstance; @@ -220,50 +264,50 @@ - (BOOL) isInitialized; - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RouteNoteBuilder*) builder; -+ (RouteNoteBuilder*) builder; -+ (RouteNoteBuilder*) builderWithPrototype:(RouteNote*) prototype; -- (RouteNoteBuilder*) toBuilder; - -+ (RouteNote*) parseFromData:(NSData*) data; -+ (RouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RouteNote*) parseFromInputStream:(NSInputStream*) input; -+ (RouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDRouteNoteBuilder*) builder; ++ (RGDRouteNoteBuilder*) builder; ++ (RGDRouteNoteBuilder*) builderWithPrototype:(RGDRouteNote*) prototype; +- (RGDRouteNoteBuilder*) toBuilder; + ++ (RGDRouteNote*) parseFromData:(NSData*) data; ++ (RGDRouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDRouteNote*) parseFromInputStream:(NSInputStream*) input; ++ (RGDRouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDRouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RGDRouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @end -@interface RouteNoteBuilder : PBGeneratedMessageBuilder { +@interface RGDRouteNoteBuilder : PBGeneratedMessageBuilder { @private - RouteNote* resultRouteNote; + RGDRouteNote* resultRouteNote; } -- (RouteNote*) defaultInstance; +- (RGDRouteNote*) defaultInstance; -- (RouteNoteBuilder*) clear; -- (RouteNoteBuilder*) clone; +- (RGDRouteNoteBuilder*) clear; +- (RGDRouteNoteBuilder*) clone; -- (RouteNote*) build; -- (RouteNote*) buildPartial; +- (RGDRouteNote*) build; +- (RGDRouteNote*) buildPartial; -- (RouteNoteBuilder*) mergeFrom:(RouteNote*) other; -- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDRouteNoteBuilder*) mergeFrom:(RGDRouteNote*) other; +- (RGDRouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RGDRouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - (BOOL) hasLocation; -- (Point*) location; -- (RouteNoteBuilder*) setLocation:(Point*) value; -- (RouteNoteBuilder*) setLocationBuilder:(PointBuilder*) builderForValue; -- (RouteNoteBuilder*) mergeLocation:(Point*) value; -- (RouteNoteBuilder*) clearLocation; +- (RGDPoint*) location; +- (RGDRouteNoteBuilder*) setLocation:(RGDPoint*) value; +- (RGDRouteNoteBuilder*) setLocationBuilder:(RGDPointBuilder*) builderForValue; +- (RGDRouteNoteBuilder*) mergeLocation:(RGDPoint*) value; +- (RGDRouteNoteBuilder*) clearLocation; - (BOOL) hasMessage; - (NSString*) message; -- (RouteNoteBuilder*) setMessage:(NSString*) value; -- (RouteNoteBuilder*) clearMessage; +- (RGDRouteNoteBuilder*) setMessage:(NSString*) value; +- (RGDRouteNoteBuilder*) clearMessage; @end -@interface RouteSummary : PBGeneratedMessage { +@interface RGDRouteSummary : PBGeneratedMessage { @private BOOL hasPointCount_:1; BOOL hasFeatureCount_:1; @@ -288,55 +332,55 @@ - (BOOL) isInitialized; - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; -- (RouteSummaryBuilder*) builder; -+ (RouteSummaryBuilder*) builder; -+ (RouteSummaryBuilder*) builderWithPrototype:(RouteSummary*) prototype; -- (RouteSummaryBuilder*) toBuilder; - -+ (RouteSummary*) parseFromData:(NSData*) data; -+ (RouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RouteSummary*) parseFromInputStream:(NSInputStream*) input; -+ (RouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; -+ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input; -+ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDRouteSummaryBuilder*) builder; ++ (RGDRouteSummaryBuilder*) builder; ++ (RGDRouteSummaryBuilder*) builderWithPrototype:(RGDRouteSummary*) prototype; +- (RGDRouteSummaryBuilder*) toBuilder; + ++ (RGDRouteSummary*) parseFromData:(NSData*) data; ++ (RGDRouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDRouteSummary*) parseFromInputStream:(NSInputStream*) input; ++ (RGDRouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; ++ (RGDRouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input; ++ (RGDRouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; @end -@interface RouteSummaryBuilder : PBGeneratedMessageBuilder { +@interface RGDRouteSummaryBuilder : PBGeneratedMessageBuilder { @private - RouteSummary* resultRouteSummary; + RGDRouteSummary* resultRouteSummary; } -- (RouteSummary*) defaultInstance; +- (RGDRouteSummary*) defaultInstance; -- (RouteSummaryBuilder*) clear; -- (RouteSummaryBuilder*) clone; +- (RGDRouteSummaryBuilder*) clear; +- (RGDRouteSummaryBuilder*) clone; -- (RouteSummary*) build; -- (RouteSummary*) buildPartial; +- (RGDRouteSummary*) build; +- (RGDRouteSummary*) buildPartial; -- (RouteSummaryBuilder*) mergeFrom:(RouteSummary*) other; -- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; -- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; +- (RGDRouteSummaryBuilder*) mergeFrom:(RGDRouteSummary*) other; +- (RGDRouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; +- (RGDRouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; - (BOOL) hasPointCount; - (SInt32) pointCount; -- (RouteSummaryBuilder*) setPointCount:(SInt32) value; -- (RouteSummaryBuilder*) clearPointCount; +- (RGDRouteSummaryBuilder*) setPointCount:(SInt32) value; +- (RGDRouteSummaryBuilder*) clearPointCount; - (BOOL) hasFeatureCount; - (SInt32) featureCount; -- (RouteSummaryBuilder*) setFeatureCount:(SInt32) value; -- (RouteSummaryBuilder*) clearFeatureCount; +- (RGDRouteSummaryBuilder*) setFeatureCount:(SInt32) value; +- (RGDRouteSummaryBuilder*) clearFeatureCount; - (BOOL) hasDistance; - (SInt32) distance; -- (RouteSummaryBuilder*) setDistance:(SInt32) value; -- (RouteSummaryBuilder*) clearDistance; +- (RGDRouteSummaryBuilder*) setDistance:(SInt32) value; +- (RGDRouteSummaryBuilder*) clearDistance; - (BOOL) hasElapsedTime; - (SInt32) elapsedTime; -- (RouteSummaryBuilder*) setElapsedTime:(SInt32) value; -- (RouteSummaryBuilder*) clearElapsedTime; +- (RGDRouteSummaryBuilder*) setElapsedTime:(SInt32) value; +- (RGDRouteSummaryBuilder*) clearElapsedTime; @end diff --git a/src/objective-c/examples/Sample/protos/Route_guide.pb.m b/src/objective-c/examples/Sample/protos/Route_guide.pb.m index d7847dfced1..63cdd00206d 100644 --- a/src/objective-c/examples/Sample/protos/Route_guide.pb.m +++ b/src/objective-c/examples/Sample/protos/Route_guide.pb.m @@ -3,16 +3,17 @@ #import "Route_guide.pb.h" // @@protoc_insertion_point(imports) -@implementation RouteGuideRoot +@implementation RGDRouteGuideRoot static PBExtensionRegistry* extensionRegistry = nil; + (PBExtensionRegistry*) extensionRegistry { return extensionRegistry; } + (void) initialize { - if (self == [RouteGuideRoot class]) { + if (self == [RGDRouteGuideRoot class]) { PBMutableExtensionRegistry* registry = [PBMutableExtensionRegistry registry]; [self registerAllExtensions:registry]; + [ObjectivecDescriptorRoot registerAllExtensions:registry]; extensionRegistry = registry; } } @@ -20,12 +21,12 @@ static PBExtensionRegistry* extensionRegistry = nil; } @end -@interface Point () +@interface RGDPoint () @property SInt32 latitude; @property SInt32 longitude; @end -@implementation Point +@implementation RGDPoint - (BOOL) hasLatitude { return !!hasLatitude_; @@ -48,17 +49,17 @@ static PBExtensionRegistry* extensionRegistry = nil; } return self; } -static Point* defaultPointInstance = nil; +static RGDPoint* defaultRGDPointInstance = nil; + (void) initialize { - if (self == [Point class]) { - defaultPointInstance = [[Point alloc] init]; + if (self == [RGDPoint class]) { + defaultRGDPointInstance = [[RGDPoint alloc] init]; } } + (instancetype) defaultInstance { - return defaultPointInstance; + return defaultRGDPointInstance; } - (instancetype) defaultInstance { - return defaultPointInstance; + return defaultRGDPointInstance; } - (BOOL) isInitialized { return YES; @@ -89,35 +90,35 @@ static Point* defaultPointInstance = nil; memoizedSerializedSize = size_; return size_; } -+ (Point*) parseFromData:(NSData*) data { - return (Point*)[[[Point builder] mergeFromData:data] build]; ++ (RGDPoint*) parseFromData:(NSData*) data { + return (RGDPoint*)[[[RGDPoint builder] mergeFromData:data] build]; } -+ (Point*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Point*)[[[Point builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; ++ (RGDPoint*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDPoint*)[[[RGDPoint builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; } -+ (Point*) parseFromInputStream:(NSInputStream*) input { - return (Point*)[[[Point builder] mergeFromInputStream:input] build]; ++ (RGDPoint*) parseFromInputStream:(NSInputStream*) input { + return (RGDPoint*)[[[RGDPoint builder] mergeFromInputStream:input] build]; } -+ (Point*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Point*)[[[Point builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDPoint*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDPoint*)[[[RGDPoint builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (Point*)[[[Point builder] mergeFromCodedInputStream:input] build]; ++ (RGDPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RGDPoint*)[[[RGDPoint builder] mergeFromCodedInputStream:input] build]; } -+ (Point*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Point*)[[[Point builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDPoint*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDPoint*)[[[RGDPoint builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (PointBuilder*) builder { - return [[PointBuilder alloc] init]; ++ (RGDPointBuilder*) builder { + return [[RGDPointBuilder alloc] init]; } -+ (PointBuilder*) builderWithPrototype:(Point*) prototype { - return [[Point builder] mergeFrom:prototype]; ++ (RGDPointBuilder*) builderWithPrototype:(RGDPoint*) prototype { + return [[RGDPoint builder] mergeFrom:prototype]; } -- (PointBuilder*) builder { - return [Point builder]; +- (RGDPointBuilder*) builder { + return [RGDPoint builder]; } -- (PointBuilder*) toBuilder { - return [Point builderWithPrototype:self]; +- (RGDPointBuilder*) toBuilder { + return [RGDPoint builderWithPrototype:self]; } - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { if (self.hasLatitude) { @@ -132,10 +133,10 @@ static Point* defaultPointInstance = nil; if (other == self) { return YES; } - if (![other isKindOfClass:[Point class]]) { + if (![other isKindOfClass:[RGDPoint class]]) { return NO; } - Point *otherMessage = other; + RGDPoint *otherMessage = other; return self.hasLatitude == otherMessage.hasLatitude && (!self.hasLatitude || self.latitude == otherMessage.latitude) && @@ -156,42 +157,42 @@ static Point* defaultPointInstance = nil; } @end -@interface PointBuilder() -@property (strong) Point* resultPoint; +@interface RGDPointBuilder() +@property (strong) RGDPoint* resultPoint; @end -@implementation PointBuilder +@implementation RGDPointBuilder @synthesize resultPoint; - (instancetype) init { if ((self = [super init])) { - self.resultPoint = [[Point alloc] init]; + self.resultPoint = [[RGDPoint alloc] init]; } return self; } - (PBGeneratedMessage*) internalGetResult { return resultPoint; } -- (PointBuilder*) clear { - self.resultPoint = [[Point alloc] init]; +- (RGDPointBuilder*) clear { + self.resultPoint = [[RGDPoint alloc] init]; return self; } -- (PointBuilder*) clone { - return [Point builderWithPrototype:resultPoint]; +- (RGDPointBuilder*) clone { + return [RGDPoint builderWithPrototype:resultPoint]; } -- (Point*) defaultInstance { - return [Point defaultInstance]; +- (RGDPoint*) defaultInstance { + return [RGDPoint defaultInstance]; } -- (Point*) build { +- (RGDPoint*) build { [self checkInitialized]; return [self buildPartial]; } -- (Point*) buildPartial { - Point* returnMe = resultPoint; +- (RGDPoint*) buildPartial { + RGDPoint* returnMe = resultPoint; self.resultPoint = nil; return returnMe; } -- (PointBuilder*) mergeFrom:(Point*) other { - if (other == [Point defaultInstance]) { +- (RGDPointBuilder*) mergeFrom:(RGDPoint*) other { + if (other == [RGDPoint defaultInstance]) { return self; } if (other.hasLatitude) { @@ -203,10 +204,10 @@ static Point* defaultPointInstance = nil; [self mergeUnknownFields:other.unknownFields]; return self; } -- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { +- (RGDPointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; } -- (PointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { +- (RGDPointBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; while (YES) { SInt32 tag = [input readTag]; @@ -238,12 +239,12 @@ static Point* defaultPointInstance = nil; - (SInt32) latitude { return resultPoint.latitude; } -- (PointBuilder*) setLatitude:(SInt32) value { +- (RGDPointBuilder*) setLatitude:(SInt32) value { resultPoint.hasLatitude = YES; resultPoint.latitude = value; return self; } -- (PointBuilder*) clearLatitude { +- (RGDPointBuilder*) clearLatitude { resultPoint.hasLatitude = NO; resultPoint.latitude = 0; return self; @@ -254,24 +255,24 @@ static Point* defaultPointInstance = nil; - (SInt32) longitude { return resultPoint.longitude; } -- (PointBuilder*) setLongitude:(SInt32) value { +- (RGDPointBuilder*) setLongitude:(SInt32) value { resultPoint.hasLongitude = YES; resultPoint.longitude = value; return self; } -- (PointBuilder*) clearLongitude { +- (RGDPointBuilder*) clearLongitude { resultPoint.hasLongitude = NO; resultPoint.longitude = 0; return self; } @end -@interface Rectangle () -@property (strong) Point* lo; -@property (strong) Point* hi; +@interface RGDRectangle () +@property (strong) RGDPoint* lo; +@property (strong) RGDPoint* hi; @end -@implementation Rectangle +@implementation RGDRectangle - (BOOL) hasLo { return !!hasLo_; @@ -289,22 +290,22 @@ static Point* defaultPointInstance = nil; @synthesize hi; - (instancetype) init { if ((self = [super init])) { - self.lo = [Point defaultInstance]; - self.hi = [Point defaultInstance]; + self.lo = [RGDPoint defaultInstance]; + self.hi = [RGDPoint defaultInstance]; } return self; } -static Rectangle* defaultRectangleInstance = nil; +static RGDRectangle* defaultRGDRectangleInstance = nil; + (void) initialize { - if (self == [Rectangle class]) { - defaultRectangleInstance = [[Rectangle alloc] init]; + if (self == [RGDRectangle class]) { + defaultRGDRectangleInstance = [[RGDRectangle alloc] init]; } } + (instancetype) defaultInstance { - return defaultRectangleInstance; + return defaultRGDRectangleInstance; } - (instancetype) defaultInstance { - return defaultRectangleInstance; + return defaultRGDRectangleInstance; } - (BOOL) isInitialized { return YES; @@ -335,35 +336,35 @@ static Rectangle* defaultRectangleInstance = nil; memoizedSerializedSize = size_; return size_; } -+ (Rectangle*) parseFromData:(NSData*) data { - return (Rectangle*)[[[Rectangle builder] mergeFromData:data] build]; ++ (RGDRectangle*) parseFromData:(NSData*) data { + return (RGDRectangle*)[[[RGDRectangle builder] mergeFromData:data] build]; } -+ (Rectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Rectangle*)[[[Rectangle builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; ++ (RGDRectangle*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRectangle*)[[[RGDRectangle builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; } -+ (Rectangle*) parseFromInputStream:(NSInputStream*) input { - return (Rectangle*)[[[Rectangle builder] mergeFromInputStream:input] build]; ++ (RGDRectangle*) parseFromInputStream:(NSInputStream*) input { + return (RGDRectangle*)[[[RGDRectangle builder] mergeFromInputStream:input] build]; } -+ (Rectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Rectangle*)[[[Rectangle builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDRectangle*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRectangle*)[[[RGDRectangle builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (Rectangle*)[[[Rectangle builder] mergeFromCodedInputStream:input] build]; ++ (RGDRectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RGDRectangle*)[[[RGDRectangle builder] mergeFromCodedInputStream:input] build]; } -+ (Rectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Rectangle*)[[[Rectangle builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDRectangle*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRectangle*)[[[RGDRectangle builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (RectangleBuilder*) builder { - return [[RectangleBuilder alloc] init]; ++ (RGDRectangleBuilder*) builder { + return [[RGDRectangleBuilder alloc] init]; } -+ (RectangleBuilder*) builderWithPrototype:(Rectangle*) prototype { - return [[Rectangle builder] mergeFrom:prototype]; ++ (RGDRectangleBuilder*) builderWithPrototype:(RGDRectangle*) prototype { + return [[RGDRectangle builder] mergeFrom:prototype]; } -- (RectangleBuilder*) builder { - return [Rectangle builder]; +- (RGDRectangleBuilder*) builder { + return [RGDRectangle builder]; } -- (RectangleBuilder*) toBuilder { - return [Rectangle builderWithPrototype:self]; +- (RGDRectangleBuilder*) toBuilder { + return [RGDRectangle builderWithPrototype:self]; } - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { if (self.hasLo) { @@ -384,10 +385,10 @@ static Rectangle* defaultRectangleInstance = nil; if (other == self) { return YES; } - if (![other isKindOfClass:[Rectangle class]]) { + if (![other isKindOfClass:[RGDRectangle class]]) { return NO; } - Rectangle *otherMessage = other; + RGDRectangle *otherMessage = other; return self.hasLo == otherMessage.hasLo && (!self.hasLo || [self.lo isEqual:otherMessage.lo]) && @@ -408,42 +409,42 @@ static Rectangle* defaultRectangleInstance = nil; } @end -@interface RectangleBuilder() -@property (strong) Rectangle* resultRectangle; +@interface RGDRectangleBuilder() +@property (strong) RGDRectangle* resultRectangle; @end -@implementation RectangleBuilder +@implementation RGDRectangleBuilder @synthesize resultRectangle; - (instancetype) init { if ((self = [super init])) { - self.resultRectangle = [[Rectangle alloc] init]; + self.resultRectangle = [[RGDRectangle alloc] init]; } return self; } - (PBGeneratedMessage*) internalGetResult { return resultRectangle; } -- (RectangleBuilder*) clear { - self.resultRectangle = [[Rectangle alloc] init]; +- (RGDRectangleBuilder*) clear { + self.resultRectangle = [[RGDRectangle alloc] init]; return self; } -- (RectangleBuilder*) clone { - return [Rectangle builderWithPrototype:resultRectangle]; +- (RGDRectangleBuilder*) clone { + return [RGDRectangle builderWithPrototype:resultRectangle]; } -- (Rectangle*) defaultInstance { - return [Rectangle defaultInstance]; +- (RGDRectangle*) defaultInstance { + return [RGDRectangle defaultInstance]; } -- (Rectangle*) build { +- (RGDRectangle*) build { [self checkInitialized]; return [self buildPartial]; } -- (Rectangle*) buildPartial { - Rectangle* returnMe = resultRectangle; +- (RGDRectangle*) buildPartial { + RGDRectangle* returnMe = resultRectangle; self.resultRectangle = nil; return returnMe; } -- (RectangleBuilder*) mergeFrom:(Rectangle*) other { - if (other == [Rectangle defaultInstance]) { +- (RGDRectangleBuilder*) mergeFrom:(RGDRectangle*) other { + if (other == [RGDRectangle defaultInstance]) { return self; } if (other.hasLo) { @@ -455,10 +456,10 @@ static Rectangle* defaultRectangleInstance = nil; [self mergeUnknownFields:other.unknownFields]; return self; } -- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { +- (RGDRectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; } -- (RectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { +- (RGDRectangleBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; while (YES) { SInt32 tag = [input readTag]; @@ -474,7 +475,7 @@ static Rectangle* defaultRectangleInstance = nil; break; } case 10: { - PointBuilder* subBuilder = [Point builder]; + RGDPointBuilder* subBuilder = [RGDPoint builder]; if (self.hasLo) { [subBuilder mergeFrom:self.lo]; } @@ -483,7 +484,7 @@ static Rectangle* defaultRectangleInstance = nil; break; } case 18: { - PointBuilder* subBuilder = [Point builder]; + RGDPointBuilder* subBuilder = [RGDPoint builder]; if (self.hasHi) { [subBuilder mergeFrom:self.hi]; } @@ -497,71 +498,71 @@ static Rectangle* defaultRectangleInstance = nil; - (BOOL) hasLo { return resultRectangle.hasLo; } -- (Point*) lo { +- (RGDPoint*) lo { return resultRectangle.lo; } -- (RectangleBuilder*) setLo:(Point*) value { +- (RGDRectangleBuilder*) setLo:(RGDPoint*) value { resultRectangle.hasLo = YES; resultRectangle.lo = value; return self; } -- (RectangleBuilder*) setLoBuilder:(PointBuilder*) builderForValue { +- (RGDRectangleBuilder*) setLoBuilder:(RGDPointBuilder*) builderForValue { return [self setLo:[builderForValue build]]; } -- (RectangleBuilder*) mergeLo:(Point*) value { +- (RGDRectangleBuilder*) mergeLo:(RGDPoint*) value { if (resultRectangle.hasLo && - resultRectangle.lo != [Point defaultInstance]) { + resultRectangle.lo != [RGDPoint defaultInstance]) { resultRectangle.lo = - [[[Point builderWithPrototype:resultRectangle.lo] mergeFrom:value] buildPartial]; + [[[RGDPoint builderWithPrototype:resultRectangle.lo] mergeFrom:value] buildPartial]; } else { resultRectangle.lo = value; } resultRectangle.hasLo = YES; return self; } -- (RectangleBuilder*) clearLo { +- (RGDRectangleBuilder*) clearLo { resultRectangle.hasLo = NO; - resultRectangle.lo = [Point defaultInstance]; + resultRectangle.lo = [RGDPoint defaultInstance]; return self; } - (BOOL) hasHi { return resultRectangle.hasHi; } -- (Point*) hi { +- (RGDPoint*) hi { return resultRectangle.hi; } -- (RectangleBuilder*) setHi:(Point*) value { +- (RGDRectangleBuilder*) setHi:(RGDPoint*) value { resultRectangle.hasHi = YES; resultRectangle.hi = value; return self; } -- (RectangleBuilder*) setHiBuilder:(PointBuilder*) builderForValue { +- (RGDRectangleBuilder*) setHiBuilder:(RGDPointBuilder*) builderForValue { return [self setHi:[builderForValue build]]; } -- (RectangleBuilder*) mergeHi:(Point*) value { +- (RGDRectangleBuilder*) mergeHi:(RGDPoint*) value { if (resultRectangle.hasHi && - resultRectangle.hi != [Point defaultInstance]) { + resultRectangle.hi != [RGDPoint defaultInstance]) { resultRectangle.hi = - [[[Point builderWithPrototype:resultRectangle.hi] mergeFrom:value] buildPartial]; + [[[RGDPoint builderWithPrototype:resultRectangle.hi] mergeFrom:value] buildPartial]; } else { resultRectangle.hi = value; } resultRectangle.hasHi = YES; return self; } -- (RectangleBuilder*) clearHi { +- (RGDRectangleBuilder*) clearHi { resultRectangle.hasHi = NO; - resultRectangle.hi = [Point defaultInstance]; + resultRectangle.hi = [RGDPoint defaultInstance]; return self; } @end -@interface Feature () +@interface RGDFeature () @property (strong) NSString* name; -@property (strong) Point* location; +@property (strong) RGDPoint* location; @end -@implementation Feature +@implementation RGDFeature - (BOOL) hasName { return !!hasName_; @@ -580,21 +581,21 @@ static Rectangle* defaultRectangleInstance = nil; - (instancetype) init { if ((self = [super init])) { self.name = @""; - self.location = [Point defaultInstance]; + self.location = [RGDPoint defaultInstance]; } return self; } -static Feature* defaultFeatureInstance = nil; +static RGDFeature* defaultRGDFeatureInstance = nil; + (void) initialize { - if (self == [Feature class]) { - defaultFeatureInstance = [[Feature alloc] init]; + if (self == [RGDFeature class]) { + defaultRGDFeatureInstance = [[RGDFeature alloc] init]; } } + (instancetype) defaultInstance { - return defaultFeatureInstance; + return defaultRGDFeatureInstance; } - (instancetype) defaultInstance { - return defaultFeatureInstance; + return defaultRGDFeatureInstance; } - (BOOL) isInitialized { return YES; @@ -625,35 +626,35 @@ static Feature* defaultFeatureInstance = nil; memoizedSerializedSize = size_; return size_; } -+ (Feature*) parseFromData:(NSData*) data { - return (Feature*)[[[Feature builder] mergeFromData:data] build]; ++ (RGDFeature*) parseFromData:(NSData*) data { + return (RGDFeature*)[[[RGDFeature builder] mergeFromData:data] build]; } -+ (Feature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Feature*)[[[Feature builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; ++ (RGDFeature*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDFeature*)[[[RGDFeature builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; } -+ (Feature*) parseFromInputStream:(NSInputStream*) input { - return (Feature*)[[[Feature builder] mergeFromInputStream:input] build]; ++ (RGDFeature*) parseFromInputStream:(NSInputStream*) input { + return (RGDFeature*)[[[RGDFeature builder] mergeFromInputStream:input] build]; } -+ (Feature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Feature*)[[[Feature builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDFeature*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDFeature*)[[[RGDFeature builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (Feature*)[[[Feature builder] mergeFromCodedInputStream:input] build]; ++ (RGDFeature*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RGDFeature*)[[[RGDFeature builder] mergeFromCodedInputStream:input] build]; } -+ (Feature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (Feature*)[[[Feature builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDFeature*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDFeature*)[[[RGDFeature builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (FeatureBuilder*) builder { - return [[FeatureBuilder alloc] init]; ++ (RGDFeatureBuilder*) builder { + return [[RGDFeatureBuilder alloc] init]; } -+ (FeatureBuilder*) builderWithPrototype:(Feature*) prototype { - return [[Feature builder] mergeFrom:prototype]; ++ (RGDFeatureBuilder*) builderWithPrototype:(RGDFeature*) prototype { + return [[RGDFeature builder] mergeFrom:prototype]; } -- (FeatureBuilder*) builder { - return [Feature builder]; +- (RGDFeatureBuilder*) builder { + return [RGDFeature builder]; } -- (FeatureBuilder*) toBuilder { - return [Feature builderWithPrototype:self]; +- (RGDFeatureBuilder*) toBuilder { + return [RGDFeature builderWithPrototype:self]; } - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { if (self.hasName) { @@ -671,10 +672,10 @@ static Feature* defaultFeatureInstance = nil; if (other == self) { return YES; } - if (![other isKindOfClass:[Feature class]]) { + if (![other isKindOfClass:[RGDFeature class]]) { return NO; } - Feature *otherMessage = other; + RGDFeature *otherMessage = other; return self.hasName == otherMessage.hasName && (!self.hasName || [self.name isEqual:otherMessage.name]) && @@ -695,42 +696,42 @@ static Feature* defaultFeatureInstance = nil; } @end -@interface FeatureBuilder() -@property (strong) Feature* resultFeature; +@interface RGDFeatureBuilder() +@property (strong) RGDFeature* resultFeature; @end -@implementation FeatureBuilder +@implementation RGDFeatureBuilder @synthesize resultFeature; - (instancetype) init { if ((self = [super init])) { - self.resultFeature = [[Feature alloc] init]; + self.resultFeature = [[RGDFeature alloc] init]; } return self; } - (PBGeneratedMessage*) internalGetResult { return resultFeature; } -- (FeatureBuilder*) clear { - self.resultFeature = [[Feature alloc] init]; +- (RGDFeatureBuilder*) clear { + self.resultFeature = [[RGDFeature alloc] init]; return self; } -- (FeatureBuilder*) clone { - return [Feature builderWithPrototype:resultFeature]; +- (RGDFeatureBuilder*) clone { + return [RGDFeature builderWithPrototype:resultFeature]; } -- (Feature*) defaultInstance { - return [Feature defaultInstance]; +- (RGDFeature*) defaultInstance { + return [RGDFeature defaultInstance]; } -- (Feature*) build { +- (RGDFeature*) build { [self checkInitialized]; return [self buildPartial]; } -- (Feature*) buildPartial { - Feature* returnMe = resultFeature; +- (RGDFeature*) buildPartial { + RGDFeature* returnMe = resultFeature; self.resultFeature = nil; return returnMe; } -- (FeatureBuilder*) mergeFrom:(Feature*) other { - if (other == [Feature defaultInstance]) { +- (RGDFeatureBuilder*) mergeFrom:(RGDFeature*) other { + if (other == [RGDFeature defaultInstance]) { return self; } if (other.hasName) { @@ -742,10 +743,10 @@ static Feature* defaultFeatureInstance = nil; [self mergeUnknownFields:other.unknownFields]; return self; } -- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { +- (RGDFeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; } -- (FeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { +- (RGDFeatureBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; while (YES) { SInt32 tag = [input readTag]; @@ -765,7 +766,7 @@ static Feature* defaultFeatureInstance = nil; break; } case 18: { - PointBuilder* subBuilder = [Point builder]; + RGDPointBuilder* subBuilder = [RGDPoint builder]; if (self.hasLocation) { [subBuilder mergeFrom:self.location]; } @@ -782,12 +783,12 @@ static Feature* defaultFeatureInstance = nil; - (NSString*) name { return resultFeature.name; } -- (FeatureBuilder*) setName:(NSString*) value { +- (RGDFeatureBuilder*) setName:(NSString*) value { resultFeature.hasName = YES; resultFeature.name = value; return self; } -- (FeatureBuilder*) clearName { +- (RGDFeatureBuilder*) clearName { resultFeature.hasName = NO; resultFeature.name = @""; return self; @@ -795,41 +796,41 @@ static Feature* defaultFeatureInstance = nil; - (BOOL) hasLocation { return resultFeature.hasLocation; } -- (Point*) location { +- (RGDPoint*) location { return resultFeature.location; } -- (FeatureBuilder*) setLocation:(Point*) value { +- (RGDFeatureBuilder*) setLocation:(RGDPoint*) value { resultFeature.hasLocation = YES; resultFeature.location = value; return self; } -- (FeatureBuilder*) setLocationBuilder:(PointBuilder*) builderForValue { +- (RGDFeatureBuilder*) setLocationBuilder:(RGDPointBuilder*) builderForValue { return [self setLocation:[builderForValue build]]; } -- (FeatureBuilder*) mergeLocation:(Point*) value { +- (RGDFeatureBuilder*) mergeLocation:(RGDPoint*) value { if (resultFeature.hasLocation && - resultFeature.location != [Point defaultInstance]) { + resultFeature.location != [RGDPoint defaultInstance]) { resultFeature.location = - [[[Point builderWithPrototype:resultFeature.location] mergeFrom:value] buildPartial]; + [[[RGDPoint builderWithPrototype:resultFeature.location] mergeFrom:value] buildPartial]; } else { resultFeature.location = value; } resultFeature.hasLocation = YES; return self; } -- (FeatureBuilder*) clearLocation { +- (RGDFeatureBuilder*) clearLocation { resultFeature.hasLocation = NO; - resultFeature.location = [Point defaultInstance]; + resultFeature.location = [RGDPoint defaultInstance]; return self; } @end -@interface RouteNote () -@property (strong) Point* location; +@interface RGDRouteNote () +@property (strong) RGDPoint* location; @property (strong) NSString* message; @end -@implementation RouteNote +@implementation RGDRouteNote - (BOOL) hasLocation { return !!hasLocation_; @@ -847,22 +848,22 @@ static Feature* defaultFeatureInstance = nil; @synthesize message; - (instancetype) init { if ((self = [super init])) { - self.location = [Point defaultInstance]; + self.location = [RGDPoint defaultInstance]; self.message = @""; } return self; } -static RouteNote* defaultRouteNoteInstance = nil; +static RGDRouteNote* defaultRGDRouteNoteInstance = nil; + (void) initialize { - if (self == [RouteNote class]) { - defaultRouteNoteInstance = [[RouteNote alloc] init]; + if (self == [RGDRouteNote class]) { + defaultRGDRouteNoteInstance = [[RGDRouteNote alloc] init]; } } + (instancetype) defaultInstance { - return defaultRouteNoteInstance; + return defaultRGDRouteNoteInstance; } - (instancetype) defaultInstance { - return defaultRouteNoteInstance; + return defaultRGDRouteNoteInstance; } - (BOOL) isInitialized { return YES; @@ -893,35 +894,35 @@ static RouteNote* defaultRouteNoteInstance = nil; memoizedSerializedSize = size_; return size_; } -+ (RouteNote*) parseFromData:(NSData*) data { - return (RouteNote*)[[[RouteNote builder] mergeFromData:data] build]; ++ (RGDRouteNote*) parseFromData:(NSData*) data { + return (RGDRouteNote*)[[[RGDRouteNote builder] mergeFromData:data] build]; } -+ (RouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RouteNote*)[[[RouteNote builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; ++ (RGDRouteNote*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRouteNote*)[[[RGDRouteNote builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; } -+ (RouteNote*) parseFromInputStream:(NSInputStream*) input { - return (RouteNote*)[[[RouteNote builder] mergeFromInputStream:input] build]; ++ (RGDRouteNote*) parseFromInputStream:(NSInputStream*) input { + return (RGDRouteNote*)[[[RGDRouteNote builder] mergeFromInputStream:input] build]; } -+ (RouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RouteNote*)[[[RouteNote builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDRouteNote*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRouteNote*)[[[RGDRouteNote builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RouteNote*)[[[RouteNote builder] mergeFromCodedInputStream:input] build]; ++ (RGDRouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RGDRouteNote*)[[[RGDRouteNote builder] mergeFromCodedInputStream:input] build]; } -+ (RouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RouteNote*)[[[RouteNote builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDRouteNote*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRouteNote*)[[[RGDRouteNote builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (RouteNoteBuilder*) builder { - return [[RouteNoteBuilder alloc] init]; ++ (RGDRouteNoteBuilder*) builder { + return [[RGDRouteNoteBuilder alloc] init]; } -+ (RouteNoteBuilder*) builderWithPrototype:(RouteNote*) prototype { - return [[RouteNote builder] mergeFrom:prototype]; ++ (RGDRouteNoteBuilder*) builderWithPrototype:(RGDRouteNote*) prototype { + return [[RGDRouteNote builder] mergeFrom:prototype]; } -- (RouteNoteBuilder*) builder { - return [RouteNote builder]; +- (RGDRouteNoteBuilder*) builder { + return [RGDRouteNote builder]; } -- (RouteNoteBuilder*) toBuilder { - return [RouteNote builderWithPrototype:self]; +- (RGDRouteNoteBuilder*) toBuilder { + return [RGDRouteNote builderWithPrototype:self]; } - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { if (self.hasLocation) { @@ -939,10 +940,10 @@ static RouteNote* defaultRouteNoteInstance = nil; if (other == self) { return YES; } - if (![other isKindOfClass:[RouteNote class]]) { + if (![other isKindOfClass:[RGDRouteNote class]]) { return NO; } - RouteNote *otherMessage = other; + RGDRouteNote *otherMessage = other; return self.hasLocation == otherMessage.hasLocation && (!self.hasLocation || [self.location isEqual:otherMessage.location]) && @@ -963,42 +964,42 @@ static RouteNote* defaultRouteNoteInstance = nil; } @end -@interface RouteNoteBuilder() -@property (strong) RouteNote* resultRouteNote; +@interface RGDRouteNoteBuilder() +@property (strong) RGDRouteNote* resultRouteNote; @end -@implementation RouteNoteBuilder +@implementation RGDRouteNoteBuilder @synthesize resultRouteNote; - (instancetype) init { if ((self = [super init])) { - self.resultRouteNote = [[RouteNote alloc] init]; + self.resultRouteNote = [[RGDRouteNote alloc] init]; } return self; } - (PBGeneratedMessage*) internalGetResult { return resultRouteNote; } -- (RouteNoteBuilder*) clear { - self.resultRouteNote = [[RouteNote alloc] init]; +- (RGDRouteNoteBuilder*) clear { + self.resultRouteNote = [[RGDRouteNote alloc] init]; return self; } -- (RouteNoteBuilder*) clone { - return [RouteNote builderWithPrototype:resultRouteNote]; +- (RGDRouteNoteBuilder*) clone { + return [RGDRouteNote builderWithPrototype:resultRouteNote]; } -- (RouteNote*) defaultInstance { - return [RouteNote defaultInstance]; +- (RGDRouteNote*) defaultInstance { + return [RGDRouteNote defaultInstance]; } -- (RouteNote*) build { +- (RGDRouteNote*) build { [self checkInitialized]; return [self buildPartial]; } -- (RouteNote*) buildPartial { - RouteNote* returnMe = resultRouteNote; +- (RGDRouteNote*) buildPartial { + RGDRouteNote* returnMe = resultRouteNote; self.resultRouteNote = nil; return returnMe; } -- (RouteNoteBuilder*) mergeFrom:(RouteNote*) other { - if (other == [RouteNote defaultInstance]) { +- (RGDRouteNoteBuilder*) mergeFrom:(RGDRouteNote*) other { + if (other == [RGDRouteNote defaultInstance]) { return self; } if (other.hasLocation) { @@ -1010,10 +1011,10 @@ static RouteNote* defaultRouteNoteInstance = nil; [self mergeUnknownFields:other.unknownFields]; return self; } -- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { +- (RGDRouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; } -- (RouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { +- (RGDRouteNoteBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; while (YES) { SInt32 tag = [input readTag]; @@ -1029,7 +1030,7 @@ static RouteNote* defaultRouteNoteInstance = nil; break; } case 10: { - PointBuilder* subBuilder = [Point builder]; + RGDPointBuilder* subBuilder = [RGDPoint builder]; if (self.hasLocation) { [subBuilder mergeFrom:self.location]; } @@ -1047,31 +1048,31 @@ static RouteNote* defaultRouteNoteInstance = nil; - (BOOL) hasLocation { return resultRouteNote.hasLocation; } -- (Point*) location { +- (RGDPoint*) location { return resultRouteNote.location; } -- (RouteNoteBuilder*) setLocation:(Point*) value { +- (RGDRouteNoteBuilder*) setLocation:(RGDPoint*) value { resultRouteNote.hasLocation = YES; resultRouteNote.location = value; return self; } -- (RouteNoteBuilder*) setLocationBuilder:(PointBuilder*) builderForValue { +- (RGDRouteNoteBuilder*) setLocationBuilder:(RGDPointBuilder*) builderForValue { return [self setLocation:[builderForValue build]]; } -- (RouteNoteBuilder*) mergeLocation:(Point*) value { +- (RGDRouteNoteBuilder*) mergeLocation:(RGDPoint*) value { if (resultRouteNote.hasLocation && - resultRouteNote.location != [Point defaultInstance]) { + resultRouteNote.location != [RGDPoint defaultInstance]) { resultRouteNote.location = - [[[Point builderWithPrototype:resultRouteNote.location] mergeFrom:value] buildPartial]; + [[[RGDPoint builderWithPrototype:resultRouteNote.location] mergeFrom:value] buildPartial]; } else { resultRouteNote.location = value; } resultRouteNote.hasLocation = YES; return self; } -- (RouteNoteBuilder*) clearLocation { +- (RGDRouteNoteBuilder*) clearLocation { resultRouteNote.hasLocation = NO; - resultRouteNote.location = [Point defaultInstance]; + resultRouteNote.location = [RGDPoint defaultInstance]; return self; } - (BOOL) hasMessage { @@ -1080,26 +1081,26 @@ static RouteNote* defaultRouteNoteInstance = nil; - (NSString*) message { return resultRouteNote.message; } -- (RouteNoteBuilder*) setMessage:(NSString*) value { +- (RGDRouteNoteBuilder*) setMessage:(NSString*) value { resultRouteNote.hasMessage = YES; resultRouteNote.message = value; return self; } -- (RouteNoteBuilder*) clearMessage { +- (RGDRouteNoteBuilder*) clearMessage { resultRouteNote.hasMessage = NO; resultRouteNote.message = @""; return self; } @end -@interface RouteSummary () +@interface RGDRouteSummary () @property SInt32 pointCount; @property SInt32 featureCount; @property SInt32 distance; @property SInt32 elapsedTime; @end -@implementation RouteSummary +@implementation RGDRouteSummary - (BOOL) hasPointCount { return !!hasPointCount_; @@ -1138,17 +1139,17 @@ static RouteNote* defaultRouteNoteInstance = nil; } return self; } -static RouteSummary* defaultRouteSummaryInstance = nil; +static RGDRouteSummary* defaultRGDRouteSummaryInstance = nil; + (void) initialize { - if (self == [RouteSummary class]) { - defaultRouteSummaryInstance = [[RouteSummary alloc] init]; + if (self == [RGDRouteSummary class]) { + defaultRGDRouteSummaryInstance = [[RGDRouteSummary alloc] init]; } } + (instancetype) defaultInstance { - return defaultRouteSummaryInstance; + return defaultRGDRouteSummaryInstance; } - (instancetype) defaultInstance { - return defaultRouteSummaryInstance; + return defaultRGDRouteSummaryInstance; } - (BOOL) isInitialized { return YES; @@ -1191,35 +1192,35 @@ static RouteSummary* defaultRouteSummaryInstance = nil; memoizedSerializedSize = size_; return size_; } -+ (RouteSummary*) parseFromData:(NSData*) data { - return (RouteSummary*)[[[RouteSummary builder] mergeFromData:data] build]; ++ (RGDRouteSummary*) parseFromData:(NSData*) data { + return (RGDRouteSummary*)[[[RGDRouteSummary builder] mergeFromData:data] build]; } -+ (RouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RouteSummary*)[[[RouteSummary builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; ++ (RGDRouteSummary*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRouteSummary*)[[[RGDRouteSummary builder] mergeFromData:data extensionRegistry:extensionRegistry] build]; } -+ (RouteSummary*) parseFromInputStream:(NSInputStream*) input { - return (RouteSummary*)[[[RouteSummary builder] mergeFromInputStream:input] build]; ++ (RGDRouteSummary*) parseFromInputStream:(NSInputStream*) input { + return (RGDRouteSummary*)[[[RGDRouteSummary builder] mergeFromInputStream:input] build]; } -+ (RouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RouteSummary*)[[[RouteSummary builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDRouteSummary*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRouteSummary*)[[[RGDRouteSummary builder] mergeFromInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input { - return (RouteSummary*)[[[RouteSummary builder] mergeFromCodedInputStream:input] build]; ++ (RGDRouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input { + return (RGDRouteSummary*)[[[RGDRouteSummary builder] mergeFromCodedInputStream:input] build]; } -+ (RouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { - return (RouteSummary*)[[[RouteSummary builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; ++ (RGDRouteSummary*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { + return (RGDRouteSummary*)[[[RGDRouteSummary builder] mergeFromCodedInputStream:input extensionRegistry:extensionRegistry] build]; } -+ (RouteSummaryBuilder*) builder { - return [[RouteSummaryBuilder alloc] init]; ++ (RGDRouteSummaryBuilder*) builder { + return [[RGDRouteSummaryBuilder alloc] init]; } -+ (RouteSummaryBuilder*) builderWithPrototype:(RouteSummary*) prototype { - return [[RouteSummary builder] mergeFrom:prototype]; ++ (RGDRouteSummaryBuilder*) builderWithPrototype:(RGDRouteSummary*) prototype { + return [[RGDRouteSummary builder] mergeFrom:prototype]; } -- (RouteSummaryBuilder*) builder { - return [RouteSummary builder]; +- (RGDRouteSummaryBuilder*) builder { + return [RGDRouteSummary builder]; } -- (RouteSummaryBuilder*) toBuilder { - return [RouteSummary builderWithPrototype:self]; +- (RGDRouteSummaryBuilder*) toBuilder { + return [RGDRouteSummary builderWithPrototype:self]; } - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent { if (self.hasPointCount) { @@ -1240,10 +1241,10 @@ static RouteSummary* defaultRouteSummaryInstance = nil; if (other == self) { return YES; } - if (![other isKindOfClass:[RouteSummary class]]) { + if (![other isKindOfClass:[RGDRouteSummary class]]) { return NO; } - RouteSummary *otherMessage = other; + RGDRouteSummary *otherMessage = other; return self.hasPointCount == otherMessage.hasPointCount && (!self.hasPointCount || self.pointCount == otherMessage.pointCount) && @@ -1274,42 +1275,42 @@ static RouteSummary* defaultRouteSummaryInstance = nil; } @end -@interface RouteSummaryBuilder() -@property (strong) RouteSummary* resultRouteSummary; +@interface RGDRouteSummaryBuilder() +@property (strong) RGDRouteSummary* resultRouteSummary; @end -@implementation RouteSummaryBuilder +@implementation RGDRouteSummaryBuilder @synthesize resultRouteSummary; - (instancetype) init { if ((self = [super init])) { - self.resultRouteSummary = [[RouteSummary alloc] init]; + self.resultRouteSummary = [[RGDRouteSummary alloc] init]; } return self; } - (PBGeneratedMessage*) internalGetResult { return resultRouteSummary; } -- (RouteSummaryBuilder*) clear { - self.resultRouteSummary = [[RouteSummary alloc] init]; +- (RGDRouteSummaryBuilder*) clear { + self.resultRouteSummary = [[RGDRouteSummary alloc] init]; return self; } -- (RouteSummaryBuilder*) clone { - return [RouteSummary builderWithPrototype:resultRouteSummary]; +- (RGDRouteSummaryBuilder*) clone { + return [RGDRouteSummary builderWithPrototype:resultRouteSummary]; } -- (RouteSummary*) defaultInstance { - return [RouteSummary defaultInstance]; +- (RGDRouteSummary*) defaultInstance { + return [RGDRouteSummary defaultInstance]; } -- (RouteSummary*) build { +- (RGDRouteSummary*) build { [self checkInitialized]; return [self buildPartial]; } -- (RouteSummary*) buildPartial { - RouteSummary* returnMe = resultRouteSummary; +- (RGDRouteSummary*) buildPartial { + RGDRouteSummary* returnMe = resultRouteSummary; self.resultRouteSummary = nil; return returnMe; } -- (RouteSummaryBuilder*) mergeFrom:(RouteSummary*) other { - if (other == [RouteSummary defaultInstance]) { +- (RGDRouteSummaryBuilder*) mergeFrom:(RGDRouteSummary*) other { + if (other == [RGDRouteSummary defaultInstance]) { return self; } if (other.hasPointCount) { @@ -1327,10 +1328,10 @@ static RouteSummary* defaultRouteSummaryInstance = nil; [self mergeUnknownFields:other.unknownFields]; return self; } -- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { +- (RGDRouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input { return [self mergeFromCodedInputStream:input extensionRegistry:[PBExtensionRegistry emptyRegistry]]; } -- (RouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { +- (RGDRouteSummaryBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry { PBUnknownFieldSetBuilder* unknownFields = [PBUnknownFieldSet builderWithUnknownFields:self.unknownFields]; while (YES) { SInt32 tag = [input readTag]; @@ -1370,12 +1371,12 @@ static RouteSummary* defaultRouteSummaryInstance = nil; - (SInt32) pointCount { return resultRouteSummary.pointCount; } -- (RouteSummaryBuilder*) setPointCount:(SInt32) value { +- (RGDRouteSummaryBuilder*) setPointCount:(SInt32) value { resultRouteSummary.hasPointCount = YES; resultRouteSummary.pointCount = value; return self; } -- (RouteSummaryBuilder*) clearPointCount { +- (RGDRouteSummaryBuilder*) clearPointCount { resultRouteSummary.hasPointCount = NO; resultRouteSummary.pointCount = 0; return self; @@ -1386,12 +1387,12 @@ static RouteSummary* defaultRouteSummaryInstance = nil; - (SInt32) featureCount { return resultRouteSummary.featureCount; } -- (RouteSummaryBuilder*) setFeatureCount:(SInt32) value { +- (RGDRouteSummaryBuilder*) setFeatureCount:(SInt32) value { resultRouteSummary.hasFeatureCount = YES; resultRouteSummary.featureCount = value; return self; } -- (RouteSummaryBuilder*) clearFeatureCount { +- (RGDRouteSummaryBuilder*) clearFeatureCount { resultRouteSummary.hasFeatureCount = NO; resultRouteSummary.featureCount = 0; return self; @@ -1402,12 +1403,12 @@ static RouteSummary* defaultRouteSummaryInstance = nil; - (SInt32) distance { return resultRouteSummary.distance; } -- (RouteSummaryBuilder*) setDistance:(SInt32) value { +- (RGDRouteSummaryBuilder*) setDistance:(SInt32) value { resultRouteSummary.hasDistance = YES; resultRouteSummary.distance = value; return self; } -- (RouteSummaryBuilder*) clearDistance { +- (RGDRouteSummaryBuilder*) clearDistance { resultRouteSummary.hasDistance = NO; resultRouteSummary.distance = 0; return self; @@ -1418,12 +1419,12 @@ static RouteSummary* defaultRouteSummaryInstance = nil; - (SInt32) elapsedTime { return resultRouteSummary.elapsedTime; } -- (RouteSummaryBuilder*) setElapsedTime:(SInt32) value { +- (RGDRouteSummaryBuilder*) setElapsedTime:(SInt32) value { resultRouteSummary.hasElapsedTime = YES; resultRouteSummary.elapsedTime = value; return self; } -- (RouteSummaryBuilder*) clearElapsedTime { +- (RGDRouteSummaryBuilder*) clearElapsedTime { resultRouteSummary.hasElapsedTime = NO; resultRouteSummary.elapsedTime = 0; return self; diff --git a/src/objective-c/examples/Sample/protos/route_guide.proto b/src/objective-c/examples/Sample/protos/route_guide.proto index 6d35e786b42..91b0372a079 100644 --- a/src/objective-c/examples/Sample/protos/route_guide.proto +++ b/src/objective-c/examples/Sample/protos/route_guide.proto @@ -31,9 +31,8 @@ syntax = "proto2"; package grpc.example.routeguide; -option java_multiple_files = true; -option java_package = "io.grpc.examples.routeguide"; -option java_outer_classname = "RouteGuideProto"; +import "google/protobuf/objectivec-descriptor.proto"; +option (google.protobuf.objectivec_file_options).class_prefix = "RGD"; // Interface exported by the server. service RouteGuide { From 6a84b3d269fe8965b360fab8f29e923c1d5e52ec Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 23 Mar 2015 11:55:05 -0700 Subject: [PATCH 7/9] Adds test that sends proto and expects one --- .../examples/Sample/SampleTests/SampleTests.m | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/objective-c/examples/Sample/SampleTests/SampleTests.m b/src/objective-c/examples/Sample/SampleTests/SampleTests.m index bf0b3642b13..92beb20a6a4 100644 --- a/src/objective-c/examples/Sample/SampleTests/SampleTests.m +++ b/src/objective-c/examples/Sample/SampleTests/SampleTests.m @@ -38,6 +38,7 @@ #import #import #import +#import @interface SampleTests : XCTestCase @end @@ -101,4 +102,37 @@ [self waitForExpectationsWithTimeout:2.0 handler:nil]; } + +- (void)testSimpleProtoRPC { + __weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."]; + __weak XCTestExpectation *expectedResponse = + [self expectationWithDescription:@"Expected response."]; + __weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."]; + + GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide" + interface:@"RouteGuide" + method:@"GetFeature"]; + + RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-30E7] build]; + id requestsWriter = [GRXWriter writerWithValue:[point data]]; + + GRPCCall *call = [[GRPCCall alloc] initWithHost:@"127.0.0.1:8980" + method:method + requestsWriter:requestsWriter]; + + id responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { + XCTAssertNotNil(value, @"nil value received as response."); + [response fulfill]; + RGDFeature *feature = [RGDFeature parseFromData:value]; + NSLog(@"%@ %@", feature.name, feature.location); + [expectedResponse fulfill]; + } completionHandler:^(NSError *errorOrNil) { + XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil); + [completion fulfill]; + }]; + + [call startWithWriteable:responsesWriteable]; + + [self waitForExpectationsWithTimeout:2.0 handler:nil]; +} @end From 6ad8c2008ebb30e0b411a391746403f3fd7c109c Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 23 Mar 2015 12:12:54 -0700 Subject: [PATCH 8/9] Adds more assertions to the test --- src/objective-c/examples/Sample/SampleTests/SampleTests.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objective-c/examples/Sample/SampleTests/SampleTests.m b/src/objective-c/examples/Sample/SampleTests/SampleTests.m index 92beb20a6a4..838efc1ce5e 100644 --- a/src/objective-c/examples/Sample/SampleTests/SampleTests.m +++ b/src/objective-c/examples/Sample/SampleTests/SampleTests.m @@ -124,7 +124,8 @@ XCTAssertNotNil(value, @"nil value received as response."); [response fulfill]; RGDFeature *feature = [RGDFeature parseFromData:value]; - NSLog(@"%@ %@", feature.name, feature.location); + XCTAssertEqualObjects(point, feature.location); + XCTAssertNotNil(feature.name, @"Response's name is nil."); [expectedResponse fulfill]; } completionHandler:^(NSError *errorOrNil) { XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil); From 3d86bca23fc9dcd4c050a02865a51ed580c9397f Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 23 Mar 2015 14:13:08 -0700 Subject: [PATCH 9/9] Centers the sample location in Gran Canaria :P --- src/objective-c/examples/Sample/SampleTests/SampleTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objective-c/examples/Sample/SampleTests/SampleTests.m b/src/objective-c/examples/Sample/SampleTests/SampleTests.m index 838efc1ce5e..ca5e302a174 100644 --- a/src/objective-c/examples/Sample/SampleTests/SampleTests.m +++ b/src/objective-c/examples/Sample/SampleTests/SampleTests.m @@ -113,7 +113,7 @@ interface:@"RouteGuide" method:@"GetFeature"]; - RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-30E7] build]; + RGDPoint *point = [[[[[RGDPointBuilder alloc] init] setLatitude:28E7] setLongitude:-15E7] build]; id requestsWriter = [GRXWriter writerWithValue:[point data]]; GRPCCall *call = [[GRPCCall alloc] initWithHost:@"127.0.0.1:8980"