FIRComponentContainerInternal.h 1.9 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 "FirebaseCore/Extension/FIRComponentContainer.h"
  18. #import "FirebaseCore/Extension/FIRLibrary.h"
  19. @class FIRApp;
  20. NS_ASSUME_NONNULL_BEGIN
  21. @interface FIRComponentContainer (Private)
  22. /// Initializes a container for a given app. This should only be called by the app itself.
  23. - (instancetype)initWithApp:(FIRApp *)app;
  24. /// Retrieves an instance that conforms to the specified protocol. This will return `nil` if the
  25. /// protocol wasn't registered, or if the instance couldn't be instantiated for the provided app.
  26. - (nullable id)instanceForProtocol:(Protocol *)protocol
  27. NS_SWIFT_UNAVAILABLE("Use `instance(for:)` from the FirebaseCoreExtension module instead.");
  28. /// Instantiates all the components that have registered as "eager" after initialization.
  29. - (void)instantiateEagerComponents;
  30. /// Remove all of the cached instances stored and allow them to clean up after themselves.
  31. - (void)removeAllCachedInstances;
  32. /// Removes all the components. After calling this method no new instances will be created.
  33. - (void)removeAllComponents;
  34. /// Register a class to provide components for the interoperability system. The class should conform
  35. /// to `FIRComponentRegistrant` and provide an array of `FIRComponent` objects.
  36. + (void)registerAsComponentRegistrant:(Class<FIRLibrary>)klass;
  37. @end
  38. NS_ASSUME_NONNULL_END