FTupleTransaction.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 <Foundation/Foundation.h>
  17. #import "FPath.h"
  18. #import "FTypedefs_Private.h"
  19. #import "FTypedefs.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 one goes first.
  27. */
  28. @property (nonatomic, strong) NSNumber* order;
  29. /**
  30. * Whether to raise local events for this transaction
  31. */
  32. @property (nonatomic) BOOL applyLocally;
  33. /**
  34. * Count how many times we've retried the transaction
  35. */
  36. @property (nonatomic) int retryCount;
  37. /**
  38. * Function to call to clean up our listener
  39. */
  40. @property (nonatomic, copy) fbt_void_void unwatcher;
  41. /**
  42. * Stores why a transaction was aborted
  43. */
  44. @property (nonatomic, strong, readonly) NSString* abortStatus;
  45. @property (nonatomic, strong, readonly) NSString* abortReason;
  46. - (void)setAbortStatus:(NSString *)abortStatus reason:(NSString *)reason;
  47. - (NSError *)abortError;
  48. @property (nonatomic, strong) NSNumber *currentWriteId;
  49. /**
  50. * Stores the input snapshot, before the update
  51. */
  52. @property (nonatomic, strong) id<FNode> currentInputSnapshot;
  53. /**
  54. * Stores the unresolved (for server values) output snapshot, after the update
  55. */
  56. @property (nonatomic, strong) id<FNode> currentOutputSnapshotRaw;
  57. /**
  58. * Stores the resolved (for server values) output snapshot, after the update
  59. */
  60. @property (nonatomic, strong) id<FNode> currentOutputSnapshotResolved;
  61. @end