LUAWatchesDebuggerMessages.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef LUAEDITOR_LUAWATCHESDEBUGGERMESSAGES_H
  9. #define LUAEDITOR_LUAWATCHESDEBUGGERMESSAGES_H
  10. #include <AzCore/base.h>
  11. #include <AzCore/EBus/EBus.h>
  12. #include <AzCore/Script/ScriptContextDebug.h>
  13. #pragma once
  14. namespace LUAEditor
  15. {
  16. // messages going FROM the lua Context TO anyone watching variables
  17. class LUAWatchesDebuggerMessages
  18. : public AZ::EBusTraits
  19. {
  20. public:
  21. //////////////////////////////////////////////////////////////////////////
  22. // Bus configuration
  23. static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // we have one bus that we always broadcast to
  24. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Multiple; // we can have multiple listeners
  25. //////////////////////////////////////////////////////////////////////////
  26. typedef AZ::EBus<LUAWatchesDebuggerMessages> Bus;
  27. typedef Bus::Handler Handler;
  28. virtual void WatchesUpdate(const AZ::ScriptContextDebug::DebugValue& value) = 0;
  29. virtual void OnDebuggerAttached() = 0;
  30. virtual void OnDebuggerDetached() = 0;
  31. virtual ~LUAWatchesDebuggerMessages() {}
  32. };
  33. using LUAWatchesDebuggerMessagesRequestBus = AZ::EBus<LUAWatchesDebuggerMessages>;
  34. // messages going TO the lua Context FROM anyone needing watch info
  35. class LUAWatchesRequestMessages
  36. : public AZ::EBusTraits
  37. {
  38. public:
  39. //////////////////////////////////////////////////////////////////////////
  40. // Bus configuration
  41. static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // we have one bus that we always broadcast to
  42. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ:: EBusHandlerPolicy::Single; // we only have one listener
  43. //////////////////////////////////////////////////////////////////////////
  44. typedef AZ::EBus<LUAWatchesRequestMessages> Bus;
  45. typedef Bus::Handler Handler;
  46. virtual void RequestWatchedVariable(const AZStd::string& varName) = 0;
  47. virtual ~LUAWatchesRequestMessages() {}
  48. };
  49. using LUAWatchesRequestMessagesRequestBus = AZ::EBus<LUAWatchesRequestMessages>;
  50. }
  51. #endif//LUAEDITOR_LUAWATCHESDEBUGGERMESSAGES_H