RLMSyncSubscription_Private.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 Realm Inc.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. //
  17. ////////////////////////////////////////////////////////////////////////////
  18. #import "RLMSyncSubscription_Private.h"
  19. #import <memory>
  20. namespace realm::sync {
  21. class Subscription;
  22. class SubscriptionSet;
  23. }
  24. namespace realm {
  25. class Query;
  26. }
  27. RLM_HEADER_AUDIT_BEGIN(nullability, sendability)
  28. @interface RLMSyncSubscription ()
  29. - (instancetype)initWithSubscription:(realm::sync::Subscription)subscription subscriptionSet:(RLMSyncSubscriptionSet *)subscriptionSet;
  30. @end
  31. @interface RLMSyncSubscriptionSet () {
  32. @public
  33. std::unique_ptr<realm::sync::SubscriptionSet> _subscriptionSet;
  34. }
  35. - (instancetype)initWithSubscriptionSet:(realm::sync::SubscriptionSet)subscriptionSet realm:(RLMRealm *)realm;
  36. - (void)update:(__attribute__((noescape)) void(^)(void))block
  37. queue:(nullable dispatch_queue_t)queue
  38. timeout:(NSTimeInterval)timeout
  39. onComplete:(void(^)(NSError *))completionBlock;
  40. - (RLMObjectId *)addSubscriptionWithClassName:(NSString *)objectClassName
  41. subscriptionName:(nullable NSString *)name
  42. query:(realm::Query)query
  43. updateExisting:(BOOL)updateExisting;
  44. - (nullable RLMSyncSubscription *)subscriptionWithQuery:(realm::Query)query;
  45. // Return subscription that matches name *and* query
  46. - (nullable RLMSyncSubscription *)subscriptionWithName:(NSString *)name
  47. query:(realm::Query)query;
  48. - (void)removeSubscriptionWithClassName:(NSString *)objectClassName
  49. query:(realm::Query)query;
  50. - (void)removeSubscriptionWithId:(RLMObjectId *)objectId;
  51. @end
  52. RLM_HEADER_AUDIT_END(nullability, sendability)