8#include "Arp/System/Commons/Threading/Thread.hpp"
10namespace Arp {
namespace System {
namespace Commons {
namespace Threading
28 template<
class TInstance,
class TFunction>
29 WorkerThread(TInstance& instance, TFunction fn,
int idleTime,
const char* threadName);
37 template<
class TInstance,
class TFunction>
38 WorkerThread(
const TInstance& instance, TFunction fn,
int idleTime,
const char* threadName);
46 template<
class TInstance,
class TFunction>
47 WorkerThread(TInstance* pInstance, TFunction fn,
int idleTime,
const char* threadName);
55 template<
class TInstance,
class TFunction>
56 WorkerThread(
const TInstance* pInstance, TFunction fn,
int idleTime,
const char* threadName);
64 template<
class TInstance,
class TFunction>
73 template<
class TInstance,
class TFunction>
82 template<
class TInstance,
class TFunction>
91 template<
class TInstance,
class TFunction>
125 static void RunInternal(
void* pParam);
130 std::atomic<bool> stopWorking{
false};
131 std::atomic<bool> isStarted{
false};
138template<
class TInstance,
class TFunction>
144template<
class TInstance,
class TFunction>
150template<
class TInstance,
class TFunction>
158template<
class TInstance,
class TFunction>
173template<
class TInstance,
class TFunction>
179template<
class TInstance,
class TFunction>
185template<
class TInstance,
class TFunction>
187 : thread(settings, &
WorkerThread::RunInternal, (void*)this)
188 , idleTime(idleTimeArg)
193template<
class TInstance,
class TFunction>
195 : thread(settings, &
WorkerThread::RunInternal, (void*)this)
196 , idleTime(idleTimeArg)
202 : thread(settings, &
WorkerThread::RunInternal, (void*)this)
203 , idleTime(idleTimeArg)
Container class for adaptable thread settings.
Definition: ThreadSettings.hpp:13
The Thread-class provides methods to execute functions and methods in a separate thread.
Definition: Thread.hpp:77
bool IsRunning(void) const
Determines if this thread is in running state.
Definition: Thread.hpp:496
Worker threads repeat the execution of the threaded code until Stop is called.
Definition: WorkerThread.hpp:15
delegate< void(void)> WorkDelegate
The delegate of threads loop body.
Definition: WorkerThread.hpp:18
bool IsRunning(void) const
Checks if the thread is in running state.
Definition: WorkerThread.hpp:209
void Start(void)
Starts the execution of the thread.
void Stop(void)
Stops the execution of the thread syncronously.
~WorkerThread(void)=default
Deallocates the memory used for this instance but does not quit the thread.
WorkerThread(TInstance &instance, TFunction fn, int idleTime, const char *threadName)
Constructs an WorkerThread instance for a class method.
Definition: WorkerThread.hpp:139
delegate< R(A...)> make_delegate(R(*const function_ptr)(A...)) noexcept
Creates a delegate from a static function.
Definition: delegate.hxx:225
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API