You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.6 KiB

  1. // Copyright 2019 Google
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import "FIRCLSFABAsyncOperation.h"
  15. /**
  16. * If the compound operation is sent a @c -[cancel] message while executing, it will attempt to
  17. * cancel all operations on its internal queue, and will return an error in its @c asyncCompletion
  18. * block with this value as its code.
  19. */
  20. FOUNDATION_EXPORT const NSUInteger FIRCLSCompoundOperationErrorCodeCancelled;
  21. /**
  22. * If one or more of the operations on the @c compoundQueue fail, this operation returns an error
  23. * in its @c asyncCompletion block with this code, and an array of @c NSErrors keyed on @c
  24. * FIRCLSCompoundOperationErrorUserInfoKeyUnderlyingErrors in the @c userInfo dictionary.
  25. */
  26. FOUNDATION_EXPORT const NSUInteger FIRCLSCompoundOperationErrorCodeSuboperationFailed;
  27. /**
  28. * When all the operations complete, this @c FIRCLSCompoundOperation instance's @c asyncCompletion
  29. * block is called. If any errors were passed by the suboperations' @c asyncCompletion blocks, they
  30. * are put in an array which can be accessed in the @c userInfo dictionary in the error parameter
  31. * for this instance's @c asyncCompletion block.
  32. */
  33. FOUNDATION_EXPORT NSString *const FIRCLSCompoundOperationErrorUserInfoKeyUnderlyingErrors;
  34. /**
  35. * An operation that executes a collection of suboperations on an internal private queue. Any
  36. * instance of @c FIRCLSFABAsyncOperation passed into this instance's @c operations property has the
  37. * potential to return an @c NSError in its @c asyncCompletion block. This instance's @c
  38. * asyncCompletion block will put all such errors in an @c NSArray and return an @c NSError whose @c
  39. * userInfo contains that array keyed by @c FIRCLSCompoundOperationErrorUserInfoKeyUnderlyingErrors.
  40. */
  41. @interface FIRCLSCompoundOperation : FIRCLSFABAsyncOperation
  42. /**
  43. * An array of @c NSOperations to execute, which can include instances of @c FIRCLSFABAsyncOperation
  44. * or
  45. * @c FIRCLSCompoundOperation. This operation will not be marked as finished until all suboperations
  46. * are marked as finished.
  47. */
  48. @property(copy, nonatomic) NSArray<NSOperation *> *operations;
  49. @property(strong, nonatomic, readonly) NSOperationQueue *compoundQueue;
  50. @end