NullPointerArgumentEvaluator.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-08
  6. * Changed: 2024-09-11
  7. *
  8. * */
  9. #ifndef LS_STD_NULL_POINTER_ARGUMENT_EVALUATOR_HPP
  10. #define LS_STD_NULL_POINTER_ARGUMENT_EVALUATOR_HPP
  11. #include <ls-std/core/interface/IEvaluator.hpp>
  12. #include <ls-std/core/type/RawPointer.hpp>
  13. #include <ls-std/os/dynamic-goal.hpp>
  14. #include <memory>
  15. #include <string>
  16. /*
  17. * @doc: class(name: 'NullPointerArgumentEvaluator', package: 'core')
  18. * @doc: core.NullPointerArgumentEvaluator.description('This class evaluates whether a passed shared pointer argument is null.')
  19. * */
  20. namespace ls::std::core
  21. {
  22. class LS_STD_DYNAMIC_GOAL NullPointerArgumentEvaluator : public ls::std::core::interface_type::IEvaluator
  23. {
  24. public:
  25. explicit NullPointerArgumentEvaluator(const ::std::shared_ptr<void> &_argument);
  26. explicit NullPointerArgumentEvaluator(const ::std::shared_ptr<void> &_argument, ::std::string _message);
  27. ~NullPointerArgumentEvaluator() noexcept override;
  28. void evaluate() override;
  29. private:
  30. ::std::shared_ptr<void> argument{};
  31. ::std::string message{};
  32. };
  33. }
  34. #endif