MBXHttpServiceFactory.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. @protocol MBXHttpServiceInterface;
  4. /**
  5. * HTTP service factory.
  6. *
  7. * This class is used to get a pointer/reference to HTTP service platform implementation.
  8. * In order to set a custom implementation, the client must call `setUserDefined()` method once before any actual HTTP service is required.
  9. */
  10. NS_SWIFT_NAME(HttpServiceFactory)
  11. __attribute__((visibility ("default")))
  12. @interface MBXHttpServiceFactory : NSObject
  13. // This class provides custom init which should be called
  14. - (nonnull instancetype)init NS_UNAVAILABLE;
  15. // This class provides custom init which should be called
  16. + (nonnull instancetype)new NS_UNAVAILABLE;
  17. /**
  18. * Replaces the implementation of the HTTP service with a custom one.
  19. *
  20. * If a default implementation has been created or previous a user defined implementation has been set already,
  21. * it will be replaced. The factory maintains a strong reference to the provided implementation
  22. * which can be released with the reset() method.
  23. */
  24. + (void)setUserDefinedForCustom:(nonnull id<MBXHttpServiceInterface>)custom;
  25. /**
  26. * Releases the implementation of the HTTP service.
  27. *
  28. * The strong reference from the factory to a custom HTTP service implementation will be released. This can be
  29. * used to release the HTTP service implementation once it is no longer needed. It may otherwise be kept until
  30. * the end of the program.
  31. */
  32. + (void)reset;
  33. /**
  34. * Returns an instance of the HTTP service.
  35. *
  36. * If a user defined implementation has been set with setUserDefined(), it will be returned.
  37. * Otherwise, a default implementation is allocated on the first call of after a call to reset().
  38. * The default implementation is kept until a call to reset() or setUserDefined() releases it.
  39. */
  40. + (nonnull id<MBXHttpServiceInterface>)getInstance __attribute((ns_returns_retained));
  41. @end