ConditionalFunctionExecutor.hpp 679 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-13
  6. * Changed: 2023-02-21
  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. namespace ls::std::core
  14. {
  15. class LS_STD_DYNAMIC_GOAL ConditionalFunctionExecutor
  16. {
  17. public:
  18. explicit ConditionalFunctionExecutor(bool _condition);
  19. ~ConditionalFunctionExecutor();
  20. void execute(const ::std::function<void()> &_function) const;
  21. private:
  22. bool condition{};
  23. };
  24. }
  25. #endif