ConditionalFunctionExecutor.hpp 958 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2023-02-13
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #ifndef LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
  11. #define LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
  12. #include <functional>
  13. #include <ls-std/os/dynamic-goal.hpp>
  14. /*
  15. * @doc: class(name: 'ConditionalFunctionExecutor', package: 'core')
  16. * @doc: core.ConditionalFunctionExecutor.description('This class can execute any method matching a specific signature based on a specific condition.')
  17. * */
  18. namespace ls::standard::core
  19. {
  20. class LS_STD_DYNAMIC_GOAL ConditionalFunctionExecutor
  21. {
  22. public:
  23. explicit ConditionalFunctionExecutor(bool _condition);
  24. ~ConditionalFunctionExecutor();
  25. void execute(const ::std::function<void()> &_function) const;
  26. private:
  27. bool condition{};
  28. };
  29. }
  30. #endif