Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoDevice.h
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-2024 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
26#include <Inventor/threads/SbThreadMutex.h>
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
43typedef bool SoDeviceFindFunction( SoDevice* device );
44
82{
83public:
84
92 static SoDevice* find( SoDeviceFindFunction* findFunction );
93
97 virtual unsigned long long getTotalMemory() const = 0;
98
102 virtual unsigned long long getAvailableMemory() const = 0;
103
107 virtual unsigned int getLogicalUnits() const = 0;
108
112 virtual SbString getDriverVersion() const = 0;
113
117 virtual SbString getDeviceName() const = 0;
118
122 static unsigned int getDevicesCount();
123
129 static SoDevice* getDevice( int index );
130
131private:
136 static void exitClass();
137
141 static SbString getOSName();
142
143
149 static SbString getSystemVersion();
150
159 static void readSystemVersion( unsigned int& majorVersion, unsigned int& minorVersion );
160
161
162private:
163
167 SoDevice();
168
172 virtual ~SoDevice();
173
174 static void registerDevice( SoDevice* );
175
176 static void unRegisterDevice( SoDevice* );
177
178 static void lockDevicesList();
179
180 static void unlockDevicesList();
181
182private:
183
184 static std::vector< SoDevice * > s_devices;
185
186 static SbThreadMutex s_devicesListMutex;
187
188};
189
190#ifdef _MSC_VER
191#pragma warning( pop )
192#endif
193
194#endif // SODEVICE_H
195
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:82
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.
bool SoDeviceFindFunction(SoDevice *device)
Find function type.
Definition SoDevice.h:43
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.