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
00077 class SoDevice
00078 {
00079 public:
00080
00088 static SoDevice* find( SoDeviceFindFunction* findFunction );
00089
00093 virtual unsigned long long getTotalMemory() const = 0;
00094
00098 virtual unsigned long long getAvailableMemory() const = 0;
00099
00103 virtual unsigned int getLogicalUnits() const = 0;
00104
00108 virtual SbString getDriverVersion() const = 0;
00109
00113 virtual SbString getDeviceName() const = 0;
00114
00118 static unsigned int getDevicesCount();
00119
00125 static SoDevice* getDevice( int index );
00126
00127 private:
00132 static void exitClass();
00133
00137 static SbString getOSName();
00138
00139
00145 static SbString getSystemVersion();
00146
00155 static void readSystemVersion( unsigned int& majorVersion, unsigned int& minorVersion );
00156
00157
00158 private:
00159
00163 SoDevice();
00164
00168 virtual ~SoDevice();
00169
00170 static void registerDevice( SoDevice* );
00171
00172 static void unRegisterDevice( SoDevice* );
00173
00174 static void lockDevicesList();
00175
00176 static void unlockDevicesList();
00177
00178 private:
00179
00180 static std::vector< SoDevice * > s_devices;
00181
00182 static SbThreadMutex s_devicesListMutex;
00183
00184 };
00185
00186 #ifdef _MSC_VER
00187 #pragma warning( pop )
00188 #endif
00189
00190 #endif // SODEVICE_H
00191
00192