/*
* Author:          Patrick-Christopher Mattulat
* Co-Author:       Claude Sonnet 4.6 (LLM)
* Company:         Lynar Studios
* E-Mail:          webmaster@lynarstudios.com
* Created:         2023-02-13
* Changed:         2026-06-23
*
* */

#ifndef LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP
#define LS_STD_CONDITIONAL_FUNCTION_EXECUTOR_HPP

#include <functional>
#include <ls-std/os/dynamic-goal.hpp>

/*
 * @doc: class(name: 'ConditionalFunctionExecutor', package: 'core')
 * @doc: core.ConditionalFunctionExecutor.description('This class can execute any method matching a specific signature based on a specific condition.')
 * */

namespace ls::standard::core
{
  class LS_STD_DYNAMIC_GOAL ConditionalFunctionExecutor
  {
    public:

      explicit ConditionalFunctionExecutor(bool _condition);
      ~ConditionalFunctionExecutor();

      void execute(const ::std::function<void()> &_function) const;

    private:

      bool condition{};
  };
}

#endif
