00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined SODEVICE_H
00024 #define SODEVICE_H
00025
00026 #include <Inventor/threads/SbThreadMutex.h>
00027 #include <Inventor/SbString.h>
00028
00029 #include <Inventor/STL/vector>
00030
00031 #ifdef _MSC_VER
00032 #pragma warning( push )
00033 #pragma warning(disable:4251)
00034 #endif
00035
00036 class SoDevice;
00037
00039 typedef bool SoDeviceFindFunction( SoDevice* device );
00040
00095 class SoDevice
00096 {
00097 public:
00098
00106 static SoDevice* find( SoDeviceFindFunction* findFunction );
00107
00111 virtual unsigned long long getTotalMemory() const = 0;
00112
00116 virtual unsigned long long getAvailableMemory() const = 0;
00117
00121 virtual unsigned int getLogicalUnits() const = 0;
00122
00126 virtual SbString getDriverVersion() const = 0;
00127
00131 virtual SbString getDeviceName() const = 0;
00132
00136 static unsigned int getDevicesCount();
00137
00143 static SoDevice* getDevice( int index );
00144
00145 private:
00150 static void exitClass();
00151
00155 static SbString getOSName();
00156
00157
00163 static SbString getSystemVersion();
00164
00173 static void readSystemVersion( unsigned int& majorVersion, unsigned int& minorVersion );
00174
00175
00176 private:
00177
00181 SoDevice();
00182
00186 virtual ~SoDevice();
00187
00188 static void registerDevice( SoDevice* );
00189
00190 static void unRegisterDevice( SoDevice* );
00191
00192 static void lockDevicesList();
00193
00194 static void unlockDevicesList();
00195
00196 private:
00197
00198 static std::vector< SoDevice * > s_devices;
00199
00200 static SbThreadMutex s_devicesListMutex;
00201
00202 };
00203
00204 #ifdef _MSC_VER
00205 #pragma warning( pop )
00206 #endif
00207
00208 #endif // SODEVICE_H
00209
00210