ScriptConfigEventBus.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #include <AzCore/Math/Uuid.h>
  11. #include <AzCore/std/parallel/mutex.h>
  12. #include <AzCore/std/smart_ptr/shared_ptr.h>
  13. #include <AzCore/std/string/string.h>
  14. #include <AzCore/IO/Path/Path.h>
  15. namespace AZ::SceneAPI::Events
  16. {
  17. //! This structure is used to store the pattern and script path to execute when the pattern matches an asset source.
  18. struct ScriptConfig
  19. {
  20. AZStd::string m_pattern;
  21. AZ::IO::FixedMaxPath m_scriptPath;
  22. };
  23. //! These events are used to manage the default script rules.
  24. class ScriptConfigEvents
  25. : public AZ::EBusTraits
  26. {
  27. public:
  28. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
  29. virtual ~ScriptConfigEvents() = default;
  30. //! Copies the script config entries into scriptConfigList.
  31. virtual void GetScriptConfigList(AZStd::vector<SceneAPI::Events::ScriptConfig>& scriptConfigList) const = 0;
  32. //! Determines if the script config matches a create jobs request
  33. virtual AZStd::optional<SceneAPI::Events::ScriptConfig> MatchesScriptConfig(const AZStd::string& sourceFile) const = 0;
  34. };
  35. using ScriptConfigEventBus = AZ::EBus<ScriptConfigEvents>;
  36. }