SystemInformation.hxx.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*============================================================================
  2. KWSys - Kitware System Library
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef @KWSYS_NAMESPACE@_SystemInformation_h
  11. #define @KWSYS_NAMESPACE@_SystemInformation_h
  12. /* Define these macros temporarily to keep the code readable. */
  13. #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  14. # define kwsys_stl @KWSYS_NAMESPACE@_stl
  15. # define kwsys_ios @KWSYS_NAMESPACE@_ios
  16. #endif
  17. #include <@KWSYS_NAMESPACE@/stl/string>
  18. namespace @KWSYS_NAMESPACE@
  19. {
  20. // forward declare the implementation class
  21. class SystemInformationImplementation;
  22. class @KWSYS_NAMESPACE@_EXPORT SystemInformation
  23. {
  24. public:
  25. SystemInformation ();
  26. ~SystemInformation ();
  27. const char * GetVendorString();
  28. const char * GetVendorID();
  29. kwsys_stl::string GetTypeID();
  30. kwsys_stl::string GetFamilyID();
  31. kwsys_stl::string GetModelID();
  32. kwsys_stl::string GetSteppingCode();
  33. const char * GetExtendedProcessorName();
  34. const char * GetProcessorSerialNumber();
  35. int GetProcessorCacheSize();
  36. unsigned int GetLogicalProcessorsPerPhysical();
  37. float GetProcessorClockFrequency();
  38. int GetProcessorAPICID();
  39. int GetProcessorCacheXSize(long int);
  40. bool DoesCPUSupportFeature(long int);
  41. const char * GetOSName();
  42. const char * GetHostname();
  43. const char * GetOSRelease();
  44. const char * GetOSVersion();
  45. const char * GetOSPlatform();
  46. bool Is64Bits();
  47. unsigned int GetNumberOfLogicalCPU(); // per physical cpu
  48. unsigned int GetNumberOfPhysicalCPU();
  49. bool DoesCPUSupportCPUID();
  50. // Retrieve memory information in megabyte.
  51. unsigned long GetTotalVirtualMemory();
  52. unsigned long GetAvailableVirtualMemory();
  53. unsigned long GetTotalPhysicalMemory();
  54. unsigned long GetAvailablePhysicalMemory();
  55. /** Run the different checks */
  56. void RunCPUCheck();
  57. void RunOSCheck();
  58. void RunMemoryCheck();
  59. private:
  60. SystemInformationImplementation* Implementation;
  61. };
  62. } // namespace @KWSYS_NAMESPACE@
  63. /* Undefine temporary macros. */
  64. #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  65. # undef kwsys_stl
  66. # undef kwsys_ios
  67. #endif
  68. #endif