GlobalObjects
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EuRepeatingThread.h
Go to the documentation of this file.
1#ifndef INC_EUREPEATINGTHREAD_H
2#define INC_EUREPEATINGTHREAD_H
3//-----------------------------------------------------------------------------
68//-----------------------------------------------------------------------------
69// includes
70#include "EuToolTypes.h"
71#include "EuCriticalSection.h"
72#include <thread>
73#include <condition_variable>
74#include <mutex>
75#include <string>
76//-----------------------------------------------------------------------------
77/* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
78#ifdef _MSC_VER
79 #pragma warning( disable : 4251 )
80#endif
81//-----------------------------------------------------------------------------
82namespace eut
83{
84 //---------------------------------------------------------------------------
111 {
112 public:
113 //============== local enums
169 //-----------------------------------------------------------------------
170
171 //-----------------------------------------------------------------------
235 //-----------------------------------------------------------------------
278 //-----------------------------------------------------------------------
279
280 private:
281 //============== Attribute
282 //-----------------------------------------------------------------------
293 //-----------------------------------------------------------------------
304 //-----------------------------------------------------------------------
314 std::thread * m_pThread;
315 //-----------------------------------------------------------------------
330 //-----------------------------------------------------------------------
341 std::mutex m_WaitMutex;
342 //-----------------------------------------------------------------------
353 std::condition_variable m_InputCondVar;
354 //-----------------------------------------------------------------------
365 std::mutex m_BreakMutex;
366 //-----------------------------------------------------------------------
377 std::condition_variable m_BreakCondVar;
378 //-----------------------------------------------------------------------
397 //-----------------------------------------------------------------------
432 //-----------------------------------------------------------------------
433
434 #ifdef _DEBUG
435 public:
436 //============== Attribute
437 //-----------------------------------------------------------------------
447 std::string m_strDebugInfo;
448 //-----------------------------------------------------------------------
449 #endif
450
451 public:
452 //============== ctors & dtor
453 //-----------------------------------------------------------------------
464 //-----------------------------------------------------------------------
479 //-----------------------------------------------------------------------
480
481 private:
482 //-----------------------------------------------------------------------
493 //-----------------------------------------------------------------------
494
495 protected:
496 //============== methods
497 //-----------------------------------------------------------------------
509 //-----------------------------------------------------------------------
521 void setStatus( STATUS eStatus );
522 //-----------------------------------------------------------------------
535 //-----------------------------------------------------------------------
547 void toOrder( ORDER eOrder );
548 //-----------------------------------------------------------------------
561 //-----------------------------------------------------------------------
573 virtual void work() = 0;
574 //-----------------------------------------------------------------------
575
576 public:
577 //============== methods
578 //-----------------------------------------------------------------------
596 virtual int start();
597 //-----------------------------------------------------------------------
612 virtual void cancel();
613 //-----------------------------------------------------------------------
626 //-----------------------------------------------------------------------
639 //-----------------------------------------------------------------------
653 //-----------------------------------------------------------------------
666 //-----------------------------------------------------------------------
679 //-----------------------------------------------------------------------
691 //-----------------------------------------------------------------------
710 virtual void takeABreak();
711 //-----------------------------------------------------------------------
721 virtual void finishBreak();
722 //-----------------------------------------------------------------------
742 //-----------------------------------------------------------------------
754 //-----------------------------------------------------------------------
755
756 private:
757 //============== operators
758 //-----------------------------------------------------------------------
768 RepeatingThread & operator= ( const RepeatingThread & );
769 //-----------------------------------------------------------------------
770 };
771 //---------------------------------------------------------------------------
772 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
773 #ifdef _MSC_VER
774 #pragma warning( default : 4251 )
775 #endif
776 //---------------------------------------------------------------------------
777} // namespace eut
778#endif
Header for CriticalSection
For each library, here 'EuTools' there is a type file.
#define __tool_export_dll
Definition EuToolTypes.h:94
Is a mutex which can be queried via its lock mode. See isLocked().
Definition EuCriticalSection.h:126
RepeatingThread(const RepeatingThread &)
virtual void work()=0
virtual ~RepeatingThread()
std::string m_strDebugInfo
Definition EuRepeatingThread.h:447
EuTHREADERROR
Error range = -10301 to -10400
Definition EuRepeatingThread.h:126
@ EuTHREAD_ERR_THREAD_BREAK_COUNT_LESS_THAN_ZERO
Definition EuRepeatingThread.h:157
@ EuTHREAD_ERR_NO_THREAD
Definition EuRepeatingThread.h:137
@ EuTHREAD_ERR_THREAD_ALREADY_WORKING
Definition EuRepeatingThread.h:147
@ EuTHREAD_ERR_UNKNOWN
Definition EuRepeatingThread.h:167
void setStatus(STATUS eStatus)
ORDER m_eOrder
Definition EuRepeatingThread.h:303
std::thread * m_pThread
Definition EuRepeatingThread.h:314
std::condition_variable m_InputCondVar
Definition EuRepeatingThread.h:353
virtual void cancel()
virtual void finishBreak()
std::mutex m_BreakMutex
Definition EuRepeatingThread.h:365
int m_iDataReady
Definition EuRepeatingThread.h:431
ORDER
Definition EuRepeatingThread.h:246
@ eUNDEFINED
Definition EuRepeatingThread.h:256
@ eDO_WORK
Definition EuRepeatingThread.h:266
@ eEXIT
Definition EuRepeatingThread.h:276
int m_iBreakCounter
Definition EuRepeatingThread.h:396
std::condition_variable m_BreakCondVar
Definition EuRepeatingThread.h:377
STATUS
Definition EuRepeatingThread.h:183
@ eAT_THE_START
Definition EuRepeatingThread.h:193
@ eCOMPLETED
Definition EuRepeatingThread.h:233
@ ePAUSING
Definition EuRepeatingThread.h:213
@ eENDING
Definition EuRepeatingThread.h:223
@ eWORKING
Definition EuRepeatingThread.h:203
RepeatingThread::STATUS status() const
virtual int start()
CriticalSection m_ExclusiveAccessSection
Definition EuRepeatingThread.h:329
STATUS m_eStatus
Definition EuRepeatingThread.h:292
void toOrder(ORDER eOrder)
bool isInExclusiveAccess() const
virtual void takeABreak()
std::mutex m_WaitMutex
Definition EuRepeatingThread.h:341
Definition IniFile.h:79