Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# deMachine.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file deMachine.hpp
    00003 ///
    00004 /// @brief System configuration analyzer header
    00005 ///
    00006 /// @author Lightning
    00007 ///
    00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
    00009 /// contents of this file is subject to the Destiny3D Member License which
    00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
    00011 ///
    00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
    00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
    00014 /// for any particular purpose.
    00015 ///
    00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
    00017 ///
    00018 /// <hr>
    00019 ///                                 Change History
    00020 /// <hr>
    00021 ///
    00022 /// @date Nov 2001
    00023 /// @author Lightning
    00024 /// @remarks Creation
    00025 ///
    00026 ///////////////////////////////////////////////////////////////////////////////
    00027
    00028 #ifndef DEMACHINE_HPP
    00029 #define DEMACHINE_HPP
    00030 #ifdef _MSC_VER
    00031 //=================================================================================
    00032 // Includes
    00033 //=================================================================================
    00034
    00035 #include "deGlobalTypes.hpp"
    00036 #include "deInternalValues.hpp"
    00037 #include "deArray.hpp"
    00038
    00039 //=================================================================================
    00040 // DLL Import/Export Defines
    00041 //=================================================================================
    00042
    00043 #if defined(DEMACHINE_DLL_EXPORTS) || defined(DESTINY3D_EXPORT_ALL)
    00044 #   define DEMACHINE_API extern "C" DEDLL_EXPORT
    00045 #elif defined(DESTINY3D_STATIC_LINK)
    00046 #   define DEMACHINE_API extern "C"
    00047 #else
    00048 #   define DEMACHINE_API extern "C" DEDLL_IMPORT
    00049 #endif
    00050
    00051 #ifdef USING_DESTINY3D
    00052 #ifdef _DEBUG
    00053 #   ifdef DESTINY3D_STATIC_LINK
    00054 #       pragma comment(lib, "deMachine_sd")
    00055 #   else
    00056 #       pragma comment(lib, "deMachined")
    00057 #   endif //DESTINY3D_STATIC_LINK
    00058 #else
    00059 #   ifdef DESTINY3D_STATIC_LINK
    00060 #       pragma comment(lib, "deMachine_s")
    00061 #   else
    00062 #       pragma comment(lib, "deMachine")
    00063 #   endif //DESTINY3D_STATIC_LINK
    00064 #endif //_DEBUG
    00065 #endif //USING_DESTINY3D
    00066
    00067
    00068
    00069 //=================================================================================
    00070 // Machine Conguration Structures
    00071 //=================================================================================
    00072
    00073 /// information about a computer's CPU architecture
    00074 struct deCPUInfo
    00075 {
    00076     enum deCPUType
    00077     {
    00078         DECPUTYPE_UNKNOWN=0,
    00079         DECPUTYPE_INTEL,    ///< Intel CPU
    00080         DECPUTYPE_AMD,      ///< AMD CPU
    00081         DECPUTYPE_32BIT = 0x7fffffff
    00082         // note from Assassin: I think this should be generalized to architectures
    00083         // such as x86, A64, PPC, etc, then having a union of info regarding each architecture
    00084     };
    00085     deCPUType CPUType;      ///< Type of CPU
    00086     long  CPUCount;         ///< Number of CPUs in the system
    00087     char  Name[48];         ///< String name of CPU
    00088     char  Vendor[13];       ///< Vendor string
    00089     float Mhz;              ///< Mhz speed of chip
    00090     float Freq;             ///< Performance frequency
    00091     char  ProcessorType;    ///< Processor type, 0 = OEM cpu. on Intel chips, 1 = OverDrive, 2 = dual processor
    00092     char  Family;           ///< Processor family
    00093     char  Model;            ///< Processor model
    00094     char  Stepping;         ///< Processor stepping
    00095     char  ExtendedFamily;   ///< Extended family value
    00096     long  Cache[8];         ///< 0 to 3 for cache entries
    00097
    00098     deBoolean FPU;          ///< Floating-Point unit on chip
    00099     deBoolean VME;          ///< Virtual Mode Extension
    00100     deBoolean DE;           ///< Debugging Extension
    00101     deBoolean PSE;          ///< Page Size Extension
    00102     deBoolean TSC;          ///< Time Stamp Counter
    00103     deBoolean MSR;          ///< Model Specific Registers
    00104     deBoolean MCE;          ///< Machine Check Exception
    00105     deBoolean CX8;          ///< CMPXCHG8 Instruction
    00106     deBoolean APIC;         ///< Software-accessible local APIC on Chip
    00107     deBoolean SEP;          ///< Fast System Call
    00108     deBoolean MTRR;         ///< Memory Type Range Registers
    00109     deBoolean PGE;          ///< Page Global Enable
    00110     deBoolean MCA;          ///< Machine Check Architecture
    00111     deBoolean CMOV;         ///< Conditional Move Instruction
    00112     deBoolean PAT;          ///< Page Attribute Table
    00113     deBoolean PSE36;        ///< 36-bit Page Size Extension
    00114     deBoolean MMX;          ///< MMX technology
    00115     deBoolean FXSR;         ///< Fast Floating Point Save and Restore
    00116     deBoolean SSE;          ///< Streaming SIMD Extension
    00117     deBoolean PAE;          ///< Physical Address Extension
    00118
    00119     deBoolean INTEL_PN;     ///< Processor Number
    00120     deBoolean INTEL_CLFSH;  ///< CLFlush command support
    00121     deBoolean INTEL_DS;     ///< Debug Store
    00122     deBoolean INTEL_ACPI;   ///< ACPI Preprocessor Performance Modulation Registers
    00123     deBoolean INTEL_SSE2;   ///< SSE2
    00124     deBoolean INTEL_SS;     ///< Self Snoop
    00125     deBoolean INTEL_TM;     ///< Thermal Monitor
    00126
    00127     deBoolean AMD_AMIE;     ///< AMD Multimedia Instructions Extensions
    00128     deBoolean AMD_3DNOWEXT; ///< AMD 3DNOW! Extensions
    00129     deBoolean AMD_3DNOW;    ///< AMD 3DNOW! Technology
    00130     deBoolean AMD_MPCAPABLE;///< AMD Multiprocessing Capable (some older MP chips return false)
    00131 };
    00132
    00133 /// information regarding a computer operating system
    00134 struct deOSInfo
    00135 {
    00136     /// Various known operating systems
    00137     enum deOSType
    00138     {
    00139         DEOSTYPE_UNKNOWN=0,     ///< Unknown Operating System
    00140         DEOSTYPE_WINDOWS95,     ///< Microsoft Windows 95
    00141         DEOSTYPE_WINDOWS98,     ///< Microsoft Windows 98
    00142         DEOSTYPE_WINDOWSME,     ///< Microsoft Windows ME
    00143         DEOSTYPE_WINDOWSNT,     ///< Microsoft Windows NT
    00144         DEOSTYPE_WINDOWS2000,   ///< Microsoft Windows 2000
    00145         DEOSTYPE_WINDOWSXP,     ///< Microsoft Windows XP
    00146         DEOSTYPE_32BIT = 0x7fffffff
    00147     };
    00148     deOSType OSType;            ///< Type of operating system currently running
    00149     float Version;              ///< Version of the operating system
    00150     int Build;                  ///< Build number of the operating system
    00151     char AdditionalInfo[128];   ///< More specific information about the OS
    00152 };
    00153
    00154
    00155 /// information regarding a computer's memory
    00156 struct deMemoryInfo
    00157 {
    00158     unsigned int MemoryLoad;
    00159     u64 TotalPhysical;
    00160     u64 AvailablePhysical;
    00161     u64 TotalPageFile;
    00162     u64 AvailablePageFile;
    00163     u64 TotalVirtual;
    00164     u64 AvailableVirtual;
    00165     u64 AvailableExtendedVirtual;
    00166 };
    00167
    00168 /// infomation regarding Microsoft DirectX
    00169 struct deDXInfo
    00170 {
    00171     long MajorVersion;  ///<major version of DirectX
    00172     long MinorVersion;  ///<minor version of DirectX
    00173     long StepVersion;   ///<stepping version of DirectX
    00174 };
    00175
    00176
    00177 struct deDriveInfo
    00178 {
    00179     enum deDriveType
    00180     {
    00181         DEDRIVE_UNKNOWN=0,
    00182         DEDRIVE_NO_ROOT_DIR,
    00183         DEDRIVE_REMOVABLE,
    00184         DEDRIVE_FIXED,
    00185         DEDRIVE_REMOTE,
    00186         DEDRIVE_CDROM,
    00187         DEDRIVE_RAMDISK,
    00188         DEDRIVE_32BIT = 0x7fffffff
    00189     };
    00190     u64 TotalSize;  ///<total size of the drive
    00191     u64 FreeSize;   ///<free space on drive
    00192     char Drive[4];      ///<Drive letter
    00193     deDriveType Type;   ///<Type of drive
    00194 };
    00195
    00196 /// information regarding a whole computer system
    00197 struct deSystemInfo
    00198 {
    00199     deCPUInfo CPUInfo;          ///< CPU Information
    00200     deOSInfo OSInfo;            ///< Operating System Information
    00201     deMemoryInfo MemoryInfo;    ///< Memory Information
    00202     deDXInfo DXInfo;            ///< DirectX Information
    00203 //  deTArray < deTWrapper<deDriveInfo> > DriveInfo;
    00204     deTArray < deDriveInfo > DriveInfo; ///< Drive Information
    00205 };
    00206
    00207
    00208
    00209 //=================================================================================
    00210 // IdeMachine Class
    00211 //
    00212 // System Configuration Analyzer Interface Base Class
    00213 //=================================================================================
    00214
    00215 /// an interface for querying the hardware specifics of a computer system
    00216 //class IdeMachine
    00217 DE3D_INTERFACE_(IdeMachine)
    00218 {
    00219 public:
    00220    virtual ~IdeMachine()  {};
    00221
    00222    virtual deBoolean GetCreationResult(void) = 0;
    00223    /// retrieve filled information struct regarding the computer system
    00224    virtual const deSystemInfo * GetSystemInfo() = 0;
    00225 };
    00226
    00227
    00228
    00229 //=================================================================================
    00230 // Destiny System Configuration Analyzer Interface Factory
    00231 //=================================================================================
    00232
    00233     DEMACHINE_API IdeMachine *GetIdeMachineInterface();
    00234 typedef IdeMachine* (*fGetIdeMachineInterface)();
    00235
    00236
    00237 #endif
    00238 #endif  //End DEMACHINE_HPP
    00239