ZeusBase-Library  2.0.4
AbstractMainThread.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch)
3  *****************************************************************************
4  * Project : Zeus Base Library
5  * Module : AbstractMainThread
6  * Package : Zeus.ZeusBase.System
7  * Author : Benjamin Hadorn
8  * Date : 27.12.2011
9  * System : Zeus-Framework
10  *****************************************************************************
11  * Licence: *
12  * This library is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU Lesser General Public License as *
14  * published by the Free Software Foundation; either version *
15  * 2.1 of the License, or (at your option) any later version. *
16  * *
17  * This library is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU Lesser General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU Lesser General Public *
23  * License along with this library; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
25  *****************************************************************************/
26 
27 /*****************************************************************************
28  * Changes:
29  * 27.12.2011 bha: created zeus 2.0
30  *****************************************************************************/
31 
32 #ifndef AbstractMainThreadH
33 #define AbstractMainThreadH
34 
38 
39 
41 
42 class TThreadMessageQueue;
43 class TCriticalSection;
44 
45 /***************************************************************************/
50 /***************************************************************************/
52 {
53  public:
54  //Methods of IThread
55  virtual bool MQUALIFIER isInterrupted() const;
56  virtual Uint MQUALIFIER getThreadID() const;
57 
58  //methods of the abstact main thread
59  virtual Retval processObject();
60  virtual void registerThread(TThreadManager& rManager, bool bUseInternalDispatcher);
61  virtual void unregisterThread(TThreadManager& rManager);
62 
63  protected:
65  TAbstractMainThread(TThreadMessageQueue& rQueue, bool bAdoptPointer);
66  virtual ~TAbstractMainThread();
67 
69  static bool m_bInterrupted;
76 
77  //Methods of IZUnknown
79 
80  private:
82  static Uint m_uiThreadID;
83 };
84 
85 
86 /***************************************************************************/
89 /***************************************************************************/
90 inline Uint MQUALIFIER TAbstractMainThread::getThreadID() const
91 {
92  return TAbstractMainThread::m_uiThreadID;
93 }
94 
95 
96 /***************************************************************************/
99 /***************************************************************************/
100 inline bool MQUALIFIER TAbstractMainThread::isInterrupted() const
101 {
102  return TAbstractMainThread::m_bInterrupted;
103 }
104 
106 
107 
108 #endif
Definition: ZObject.h:57
#define END_NAMESPACE_Zeus
Definition: PlatformDefines.hpp:96
#define zeusbase_class
Definition: PlatformDefines.hpp:165
bool m_bUseInternalDispatcher
Flag if queue messages are dispached internally.
Definition: AbstractMainThread.h:73
#define MQUALIFIER
Definition: LinuxPlatform.hpp:64
Definition: IThread.hpp:47
#define BEGIN_NAMESPACE_Zeus
Definition: PlatformDefines.hpp:95
Definition: AbstractMainThread.h:51
TThreadMessageQueue & m_rQueue
Message queue of the thread.
Definition: AbstractMainThread.h:75
Definition: ThreadMessageQueue.h:49
Definition: CriticalSection.h:52
Definition: ThreadManager.h:51
static bool m_bInterrupted
Interrupted flag.
Definition: AbstractMainThread.h:69
TCriticalSection & m_rLock
internal lock
Definition: AbstractMainThread.h:71
#define MEMORY_MANAGER_DECL
Definition: IZUnknownImplHelper.hpp:44


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Tue Sep 13 2016 22:30:28