2
0

ImportContextRegistry.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Interface/Interface.h>
  10. #include <AzCore/Memory/SystemAllocator.h>
  11. #include <AzCore/RTTI/RTTI.h>
  12. #include <AzCore/std/smart_ptr/unique_ptr.h>
  13. namespace AZ
  14. {
  15. namespace SceneAPI
  16. {
  17. namespace SceneBuilder
  18. {
  19. struct ImportContextProvider;
  20. //! @brief ImportContextRegistry realizes ImportContextProvider's Abstract Factory Pattern.
  21. //!
  22. //! ImportContextRegistry provides a family of objects related to the Import Context of a particular Asset Import library.
  23. //! Those include ImportContexts for different stages of the Import pipeline as well as Scene and Node wrappers.
  24. //! ImportContexts are typically aware of their provider, so they could issue additional contexts in the same family,
  25. //! e.g., SceneNodeAppendedContext can be used to issue corresponding SceneAttributeDataPopulatedContext...
  26. class ImportContextRegistry
  27. {
  28. public:
  29. AZ_RTTI(ImportContextRegistry, "{5faaaa8a-2497-41d7-8b5c-5af4390af776}");
  30. AZ_CLASS_ALLOCATOR(ImportContextRegistry, AZ::SystemAllocator, 0);
  31. virtual ~ImportContextRegistry() = default;
  32. virtual void RegisterContextProvider(ImportContextProvider* provider) = 0;
  33. virtual void UnregisterContextProvider(ImportContextProvider* provider) = 0;
  34. virtual ImportContextProvider* SelectImportProvider(AZStd::string_view fileExtension) const = 0;
  35. };
  36. using ImportContextRegistryInterface = AZ::Interface<ImportContextRegistry>;
  37. } // namespace SceneBuilder
  38. } // namespace SceneAPI
  39. } // namespace AZ