LmbrCentral.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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/Component/Component.h>
  10. #include <AzCore/Module/Module.h>
  11. #include <AzCore/Asset/AssetManager.h>
  12. #include <AzCore/Asset/AssetTypeInfoBus.h>
  13. #include <AzCore/std/smart_ptr/unique_ptr.h>
  14. #include <AzCore/std/functional.h>
  15. /*!
  16. * \namespace LmbrCentral
  17. * LmbrCentral ties together systems from CryEngine and systems from the AZ framework.
  18. */
  19. namespace LmbrCentral
  20. {
  21. /*!
  22. * The LmbrCentral module class coordinates with the application
  23. * to reflect classes and create system components.
  24. *
  25. * Note that the \ref LmbrCentralEditorModule is used when working in the Editor.
  26. */
  27. AZ_PUSH_DISABLE_WARNING(4275, "-Wunknown-warning-option")
  28. class AZ_DLL_EXPORT LmbrCentralModule
  29. : public AZ::Module
  30. {
  31. public:
  32. AZ_RTTI(LmbrCentralModule, "{7969B004-21A2-4D3D-AC8B-90A4FABCFF1E}", Module);
  33. LmbrCentralModule();
  34. ~LmbrCentralModule() override = default;
  35. AZ::ComponentTypeList GetRequiredSystemComponents() const override;
  36. };
  37. AZ_POP_DISABLE_WARNING
  38. /*!
  39. * The LmbrCentral system component performs initialization/shutdown tasks
  40. * in coordination with other system components.
  41. */
  42. class LmbrCentralSystemComponent
  43. : public AZ::Component
  44. , private AZ::Data::AssetManagerNotificationBus::Handler
  45. {
  46. public:
  47. AZ_COMPONENT(LmbrCentralSystemComponent, "{CE249D37-C1D6-4A64-932D-C937B0EC2B8C}")
  48. static void Reflect(AZ::ReflectContext* context);
  49. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  50. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  51. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  52. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  53. LmbrCentralSystemComponent() = default;
  54. ~LmbrCentralSystemComponent() override = default;
  55. private:
  56. LmbrCentralSystemComponent(const LmbrCentralSystemComponent&) = delete;
  57. ////////////////////////////////////////////////////////////////////////////
  58. // AZ::Component
  59. void Activate() override;
  60. void Deactivate() override;
  61. ////////////////////////////////////////////////////////////////////////////
  62. AZStd::vector<AZStd::unique_ptr<AZ::Data::AssetHandler> > m_assetHandlers;
  63. AZStd::vector<AZStd::unique_ptr<AZ::AssetTypeInfoBus::Handler> > m_unhandledAssetInfo;
  64. AZStd::vector<AZStd::function<void()>> m_allocatorShutdowns;
  65. };
  66. } // namespace LmbrCentral