TestIntermediateAssetBuilderComponent.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/Component/Component.h>
  10. #include <AssetBuilderSDK/AssetBuilderBusses.h>
  11. namespace TestAssetBuilder
  12. {
  13. //! TestIntermediateAssetBuilderComponent handles the lifecycle of the builder.
  14. class TestIntermediateAssetBuilderComponent
  15. : public AZ::Component,
  16. public AssetBuilderSDK::AssetBuilderCommandBus::MultiHandler
  17. {
  18. public:
  19. AZ_COMPONENT(TestIntermediateAssetBuilderComponent, "{2D40D55D-7D31-4972-AFA3-1C396D0BEAC1}");
  20. void Init() override;
  21. void Activate() override;
  22. void Deactivate() override;
  23. static void Reflect(AZ::ReflectContext* context);
  24. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  25. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  26. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  27. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  28. //! Asset Builder Callback Functions
  29. void CreateJobsStage1(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response);
  30. void ProcessJobStage1(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response);
  31. void CreateJobsStage2(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response);
  32. void ProcessJobStage2(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response);
  33. void CreateJobsStage3(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response);
  34. void ProcessJobStage3(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response);
  35. //////////////////////////////////////////////////////////////////////////
  36. //!AssetBuilderSDK::AssetBuilderCommandBus interface
  37. void ShutDown() override; // if you get this you must fail all existing jobs and return.
  38. //////////////////////////////////////////////////////////////////////////
  39. private:
  40. bool m_isShuttingDown = false;
  41. };
  42. } // namespace TestAssetBuilder