diff options
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCWrappedChannelArgs.h')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCWrappedChannelArgs.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedChannelArgs.h b/src/objective-c/GRPCClient/private/GRPCWrappedChannelArgs.h new file mode 100644 index 0000000000..3f1f5e6dee --- /dev/null +++ b/src/objective-c/GRPCClient/private/GRPCWrappedChannelArgs.h @@ -0,0 +1,29 @@ +#import <grpc/grpc.h> + +#pragma mark - Wrapped Channel Arguments + +/** + * A wrapper @c grpc_channel_args that frees allocated memory used to copy key / value pairs by the + * @c GRPCWrappedChannelArgsBuilder. + */ +@interface GRPCWrappedChannelArgs : NSObject + +@property(nonatomic, readonly) grpc_channel_args channelArgs; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +#pragma mark - Wrapped Channel Arguments Builder + +/** + * A builder that simplifies construction and usage of @c grpc_channel_args by building a + * @c GRPCWrappedChannelArgs. + */ +@interface GRPCWrappedChannelArgsBuilder : NSObject + +- (instancetype)addKey:(NSString *)key stringValue:(NSString *)value; +- (instancetype)addKey:(NSString *)key integerValue:(int)value; +- (GRPCWrappedChannelArgs *)build; + +@end
\ No newline at end of file |