aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-06-21 21:43:26 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-06-21 21:50:35 -0700
commit8d997752952becde6490d885ad21eef70758f874 (patch)
treed66a7175db395cf47439fdddff354c57775aefd9 /src/objective-c/GRPCClient/private/GRPCWrappedCall.h
parentbae38d9d5508d9cae026e8fad3944ad13f741cfd (diff)
Simplify GRPCOps implementations
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCWrappedCall.h')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
index 4deeec0475..adba624d5b 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
@@ -33,53 +33,50 @@
#import <Foundation/Foundation.h>
#include <grpc/grpc.h>
-#import "GRPCChannel.h"
-
-typedef void(^GRPCCompletionHandler)(NSDictionary *);
-
-@protocol GRPCOp <NSObject>
-- (void)getOp:(grpc_op *)op;
+#import "GRPCChannel.h"
+@interface GRPCOperation : NSObject
+@property(nonatomic, readonly) grpc_op op;
- (void)finish;
-
@end
-@interface GRPCOpSendMetadata : NSObject <GRPCOp>
+@interface GRPCOpSendMetadata : GRPCOperation
- (instancetype)initWithMetadata:(NSDictionary *)metadata
- handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
+ handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpSendMessage : NSObject <GRPCOp>
+@interface GRPCOpSendMessage : GRPCOperation
- (instancetype)initWithMessage:(NSData *)message
- handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
+ handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpSendClose : NSObject <GRPCOp>
+@interface GRPCOpSendClose : GRPCOperation
-- (instancetype)initWithHandler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithHandler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpRecvMetadata : NSObject <GRPCOp>
+@interface GRPCOpRecvMetadata : GRPCOperation
- (instancetype)initWithHandler:(void(^)(NSDictionary *))handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpRecvMessage : NSObject <GRPCOp>
+@interface GRPCOpRecvMessage : GRPCOperation
- (instancetype)initWithHandler:(void(^)(grpc_byte_buffer *))handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpRecvStatus : NSObject <GRPCOp>
+@interface GRPCOpRecvStatus : GRPCOperation
-- (instancetype)initWithHandler:(void(^)(NSError *, NSDictionary *))handler NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithHandler:(void(^)(NSError *, NSDictionary *))handler
+ NS_DESIGNATED_INITIALIZER;
@end