ProfilerModule.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #include <ProfilerSystemComponent.h>
  9. #include <AzCore/Memory/SystemAllocator.h>
  10. #include <AzCore/Module/Module.h>
  11. namespace OptickProfiler
  12. {
  13. class ProfilerModule : public AZ::Module
  14. {
  15. public:
  16. AZ_RTTI(ProfilerModule, "{189570C0-0E0E-4826-8AEC-DCE972CFC9B2}", AZ::Module);
  17. AZ_CLASS_ALLOCATOR(ProfilerModule, AZ::SystemAllocator);
  18. ProfilerModule()
  19. {
  20. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  21. // Add ALL components descriptors associated with this gem to m_descriptors.
  22. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and
  23. // EditContext. This happens through the [MyComponent]::Reflect() function.
  24. m_descriptors.insert(
  25. m_descriptors.end(),
  26. {
  27. ProfilerSystemComponent::CreateDescriptor(),
  28. });
  29. }
  30. /**
  31. * Add required SystemComponents to the SystemEntity.
  32. */
  33. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  34. {
  35. return AZ::ComponentTypeList{
  36. azrtti_typeid<ProfilerSystemComponent>(),
  37. };
  38. }
  39. };
  40. } // namespace OptickProfiler
  41. #if defined(O3DE_GEM_NAME)
  42. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), OptickProfiler::ProfilerModule)
  43. #else
  44. AZ_DECLARE_MODULE_CLASS(Gem_OptickProfiler, OptickProfiler::ProfilerModule)
  45. #endif