ProcessingResult.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #include <SceneAPI/SceneCore/SceneCoreConfiguration.h>
  10. namespace AZ
  11. {
  12. namespace SceneAPI
  13. {
  14. namespace Events
  15. {
  16. enum class ProcessingResult
  17. {
  18. Ignored, // Event didn't apply to the processor or there was no work to do.
  19. Success, // Data was successfully processed.
  20. Failure // Attempts to process data failed.
  21. };
  22. // Combines ProcessingResult together with the stored value such that
  23. // Ignored doesn't change the stored value,
  24. // Failure is always stored,
  25. // Success is only stored if not already set to failure.
  26. class ProcessingResultCombiner
  27. {
  28. public:
  29. SCENE_CORE_API ProcessingResultCombiner();
  30. SCENE_CORE_API void operator=(ProcessingResult rhs); // For use with EBus
  31. SCENE_CORE_API void operator+=(ProcessingResult rhs); // Common use.
  32. SCENE_CORE_API ProcessingResult GetResult() const;
  33. private:
  34. void Combine(ProcessingResult rhs);
  35. ProcessingResult m_value;
  36. };
  37. } // Events
  38. } // SceneAPI
  39. } // AZ