changed: gcc8 base update
[opensg.git] / Source / Base / FieldContainer / Threading / OSGHardwareContextThread.h
blob702b36767cb75a71a583a1d16a0d0b131ad2554b
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGHARDWARECONTEXTTHREAD_H_
40 #define _OSGHARDWARECONTEXTTHREAD_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGBaseDef.h"
46 #include "OSGThread.h"
47 #include "OSGHardwareContextTask.h"
49 OSG_BEGIN_NAMESPACE
51 class HardwareContext;
53 /*! \ingroup GrpBaseMemoryObjectsBase
54 \ingroup GrpBaseHardwareContext
55 \ingroup GrpLibOSGBase
58 class OSG_BASE_DLLMAPPING HardwareContextThread : public Thread
61 /*========================== PUBLIC =================================*/
63 public:
65 OSG_GEN_INTERNAL_MEMOBJPTR(HardwareContextThread);
67 /*---------------------------------------------------------------------*/
68 /*! \name Reference Counting */
69 /*! \{ */
71 static ObjTransitPtr get (Char8 *szName, bool bGlobal);
72 static HardwareContextThread *find(Char8 *szName );
74 /*---------------------------------------------------------------------*/
75 /*! \name Reference Counting */
76 /*! \{ */
78 bool isRunning (void );
79 void endRunning(void );
81 /*! \} */
82 /*---------------------------------------------------------------------*/
83 /*! \name Constructors */
84 /*! \{ */
86 void queueTask (HardwareContextTask *pTask);
87 void queueTaskFront(HardwareContextTask *pTask);
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Debugging, don't use */
92 /*! \{ */
94 void dumpTasks(void);
95 void runTasks (void);
97 /*! \} */
98 /*========================= PROTECTED ===============================*/
100 protected:
102 typedef Thread Inherited;
104 static MPThreadType _type;
106 bool _bRunning;
107 DrawEnv *_pEnv;
108 HardwareContextTaskQueue _qTaskQueue;
109 HardwareContext *_pContext;
111 /*---------------------------------------------------------------------*/
112 /*! \name Reference Counting */
113 /*! \{ */
115 static BaseThread *create(const Char8 *szName,
116 UInt32 uiId,
117 bool bGlobal);
119 /*! \} */
120 /*---------------------------------------------------------------------*/
121 /*! \name Constructors */
122 /*! \{ */
124 HardwareContextThread(const Char8 *szName, UInt32 uiId, bool bGlobal);
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name Destructor */
129 /*! \{ */
131 virtual ~HardwareContextThread(void);
133 /*! \} */
134 /*---------------------------------------------------------------------*/
135 /*! \name Destructor */
136 /*! \{ */
138 virtual void workProc(void);
140 /*! \} */
141 /*---------------------------------------------------------------------*/
142 /*! \name Constructors */
143 /*! \{ */
145 void setContext(HardwareContext *pContext);
147 /*! \} */
148 /*========================== PRIVATE ================================*/
150 private:
152 friend class HardwareContext;
154 /*!\brief prohibit default function (move to 'public' if needed) */
155 HardwareContextThread(const HardwareContextThread &source);
156 void operator =(const HardwareContextThread &source);
159 OSG_GEN_MEMOBJPTR(HardwareContextThread);
161 OSG_END_NAMESPACE
163 #include "OSGHardwareContextThread.inl"
165 #endif /* _OSGHARDWARECONTEXTTHREAD_H_ */