PerformanceCollectionNotificationBus.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <AzCore/RTTI/BehaviorContext.h>
  9. #include <Atom/RPI.Public/PerformanceCollectionNotificationBus.h>
  10. DECLARE_EBUS_INSTANTIATION_DLL_SINGLE_ADDRESS(RPI::PerformaceCollectionNotification);
  11. namespace AZ::RPI
  12. {
  13. /**
  14. * Behavior Context forwarder
  15. */
  16. class PerformaceCollectionBehaviorHandler
  17. : public PerformaceCollectionNotificationBus::Handler
  18. , public AZ::BehaviorEBusHandler
  19. {
  20. public:
  21. AZ_EBUS_BEHAVIOR_BINDER(
  22. PerformaceCollectionBehaviorHandler, "{61464725-BDE4-465B-96BA-0409D32E29A9}",
  23. AZ::SystemAllocator,
  24. OnPerformanceCollectionJobFinished
  25. );
  26. void OnPerformanceCollectionJobFinished(const AZStd::string& outputfilePath) override
  27. {
  28. Call(FN_OnPerformanceCollectionJobFinished, outputfilePath);
  29. }
  30. };
  31. void PerformaceCollectionNotification::Reflect(AZ::ReflectContext* context)
  32. {
  33. if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  34. {
  35. behaviorContext->EBus<PerformaceCollectionNotificationBus>("RPIPerformaceCollectionNotificationBus")
  36. ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
  37. ->Attribute(AZ::Script::Attributes::Category, "RPI")
  38. ->Attribute(AZ::Script::Attributes::Module, "rpi")
  39. ->Handler<PerformaceCollectionBehaviorHandler>();
  40. }
  41. }
  42. } // namespace AZ::RPI