Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoDevice.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#if !defined SODEVICE_H
24#define SODEVICE_H
25
27#include <Inventor/SbString.h>
28
29#include <Inventor/STL/vector>
30
31#ifdef _MSC_VER
32#pragma warning( push )
33#pragma warning(disable:4251)
34#endif
35
36class SoDevice;
37
39typedef bool SoDeviceFindFunction( SoDevice* device );
40
78{
79public:
80
88 static SoDevice* find( SoDeviceFindFunction* findFunction );
89
93 virtual unsigned long long getTotalMemory() const = 0;
94
98 virtual unsigned long long getAvailableMemory() const = 0;
99
103 virtual unsigned int getLogicalUnits() const = 0;
104
108 virtual SbString getDriverVersion() const = 0;
109
113 virtual SbString getDeviceName() const = 0;
114
118 static unsigned int getDevicesCount();
119
125 static SoDevice* getDevice( int index );
126
127private:
132 static void exitClass();
133
137 static SbString getOSName();
138
139
145 static SbString getSystemVersion();
146
155 static void readSystemVersion( unsigned int& majorVersion, unsigned int& minorVersion );
156
157
158private:
159
163 SoDevice();
164
168 virtual ~SoDevice();
169
170 static void registerDevice( SoDevice* );
171
172 static void unRegisterDevice( SoDevice* );
173
174 static void lockDevicesList();
175
176 static void unlockDevicesList();
177
178private:
179
180 static std::vector< SoDevice * > s_devices;
181
182 static SbThreadMutex s_devicesListMutex;
183
184};
185
186#ifdef _MSC_VER
187#pragma warning( pop )
188#endif
189
190#endif // SODEVICE_H
191
bool SoDeviceFindFunction(SoDevice *device)
Find function type.
Definition SoDevice.h:39
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable mutex c...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract device ...
Definition SoDevice.h:78
virtual SbString getDeviceName() const =0
Returns the name of this device.
static SoDevice * find(SoDeviceFindFunction *findFunction)
Performs a generic search on the list of devices.
virtual unsigned long long getTotalMemory() const =0
Returns the total memory of this device in bytes.
static unsigned int getDevicesCount()
Returns the number of devices.
static SoDevice * getDevice(int index)
Returns the SoDevice pointed by index.
virtual unsigned long long getAvailableMemory() const =0
Returns the current available memory of this device in bytes.
virtual unsigned int getLogicalUnits() const =0
Returns the number of logical units of this device.
virtual SbString getDriverVersion() const =0
Returns the driver version of this device.