TestDeviceAttribute.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 <AzFramework/Device/DeviceAttributesSystemComponent.h>
  10. namespace UnitTest
  11. {
  12. class TestDeviceAttribute
  13. : public AzFramework::DeviceAttribute
  14. {
  15. public:
  16. using EvalFunc = AZStd::function<bool(AZStd::string_view)>;
  17. TestDeviceAttribute(AZStd::string_view name, AZStd::string_view description, AZStd::any value, EvalFunc eval);
  18. ~TestDeviceAttribute() = default;
  19. AZStd::string_view GetName() const override;
  20. AZStd::string_view GetDescription() const override;
  21. bool Evaluate(AZStd::string_view rule) const override;
  22. AZStd::any GetValue() const override;
  23. private:
  24. AZStd::string m_name;
  25. AZStd::string m_description;
  26. EvalFunc m_eval;
  27. AZStd::any m_value;
  28. };
  29. } // namespace UnitTest