changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / Sensor / InterfaceSensors / OSGDeviceInterface.h
blobfb933db46283e4bf643720d45e16b390c462e0b2
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 _OSGDEVICEINTERFACE_H_
40 #define _OSGDEVICEINTERFACE_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGThread.h"
46 #include "OSGLock.h"
47 #include "OSGContribCSMDef.h"
49 OSG_BEGIN_NAMESPACE
51 class InterfaceOptions;
53 class OSG_CONTRIBCSM_DLLMAPPING DeviceInterface : public Thread
56 /*========================== PUBLIC =================================*/
58 public:
60 OSG_GEN_INTERNAL_MEMOBJPTR(DeviceInterface);
62 /*---------------------------------------------------------------------*/
63 /*! \name Reference Counting */
64 /*! \{ */
66 virtual bool start (void);
67 virtual void stop (void);
68 virtual void shutdown(void);
70 /*! \} */
71 /*---------------------------------------------------------------------*/
72 /*! \name Reference Counting */
73 /*! \{ */
75 bool isRunning (void);
76 bool hasNewData (void);
77 virtual void clearNewData(void);
79 void lock (void);
80 void unlock (void);
82 /*! \} */
83 /*---------------------------------------------------------------------*/
84 /*! \name Constructors */
85 /*! \{ */
87 virtual void setOptions(InterfaceOptions *pOptions);
89 /*! \} */
90 /*========================= PROTECTED ===============================*/
92 protected:
94 typedef Thread Inherited;
96 LockRefPtr _pDataLock;
97 volatile bool _bRunning;
98 bool _bHasNewData;
99 UInt32 _uiNapTime;
101 /*---------------------------------------------------------------------*/
102 /*! \name Reference Counting */
103 /*! \{ */
105 /*! \} */
106 /*---------------------------------------------------------------------*/
107 /*! \name Constructors */
108 /*! \{ */
110 DeviceInterface(const Char8 *szName, UInt32 uiId, bool bGlobal);
112 /*! \} */
113 /*---------------------------------------------------------------------*/
114 /*! \name Destructor */
115 /*! \{ */
117 virtual ~DeviceInterface(void);
119 /*! \} */
120 /*---------------------------------------------------------------------*/
121 /*! \name Destructor */
122 /*! \{ */
124 /*! \} */
125 /*---------------------------------------------------------------------*/
126 /*! \name Constructors */
127 /*! \{ */
129 /*! \} */
130 /*========================== PRIVATE ================================*/
132 private:
134 /*!\brief prohibit default function (move to 'public' if needed) */
135 DeviceInterface(const DeviceInterface &source);
136 void operator =(const DeviceInterface &source);
139 OSG_GEN_MEMOBJPTR(DeviceInterface);
141 OSG_END_NAMESPACE
143 #include "OSGDeviceInterface.inl"
145 #endif // _OSGDEVICEINTERFACE_H_