ConditionalFunctionExecutor.hpp 654 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: 2024-05-31
  7. *
  8. * */
  9. #ifndef LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
  10. #define LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
  11. #include "definition.hpp"
  12. #include <functional>
  13. namespace ls::std::core
  14. {
  15. ls_std_class 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