FSyncPoint.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 writesCache:(FWriteTreeRef *)writesCache serverCache:(id<FNode>)optCompleteServerCache;
  35. /**
  36. * Returns array of FEvent
  37. */
  38. - (NSArray *) addEventRegistration:(id <FEventRegistration>)eventRegistration
  39. forNonExistingViewForQuery:(FQuerySpec *)query
  40. writesCache:(FWriteTreeRef *)writesCache
  41. serverCache:(FCacheNode *)serverCache;
  42. - (NSArray *) addEventRegistration:(id <FEventRegistration>)eventRegistration
  43. forExistingViewForQuery:(FQuerySpec *)query;
  44. - (FTupleRemovedQueriesEvents *) removeEventRegistration:(id <FEventRegistration>)eventRegistration
  45. forQuery:(FQuerySpec *)query
  46. cancelError:(NSError *)cancelError;
  47. /**
  48. * Returns array of FViews
  49. */
  50. - (NSArray *) queryViews;
  51. - (id<FNode>) completeServerCacheAtPath:(FPath *)path;
  52. - (FView *) viewForQuery:(FQuerySpec *)query;
  53. - (BOOL) viewExistsForQuery:(FQuerySpec *)query;
  54. - (BOOL) hasCompleteView;
  55. - (FView *) completeView;
  56. @end