FWriteTree.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. @class FPath;
  18. @protocol FNode;
  19. @class FCompoundWrite;
  20. @class FWriteTreeRef;
  21. @class FChildrenNode;
  22. @class FNamedNode;
  23. @class FWriteRecord;
  24. @protocol FIndex;
  25. @class FCacheNode;
  26. @interface FWriteTree : NSObject
  27. - (FWriteTreeRef *)childWritesForPath:(FPath *)path;
  28. - (void)addOverwriteAtPath:(FPath *)path
  29. newData:(id<FNode>)newData
  30. writeId:(NSInteger)writeId
  31. isVisible:(BOOL)visible;
  32. - (void)addMergeAtPath:(FPath *)path
  33. changedChildren:(FCompoundWrite *)changedChildren
  34. writeId:(NSInteger)writeId;
  35. - (BOOL)removeWriteId:(NSInteger)writeId;
  36. - (NSArray *)removeAllWrites;
  37. - (FWriteRecord *)writeForId:(NSInteger)writeId;
  38. - (id<FNode>)calculateCompleteEventCacheAtPath:(FPath *)treePath
  39. completeServerCache:(id<FNode>)completeServerCache
  40. excludeWriteIds:(NSArray *)writeIdsToExclude
  41. includeHiddenWrites:(BOOL)includeHiddenWrites;
  42. - (id<FNode>)calculateCompleteEventChildrenAtPath:(FPath *)treePath
  43. completeServerChildren:
  44. (id<FNode>)completeServerChildren;
  45. - (id<FNode>)
  46. calculateEventCacheAfterServerOverwriteAtPath:(FPath *)treePath
  47. childPath:(FPath *)childPath
  48. existingEventSnap:(id<FNode>)existingEventSnap
  49. existingServerSnap:(id<FNode>)existingServerSnap;
  50. - (id<FNode>)calculateCompleteChildAtPath:(FPath *)treePath
  51. childKey:(NSString *)childKey
  52. cache:(FCacheNode *)existingServerCache;
  53. - (id<FNode>)shadowingWriteAtPath:(FPath *)path;
  54. - (FNamedNode *)calculateNextNodeAfterPost:(FNamedNode *)post
  55. atPath:(FPath *)path
  56. completeServerData:(id<FNode>)completeServerData
  57. reverse:(BOOL)reverse
  58. index:(id<FIndex>)index;
  59. @end