23 #ifndef _THREAD_DAEMON_HPP_ 24 #define _THREAD_DAEMON_HPP_ 88 template <
typename Context>
117 template <
typename Context>
149 template <
typename Context>
160 m_thread = std::thread (daemon::loop_with_context<Context>,
this, context_manager_arg, exec,
m_name.c_str ());
163 template <
typename Context>
187 daemon_arg->
pause ();
200 #endif // _THREAD_DAEMON_HPP_ static std::size_t get_stats_value_count(void)
static void loop_with_context(daemon *daemon_arg, context_manager< Context > *context_manager_arg, task< Context > *exec_arg, const char *name)
generic_value< false > stat_value
static cubperf::statset & create_statset(void)
void register_stat_start(void)
void get_stats(cubperf::stat_value *stats_out)
virtual void retire(void)
virtual void execute(context_type &)=0
void stop_execution(void)
void register_stat_execute(void)
cubperf::statset & m_stats
daemon(const looper &loop_pattern_arg, context_manager< Context > *context_manager_arg, task< Context > *exec, const char *name)
static void loop_without_context(daemon *daemon_arg, task_without_context *exec_arg, const char *name)
virtual context_type & create_context(void)=0
bool is_stopped(void) const
virtual void retire_context(context_type &)=0
static const char * get_stat_name(std::size_t stat_index)
void register_stat_pause(void)
std::function< void(void)> m_func_on_stop