GDTCORRegistrar.h 1.8 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/GDTCORLibrary/Internal/GDTCORStorageProtocol.h"
  18. #import "GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h"
  19. #import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORTargets.h"
  20. NS_ASSUME_NONNULL_BEGIN
  21. /** Manages the registration of targets with the transport SDK. */
  22. @interface GDTCORRegistrar : NSObject <GDTCORLifecycleProtocol>
  23. /** Creates and/or returns the singleton instance.
  24. *
  25. * @return The singleton instance of this class.
  26. */
  27. + (instancetype)sharedInstance;
  28. /** Registers a backend implementation with the GoogleDataTransport infrastructure.
  29. *
  30. * @param backend The backend object to register.
  31. * @param target The target this backend object will be responsible for.
  32. */
  33. - (void)registerUploader:(id<GDTCORUploader>)backend target:(GDTCORTarget)target;
  34. /** Registers a storage implementation with the GoogleDataTransport infrastructure.
  35. *
  36. * @param storage The storage instance to be associated with this uploader and target.
  37. * @param target The target this backend object will be responsible for.
  38. */
  39. - (void)registerStorage:(id<GDTCORStorageProtocol>)storage target:(GDTCORTarget)target;
  40. @end
  41. NS_ASSUME_NONNULL_END