16#ifndef UTILITIES_INCLUDE_UTILITIES_WORKERTHREAD_HPP_
17#define UTILITIES_INCLUDE_UTILITIES_WORKERTHREAD_HPP_
72 explicit WorkerThread(std::function<
void(std::atomic<bool>&)> do_work);
WorkerThread contains a thread which runs the do_work() function.
std::unique_ptr< std::jthread > m_working_thread
void stop_working_thread()
Stop the working thread.
WorkerThread(WorkerThread &&)=delete
WorkerThread is not move-constructible.
void start_working_thread(const std::string &name="noname")
Start the working thread (which executes the do_work() function)
WorkerThread & operator=(WorkerThread &&)=delete
WorkerThread is not move-assignable.
std::atomic< bool > m_thread_running
WorkerThread & operator=(const WorkerThread &)=delete
WorkerThread is not copy-assginable.
bool thread_running() const
Determine if the thread is currently running.
WorkerThread(const WorkerThread &)=delete
WorkerThread is not copy-constructible.
std::function< void(std::atomic< bool > &)> m_do_work
WorkerThread(std::function< void(std::atomic< bool > &)> do_work)
WorkerThread Constructor.