GDTCORStorage.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2018 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. #import <GoogleDataTransport/GDTCORLifecycle.h>
  18. @class GDTCOREvent;
  19. @class GDTCORStoredEvent;
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** Manages the storage of events. This class is thread-safe. */
  22. @interface GDTCORStorage : NSObject <NSSecureCoding, GDTCORLifecycleProtocol>
  23. /** Creates and/or returns the storage singleton.
  24. *
  25. * @return The storage singleton.
  26. */
  27. + (instancetype)sharedInstance;
  28. /** Stores event.dataObjectTransportBytes into a shared on-device folder and tracks the event via
  29. * a GDTCORStoredEvent instance.
  30. *
  31. * @param event The event to store.
  32. */
  33. - (void)storeEvent:(GDTCOREvent *)event;
  34. /** Removes a set of events from storage specified by their hash.
  35. *
  36. * @param events The set of stored events to remove.
  37. */
  38. - (void)removeEvents:(NSSet<GDTCORStoredEvent *> *)events;
  39. @end
  40. NS_ASSUME_NONNULL_END