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