JobWatcher.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. /*
  3. * Copyright (c) Contributors to the Open 3D Engine Project.
  4. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. *
  6. * SPDX-License-Identifier: Apache-2.0 OR MIT
  7. *
  8. */
  9. #if !defined(Q_MOC_RUN)
  10. #include <QObject>
  11. #include <QTimer>
  12. #include <AzCore/std/containers/vector.h>
  13. #include <AzCore/std/string/string.h>
  14. #include <SceneAPI/SceneUI/SceneUIConfiguration.h>
  15. #endif
  16. namespace AzToolsFramework
  17. {
  18. namespace AssetSystem
  19. {
  20. struct JobInfo;
  21. }
  22. }
  23. namespace AZ
  24. {
  25. namespace SceneAPI
  26. {
  27. namespace SceneUI
  28. {
  29. class SCENE_UI_API JobWatcher : public QObject
  30. {
  31. Q_OBJECT
  32. public:
  33. explicit JobWatcher(const AZStd::string& sourceAssetFullPath, Uuid traceTag);
  34. void StartMonitoring();
  35. signals:
  36. void JobQueryFailed(const char* message);
  37. void JobProcessingComplete(const AZStd::string& platform, u64 jobId, bool success, const AZStd::string& fullLog);
  38. void AllJobsComplete();
  39. private slots:
  40. void OnQueryJobs();
  41. private:
  42. static const int s_jobQueryInterval;
  43. AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
  44. AZStd::vector<u64> m_reportedJobs;
  45. AZStd::string m_sourceAssetFullPath;
  46. QTimer* m_jobQueryTimer;
  47. Uuid m_traceTag;
  48. AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
  49. };
  50. } // namespace SceneUI
  51. } // namespace SceneAPI
  52. } // namespace AZ