diff options
author | NicoleYarroch <nicole@livio.io> | 2019-03-06 13:46:20 -0500 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-03-06 13:46:20 -0500 |
commit | f51f1efc44d80fdfb7fe721fc8325b446550d87a (patch) | |
tree | f4ebaa9bafe4c0fcaf6a8b970231942fefac4a65 | |
parent | b04dfa95b875961dd65380ae34d6148452ada371 (diff) | |
download | sdl_ios-f51f1efc44d80fdfb7fe721fc8325b446550d87a.tar.gz |
Added documentation to the `SDLAsynchronousOperation` classes
Added documentation to:
* `SDLSequentialRPCRequestOperation` header file
* `SDLAsynchronousRPCRequestOperation` header file
* `SDLAsynchronousRPCOperation` header file
-rw-r--r-- | SmartDeviceLink/SDLAsynchronousRPCOperation.h | 13 | ||||
-rw-r--r-- | SmartDeviceLink/SDLAsynchronousRPCRequestOperation.h | 23 | ||||
-rw-r--r-- | SmartDeviceLink/SDLSequentialRPCRequestOperation.h | 12 |
3 files changed, 48 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLAsynchronousRPCOperation.h b/SmartDeviceLink/SDLAsynchronousRPCOperation.h index 66406ee6a..8bb27deb4 100644 --- a/SmartDeviceLink/SDLAsynchronousRPCOperation.h +++ b/SmartDeviceLink/SDLAsynchronousRPCOperation.h @@ -15,10 +15,23 @@ NS_ASSUME_NONNULL_BEGIN +/** + * Sends an RPC of type `Response` or `Notification`. Since these RPCs do not get a response from Core, the operation is considered finished as soon as the RPC is sent. RPCs of type `Request` can not be sent using this operation as `Request`s must get a response from Core before the operation is considered finished. To send `Requests` use the `SDLAsynchronousRPCRequestOperation` or the `SDLSequentialRPCRequestOperation` + */ @interface SDLAsynchronousRPCOperation : SDLAsynchronousOperation +/** + * An RPC of type `SDLRPCResponse` or `SDLRPCNotification`. + */ @property (copy, nonatomic) __kindof SDLRPCMessage *rpc; +/** + * Convenience init. + * + * @param connectionManager The connection manager used to send the RPC + * @param rpc An RPC of type `SDLRPCResponse` or `SDLRPCNotification` to be sent by the connection manager. + * @return A SDLAsynchronousRPCOperation object + */ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager rpc:(__kindof SDLRPCMessage *)rpc; @end diff --git a/SmartDeviceLink/SDLAsynchronousRPCRequestOperation.h b/SmartDeviceLink/SDLAsynchronousRPCRequestOperation.h index f4f689455..908d0d3e6 100644 --- a/SmartDeviceLink/SDLAsynchronousRPCRequestOperation.h +++ b/SmartDeviceLink/SDLAsynchronousRPCRequestOperation.h @@ -15,12 +15,35 @@ NS_ASSUME_NONNULL_BEGIN +/** + * Sends an array RPCs of type `Request` asynchronously. Requests must get a response from Core before the operation is considered finished. + */ @interface SDLAsynchronousRPCRequestOperation : SDLAsynchronousOperation +/** + * An array of RPCs of type `Request`. + */ @property (strong, nonatomic) NSArray<SDLRPCRequest *> *requests; +/** + * Convenience init for sending an array of requests asynchronously. + * + * @param connectionManager The connection manager used to send the RPCs + * @param requests The requests to be sent to Core + * @param progressHandler Called as each request gets a response from Core + * @param completionHandler Called when all requests have a response from Core + * @return A SDLAsynchronousRPCRequestOperation object + */ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager requests:(NSArray<SDLRPCRequest *> *)requests progressHandler:(nullable SDLMultipleAsyncRequestProgressHandler)progressHandler completionHandler:(nullable SDLMultipleRequestCompletionHandler)completionHandler; +/** + * Convenience init for sending one request asynchronously. + * + * @param connectionManager The connection manager used to send the RPCs + * @param request The request to be sent to Core + * @param responseHandler Called when the request has a response from Core + * @return A SDLAsynchronousRPCRequestOperation object + */ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager request:(SDLRPCRequest *)request responseHandler:(nullable SDLResponseHandler)responseHandler; @end diff --git a/SmartDeviceLink/SDLSequentialRPCRequestOperation.h b/SmartDeviceLink/SDLSequentialRPCRequestOperation.h index ee2a499a2..1d13dfbb4 100644 --- a/SmartDeviceLink/SDLSequentialRPCRequestOperation.h +++ b/SmartDeviceLink/SDLSequentialRPCRequestOperation.h @@ -15,8 +15,20 @@ NS_ASSUME_NONNULL_BEGIN +/** + * Sends an array RPCs of type `Request` with the first RPC to be sent at index 0. Sending is sequential, meaning that once an RPC is sent to Core, the operation waits until a response is received from Core before the next request is sent. Requests must get a response from Core before the operation is considered finished. + */ @interface SDLSequentialRPCRequestOperation : SDLAsynchronousOperation +/** + * Convenience init for sending an array of requests sequentially. + * + * @param connectionManager The connection manager used to send the RPCs + * @param requests The requests to be sent to Core + * @param progressHandler Called as each request gets a response from Core + * @param completionHandler Called when all requests have a response from Core + * @return A SDLSequentialRPCRequestOperation object + */ - (instancetype)initWithConnectionManager:(id<SDLConnectionManagerType>)connectionManager requests:(NSArray<SDLRPCRequest *> *)requests progressHandler:(nullable SDLMultipleSequentialRequestProgressHandler)progressHandler completionHandler:(nullable SDLMultipleRequestCompletionHandler)completionHandler; @end |