ConditionalFunctionExecutor.hpp 758 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-13
  6. * Changed: 2024-09-09
  7. *
  8. * */
  9. #ifndef LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
  10. #define LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
  11. #include <functional>
  12. #include <ls-std/os/dynamic-goal.hpp>
  13. /*
  14. * @doc: class(name: 'ConditionalFunctionExecutor', package: 'core')
  15. * */
  16. namespace ls::std::core
  17. {
  18. class LS_STD_DYNAMIC_GOAL ConditionalFunctionExecutor
  19. {
  20. public:
  21. explicit ConditionalFunctionExecutor(bool _condition);
  22. ~ConditionalFunctionExecutor();
  23. void execute(const ::std::function<void()> &_function) const;
  24. private:
  25. bool condition{};
  26. };
  27. }
  28. #endif