Scanner.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 <ScriptCanvas/Core/Core.h>
  10. #include <AzCore/Component/TickBus.h>
  11. #include <Editor/View/Windows/Tools/UpgradeTool/ModelTraits.h>
  12. namespace ScriptCanvasEditor
  13. {
  14. namespace VersionExplorer
  15. {
  16. class Scanner
  17. : private AZ::SystemTickBus::Handler
  18. {
  19. public:
  20. AZ_CLASS_ALLOCATOR(Scanner, AZ::SystemAllocator);
  21. Scanner(const ScanConfiguration& config, AZStd::function<void()> onComplete);
  22. const ScanResult& GetResult() const;
  23. ScanResult&& TakeResult();
  24. private:
  25. size_t m_catalogAssetIndex = 0;
  26. AZStd::function<void()> m_onComplete;
  27. ScanConfiguration m_config;
  28. ScanResult m_result;
  29. void FilterAsset(SourceHandle, bool isFromXMLSource);
  30. AZStd::pair<SourceHandle, bool> LoadSource();
  31. SourceHandle& ModCurrentAsset();
  32. void OnSystemTick() override;
  33. };
  34. }
  35. }