thread_supervisor
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tut::thread::InheritableSupervisor< t_Logger > Class Template Referenceabstract

Detailed Description

template<class t_Logger = log::StdErr>
class tut::thread::InheritableSupervisor< t_Logger >

Inheritable supervisor simplifies starting class methods in separate threads.

Definition at line 490 of file supervisor.h.

#include <supervisor.h>

Inheritance diagram for tut::thread::InheritableSupervisor< t_Logger >:
anonymous_namespace{supervisor.cpp}::TestThreadSupervisor

Public Member Functions

const Supervisor< t_Logger > & getThreadSupervisor () const
 
Supervisor< t_Logger > & getThreadSupervisor ()
 
virtual void stopSupervisedThreads ()=0
 
template<class... t_Args>
void addSupervisedThread (t_Args &&...args)
 Add a thread: (<thread parameters>, <function pointer>, <this>, <function parameters>) More...
 
bool isThreadSupervisorInterrupted () const
 Should be checked by threaded class methods. More...
 

Protected Member Functions

 ~InheritableSupervisor ()=default
 

Protected Attributes

Supervisor< t_Logger > thread_supervisor_
 

Constructor & Destructor Documentation

◆ ~InheritableSupervisor()

template<class t_Logger = log::StdErr>
tut::thread::InheritableSupervisor< t_Logger >::~InheritableSupervisor ( )
protecteddefault

Member Function Documentation

◆ addSupervisedThread()

template<class t_Logger = log::StdErr>
template<class... t_Args>
void tut::thread::InheritableSupervisor< t_Logger >::addSupervisedThread ( t_Args &&...  args)
inline

Add a thread: (<thread parameters>, <function pointer>, <this>, <function parameters>)

Definition at line 522 of file supervisor.h.

◆ getThreadSupervisor() [1/2]

template<class t_Logger = log::StdErr>
Supervisor<t_Logger>& tut::thread::InheritableSupervisor< t_Logger >::getThreadSupervisor ( )
inline

Definition at line 504 of file supervisor.h.

◆ getThreadSupervisor() [2/2]

template<class t_Logger = log::StdErr>
const Supervisor<t_Logger>& tut::thread::InheritableSupervisor< t_Logger >::getThreadSupervisor ( ) const
inline

Definition at line 499 of file supervisor.h.

◆ isThreadSupervisorInterrupted()

template<class t_Logger = log::StdErr>
bool tut::thread::InheritableSupervisor< t_Logger >::isThreadSupervisorInterrupted ( ) const
inline

Should be checked by threaded class methods.

Definition at line 529 of file supervisor.h.

◆ stopSupervisedThreads()

template<class t_Logger = log::StdErr>
virtual void tut::thread::InheritableSupervisor< t_Logger >::stopSupervisedThreads ( )
pure virtual

should call stop(), pure virtual to remind that threads must be destructed properly at the right time, e.g., from a destructor

Implemented in anonymous_namespace{supervisor.cpp}::TestThreadSupervisor.

Member Data Documentation

◆ thread_supervisor_

template<class t_Logger = log::StdErr>
Supervisor<t_Logger> tut::thread::InheritableSupervisor< t_Logger >::thread_supervisor_
protected

Definition at line 493 of file supervisor.h.


The documentation for this class was generated from the following file: