IndexOutOfBoundsEvaluator.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-10
  6. * Changed: 2024-09-11
  7. *
  8. * */
  9. #ifndef LS_STD_INDEX_OUT_OF_BOUNDS_EVALUATOR_EVALUATOR_HPP
  10. #define LS_STD_INDEX_OUT_OF_BOUNDS_EVALUATOR_EVALUATOR_HPP
  11. #include <ls-std/core/interface/IEvaluator.hpp>
  12. #include <ls-std/os/dynamic-goal.hpp>
  13. #include <string>
  14. /*
  15. * @doc: class(name: 'IndexOutOfBoundsEvaluator', package: 'core')
  16. * @doc: core.IndexOutOfBoundsEvaluator.description('This class evaluates whether a passed index is out of bounds.')
  17. * */
  18. namespace ls::std::core
  19. {
  20. class LS_STD_DYNAMIC_GOAL IndexOutOfBoundsEvaluator : public ls::std::core::interface_type::IEvaluator
  21. {
  22. public:
  23. explicit IndexOutOfBoundsEvaluator(size_t _index, size_t _size);
  24. explicit IndexOutOfBoundsEvaluator(size_t _index, size_t _size, ::std::string _message);
  25. ~IndexOutOfBoundsEvaluator() noexcept override;
  26. void evaluate() override;
  27. private:
  28. size_t index{};
  29. ::std::string message{};
  30. size_t size{};
  31. };
  32. }
  33. #endif