${Name}Bus.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <${Name}/${Name}TypeIds.h>
  10. #include <AzCore/EBus/EBus.h>
  11. #include <AzCore/Interface/Interface.h>
  12. namespace ${Name}
  13. {
  14. class ${Name}Requests
  15. {
  16. public:
  17. AZ_RTTI(${Name}Requests, ${Name}RequestsTypeId);
  18. virtual ~${Name}Requests() = default;
  19. // Put your public methods here
  20. };
  21. class ${Name}BusTraits
  22. : public AZ::EBusTraits
  23. {
  24. public:
  25. //////////////////////////////////////////////////////////////////////////
  26. // EBusTraits overrides
  27. static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
  28. static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
  29. //////////////////////////////////////////////////////////////////////////
  30. };
  31. using ${Name}RequestBus = AZ::EBus<${Name}Requests, ${Name}BusTraits>;
  32. using ${Name}Interface = AZ::Interface<${Name}Requests>;
  33. } // namespace ${Name}