PythonSymbolsBus.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/EBus/EBus.h>
  10. namespace AZ
  11. {
  12. class BehaviorClass;
  13. class BehaviorMethod;
  14. class BehaviorEBus;
  15. class BehaviorProperty;
  16. }
  17. namespace EditorPythonBindings
  18. {
  19. //! An interface to track exported Python symbols
  20. class PythonSymbolEvents
  21. : public AZ::EBusTraits
  22. {
  23. public:
  24. // the symbols will be written out in the future
  25. static const bool EnableEventQueue = true;
  26. //! logs a behavior class type
  27. virtual void LogClass(const AZStd::string moduleName, const AZ::BehaviorClass* behaviorClass) = 0;
  28. //! logs a behavior class type with an override to its name
  29. virtual void LogClassWithName(
  30. const AZStd::string moduleName,
  31. const AZ::BehaviorClass* behaviorClass,
  32. const AZStd::string className) = 0;
  33. //! logs a static class method with a specified global method name
  34. virtual void LogClassMethod(
  35. const AZStd::string moduleName,
  36. const AZStd::string globalMethodName,
  37. const AZ::BehaviorClass* behaviorClass,
  38. const AZ::BehaviorMethod* behaviorMethod) = 0;
  39. //! logs a behavior bus with a specified bus name
  40. virtual void LogBus(const AZStd::string moduleName, const AZStd::string busName, const AZ::BehaviorEBus* behaviorEBus) = 0;
  41. //! logs a global method from the behavior context registry with a specified method name
  42. virtual void LogGlobalMethod(
  43. const AZStd::string moduleName,
  44. const AZStd::string methodName,
  45. const AZ::BehaviorMethod* behaviorMethod) = 0;
  46. //! logs a global property, enum, or constant from the behavior context registry with a specified property name
  47. virtual void LogGlobalProperty(
  48. const AZStd::string moduleName,
  49. const AZStd::string propertyName,
  50. const AZ::BehaviorProperty* behaviorProperty) = 0;
  51. //! signals the end of the logging of symbols
  52. virtual void Finalize() = 0;
  53. };
  54. using PythonSymbolEventBus = AZ::EBus<PythonSymbolEvents>;
  55. } // namespace EditorPythonBindings