FSyncPoint.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. @protocol FOperation;
  18. @class FWriteTreeRef;
  19. @protocol FNode;
  20. @protocol FEventRegistration;
  21. @class FQuerySpec;
  22. @class FChildrenNode;
  23. @class FTupleRemovedQueriesEvents;
  24. @class FView;
  25. @class FPath;
  26. @class FCacheNode;
  27. @class FPersistenceManager;
  28. @interface FSyncPoint : NSObject
  29. - (id)initWithPersistenceManager:(FPersistenceManager *)persistence;
  30. - (BOOL)isEmpty;
  31. /**
  32. * Returns array of FEvent
  33. */
  34. - (NSArray *)applyOperation:(id<FOperation>)operation
  35. writesCache:(FWriteTreeRef *)writesCache
  36. serverCache:(id<FNode>)optCompleteServerCache;
  37. /**
  38. * Returns array of FEvent
  39. */
  40. - (NSArray *)addEventRegistration:(id<FEventRegistration>)eventRegistration
  41. forNonExistingViewForQuery:(FQuerySpec *)query
  42. writesCache:(FWriteTreeRef *)writesCache
  43. serverCache:(FCacheNode *)serverCache;
  44. - (NSArray *)addEventRegistration:(id<FEventRegistration>)eventRegistration
  45. forExistingViewForQuery:(FQuerySpec *)query;
  46. - (FTupleRemovedQueriesEvents *)removeEventRegistration:
  47. (id<FEventRegistration>)eventRegistration
  48. forQuery:(FQuerySpec *)query
  49. cancelError:(NSError *)cancelError;
  50. /**
  51. * Returns array of FViews
  52. */
  53. - (NSArray *)queryViews;
  54. - (id<FNode>)completeServerCacheAtPath:(FPath *)path;
  55. - (FView *)viewForQuery:(FQuerySpec *)query;
  56. - (BOOL)viewExistsForQuery:(FQuerySpec *)query;
  57. - (BOOL)hasCompleteView;
  58. - (FView *)completeView;
  59. @end