GlobalObjects
Lade ...
Suche ...
Keine Treffer
EuRepeatingThread.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_EUREPEATINGTHREAD_H
2#define INC_EUREPEATINGTHREAD_H
3//-----------------------------------------------------------------------------
51//-----------------------------------------------------------------------------
52// includes
53#include "EuToolTypes.h"
54#include "EuCriticalSection.h"
55#include <thread>
56#include <condition_variable>
57#include <mutex>
58#include <string>
59//-----------------------------------------------------------------------------
60/* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
61#ifdef _MSC_VER
62 #pragma warning( disable : 4251 )
63#endif
64//-----------------------------------------------------------------------------
65namespace eut
66{
67 //---------------------------------------------------------------------------
94 {
95 public:
96 //============== local enums
152 //-----------------------------------------------------------------------
153
154 //-----------------------------------------------------------------------
218 //-----------------------------------------------------------------------
261 //-----------------------------------------------------------------------
262
263 private:
264 //============== Attribute
265 //-----------------------------------------------------------------------
276 //-----------------------------------------------------------------------
287 //-----------------------------------------------------------------------
297 std::thread * m_pThread;
298 //-----------------------------------------------------------------------
313 //-----------------------------------------------------------------------
324 std::mutex m_WaitMutex;
325 //-----------------------------------------------------------------------
336 std::condition_variable m_InputCondVar;
337 //-----------------------------------------------------------------------
348 std::mutex m_BreakMutex;
349 //-----------------------------------------------------------------------
360 std::condition_variable m_BreakCondVar;
361 //-----------------------------------------------------------------------
380 //-----------------------------------------------------------------------
415 //-----------------------------------------------------------------------
416
417 #ifdef _DEBUG
418 public:
419 //============== Attribute
420 //-----------------------------------------------------------------------
430 std::string m_strDebugInfo;
431 //-----------------------------------------------------------------------
432 #endif
433
434 public:
435 //============== ctors & dtor
436 //-----------------------------------------------------------------------
447 //-----------------------------------------------------------------------
462 //-----------------------------------------------------------------------
463
464 private:
465 //-----------------------------------------------------------------------
476 //-----------------------------------------------------------------------
477
478 protected:
479 //============== methods
480 //-----------------------------------------------------------------------
492 //-----------------------------------------------------------------------
504 void setStatus( STATUS eStatus );
505 //-----------------------------------------------------------------------
518 //-----------------------------------------------------------------------
530 void toOrder( ORDER eOrder );
531 //-----------------------------------------------------------------------
544 //-----------------------------------------------------------------------
556 virtual void work() = 0;
557 //-----------------------------------------------------------------------
558
559 public:
560 //============== methods
561 //-----------------------------------------------------------------------
579 virtual int start();
580 //-----------------------------------------------------------------------
595 virtual void cancel();
596 //-----------------------------------------------------------------------
609 //-----------------------------------------------------------------------
622 //-----------------------------------------------------------------------
636 //-----------------------------------------------------------------------
649 //-----------------------------------------------------------------------
662 //-----------------------------------------------------------------------
674 //-----------------------------------------------------------------------
693 virtual void takeABreak();
694 //-----------------------------------------------------------------------
704 virtual void finishBreak();
705 //-----------------------------------------------------------------------
725 //-----------------------------------------------------------------------
737 //-----------------------------------------------------------------------
738
739 private:
740 //============== operators
741 //-----------------------------------------------------------------------
751 RepeatingThread & operator= ( const RepeatingThread & );
752 //-----------------------------------------------------------------------
753 };
754 //---------------------------------------------------------------------------
755 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
756 #ifdef _MSC_VER
757 #pragma warning( default : 4251 )
758 #endif
759 //---------------------------------------------------------------------------
760} // namespace eut
761#endif
Header für CriticalSection
Für jede Bibliothek, hier 'EuTools' gibt es eine Typen-Datei.
#define __tool_export_dll
Definition EuToolTypes.h:77
Ist ein Mutex, welcher über sein Lock-Modus abgefragt werden kann. Siehe isLocked().
Definition EuCriticalSection.h:109
RepeatingThread(const RepeatingThread &)
virtual void work()=0
virtual ~RepeatingThread()
std::string m_strDebugInfo
Definition EuRepeatingThread.h:430
EuTHREADERROR
Fehlerbereich = -10301 bis -10400
Definition EuRepeatingThread.h:109
@ EuTHREAD_ERR_THREAD_BREAK_COUNT_LESS_THAN_ZERO
Definition EuRepeatingThread.h:140
@ EuTHREAD_ERR_NO_THREAD
Definition EuRepeatingThread.h:120
@ EuTHREAD_ERR_THREAD_ALREADY_WORKING
Definition EuRepeatingThread.h:130
@ EuTHREAD_ERR_UNKNOWN
Definition EuRepeatingThread.h:150
void setStatus(STATUS eStatus)
ORDER m_eOrder
Definition EuRepeatingThread.h:286
std::thread * m_pThread
Definition EuRepeatingThread.h:297
std::condition_variable m_InputCondVar
Definition EuRepeatingThread.h:336
virtual void cancel()
virtual void finishBreak()
std::mutex m_BreakMutex
Definition EuRepeatingThread.h:348
int m_iDataReady
Definition EuRepeatingThread.h:414
ORDER
Definition EuRepeatingThread.h:229
@ eUNDEFINED
Definition EuRepeatingThread.h:239
@ eDO_WORK
Definition EuRepeatingThread.h:249
@ eEXIT
Definition EuRepeatingThread.h:259
int m_iBreakCounter
Definition EuRepeatingThread.h:379
std::condition_variable m_BreakCondVar
Definition EuRepeatingThread.h:360
STATUS
Definition EuRepeatingThread.h:166
@ eAT_THE_START
Definition EuRepeatingThread.h:176
@ eCOMPLETED
Definition EuRepeatingThread.h:216
@ ePAUSING
Definition EuRepeatingThread.h:196
@ eENDING
Definition EuRepeatingThread.h:206
@ eWORKING
Definition EuRepeatingThread.h:186
RepeatingThread::STATUS status() const
virtual int start()
CriticalSection m_ExclusiveAccessSection
Definition EuRepeatingThread.h:312
STATUS m_eStatus
Definition EuRepeatingThread.h:275
void toOrder(ORDER eOrder)
bool isInExclusiveAccess() const
virtual void takeABreak()
std::mutex m_WaitMutex
Definition EuRepeatingThread.h:324
Definition IniFile.h:62