Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
IRunnable.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_THREADS_IRUNNABLE_HPP_
2#define IV_SRC_THREADS_IRUNNABLE_HPP_
3
4#include <string_view>
5
6namespace iv::threads
7{
8
10{
11public:
12 enum class eRunnableState
13 {
14 Init,
15 Running,
16 Paused,
18 Stopped,
19 };
20
21 virtual ~IRunnable() = default;
22
23 virtual bool isRunning() = 0;
24 virtual bool isPaused() = 0;
25 virtual bool isStopped() = 0;
26
27 virtual void run() = 0;
28 virtual void pause() = 0;
29 virtual void resume() = 0;
30 virtual void stop() = 0;
31
32 void setTaskName(const std::string_view taskName)
33 {
34 m_taskName = taskName;
35 }
36
37protected:
38 std::string_view m_taskName;
39};
40
41}// namespace iv::threads
42
43#endif /* IV_SRC_THREADS_IRUNNABLE_HPP_ */
Definition IRunnable.hpp:10
virtual void pause()=0
virtual bool isRunning()=0
void setTaskName(const std::string_view taskName)
Definition IRunnable.hpp:32
virtual bool isStopped()=0
virtual void run()=0
std::string_view m_taskName
Definition IRunnable.hpp:38
virtual void stop()=0
virtual void resume()=0
virtual ~IRunnable()=default
virtual bool isPaused()=0
eRunnableState
Definition IRunnable.hpp:13
Definition BackgroundTaskWithDialog.cpp:8