FTupleTransaction.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FPath.h"
  17. #import "FTypedefs.h"
  18. #import "FTypedefs_Private.h"
  19. #import <Foundation/Foundation.h>
  20. @interface FTupleTransaction : NSObject
  21. @property(nonatomic, strong) FPath *path;
  22. @property(nonatomic, copy) fbt_transactionresult_mutabledata update;
  23. @property(nonatomic, copy) fbt_void_nserror_bool_datasnapshot onComplete;
  24. @property(nonatomic) FTransactionStatus status;
  25. /**
  26. * Used when combining transaction at different locations to figure out which
  27. * one goes first.
  28. */
  29. @property(nonatomic, strong) NSNumber *order;
  30. /**
  31. * Whether to raise local events for this transaction
  32. */
  33. @property(nonatomic) BOOL applyLocally;
  34. /**
  35. * Count how many times we've retried the transaction
  36. */
  37. @property(nonatomic) int retryCount;
  38. /**
  39. * Function to call to clean up our listener
  40. */
  41. @property(nonatomic, copy) fbt_void_void unwatcher;
  42. /**
  43. * Stores why a transaction was aborted
  44. */
  45. @property(nonatomic, strong, readonly) NSString *abortStatus;
  46. @property(nonatomic, strong, readonly) NSString *abortReason;
  47. - (void)setAbortStatus:(NSString *)abortStatus reason:(NSString *)reason;
  48. - (NSError *)abortError;
  49. @property(nonatomic, strong) NSNumber *currentWriteId;
  50. /**
  51. * Stores the input snapshot, before the update
  52. */
  53. @property(nonatomic, strong) id<FNode> currentInputSnapshot;
  54. /**
  55. * Stores the unresolved (for server values) output snapshot, after the update
  56. */
  57. @property(nonatomic, strong) id<FNode> currentOutputSnapshotRaw;
  58. /**
  59. * Stores the resolved (for server values) output snapshot, after the update
  60. */
  61. @property(nonatomic, strong) id<FNode> currentOutputSnapshotResolved;
  62. @end