FWriteTree.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 newData:(id<FNode>)newData writeId:(NSInteger)writeId isVisible:(BOOL)visible;
  29. - (void) addMergeAtPath:(FPath *)path changedChildren:(FCompoundWrite *)changedChildren writeId:(NSInteger)writeId;
  30. - (BOOL) removeWriteId:(NSInteger)writeId;
  31. - (NSArray *) removeAllWrites;
  32. - (FWriteRecord *)writeForId:(NSInteger)writeId;
  33. - (id<FNode>) calculateCompleteEventCacheAtPath:(FPath *)treePath
  34. completeServerCache:(id<FNode>)completeServerCache
  35. excludeWriteIds:(NSArray *)writeIdsToExclude
  36. includeHiddenWrites:(BOOL)includeHiddenWrites;
  37. - (id<FNode>) calculateCompleteEventChildrenAtPath:(FPath *)treePath
  38. completeServerChildren:(id<FNode>)completeServerChildren;
  39. - (id<FNode>) calculateEventCacheAfterServerOverwriteAtPath:(FPath *)treePath
  40. childPath:(FPath *)childPath
  41. existingEventSnap:(id<FNode>)existingEventSnap
  42. existingServerSnap:(id<FNode>)existingServerSnap;
  43. - (id<FNode>) calculateCompleteChildAtPath:(FPath *)treePath
  44. childKey:(NSString *)childKey
  45. cache:(FCacheNode *)existingServerCache;
  46. - (id<FNode>) shadowingWriteAtPath:(FPath *)path;
  47. - (FNamedNode *) calculateNextNodeAfterPost:(FNamedNode *)post
  48. atPath:(FPath *)path
  49. completeServerData:(id<FNode>)completeServerData
  50. reverse:(BOOL)reverse
  51. index:(id<FIndex>)index;
  52. @end