GULCCComponentContainerInternal.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright 2019 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 "GULCCComponent.h"
  18. #import "GULCCComponentContainer.h"
  19. NS_ASSUME_NONNULL_BEGIN
  20. @interface GULCCComponentContainer (Private)
  21. /// Initializes a container with a context.
  22. - (instancetype)initWithContext:(nullable id)context;
  23. /// Initializes a container with a context and a given set of registered `GULLibraries`.
  24. - (instancetype)initWithContext:(nullable id)context
  25. registrants:(NSMutableSet<Class> *)allRegistrants;
  26. /// Retrieves an instance that conforms to the specified protocol. This will return `nil` if the
  27. /// protocol wasn't registered, or if the instance couldn't be instantiated for the provided app.
  28. - (nullable id)instanceForProtocol:(Protocol *)protocol NS_SWIFT_NAME(instance(for:));
  29. /// Instantiates all the components that have registered as "eager" after initialization.
  30. - (void)instantiateEagerComponents;
  31. /// Remove all of the cached instances stored and allow them to clean up after themselves.
  32. - (void)removeAllCachedInstances;
  33. /// Register a class to provide components for the interoperability system. The class should conform
  34. /// to `GULCCComponentRegistrant` and provide an array of `GULCCComponent` objects.
  35. + (void)registerAsComponentRegistrant:(Class<GULCCLibrary>)klass;
  36. @end
  37. NS_ASSUME_NONNULL_END