OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
system.h
Go to the documentation of this file.
1//
2/// \file system.h
3/// Definition of TSystem, a system information provider class
4//
5// Part of OWLNext - the next generation Object Windows Library
6// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved.
7//
8// For more information, including license details, see
9// http://owlnext.sourceforge.net
10//
11
12#if !defined(OWL_SYSTEM_H)
13#define OWL_SYSTEM_H
14
15#include <owl/private/defs.h>
16#if defined(BI_HAS_PRAGMA_ONCE)
17# pragma once
18#endif
19
20#include <owl/wsysinc.h>
21#include <owl/defs.h>
22
23namespace owl {
24
26
27#include <owl/preclass.h>
28
29//
30/// \class TSystem
31/// Provides information on OS relevant information.
32/// Note that this class is only a namespace for the contained static member functions,
33/// and hence it should not (and can not) be instantiated or inherited.
34//
35class _OWLCLASS TSystem // final
36{
37public:
38
39 /// \name Accessors for OS info
40 /// @{
41
42 static uint GetProductInfo();
43 static auto GetVersionInfo() -> TModuleVersionInfo&;
44 static uint GetMajorVersion();
45 static uint GetMinorVersion();
46 static uint GetBuildNumber();
47 static auto GetVersionStr() -> tstring;
48 static bool IsWin64Bit();
49
50 /// @}
51
52 //
53 /// Encapsulates information about a processor core.
54 /// See TSystem::GetProcessorInfo.
55 //
57 {
58 public:
59
62
63 /// \name CPU attributes
64 /// @{
65
66 tstring GetName() const;
67 tstring GetVendorId() const;
68 static tstring GetVendorName(const tstring& vendorId);
69 auto GetIdentifier() const -> tstring;
70 int GetNominalFrequency() const;
71
72 /// @}
73 /// \name x86 CPU feature predicates
74 /// @{
75
76 static bool HasMmx();
77 static bool Has3dNow();
78 static bool HasSse();
79 static bool HasSse2();
80 static bool HasSse3();
81
82 /// @}
83
84 private:
85
86 struct TImpl;
87 TImpl* Pimpl;
88
89 // Copy prevention
90
91 TProcessorInfo(const TProcessorInfo&); // = delete
92 const TProcessorInfo& operator =(const TProcessorInfo&); // = delete
93 };
94
95 /// \name Accessors for processor info
96 /// @{
97
98 static int GetNumberOfProcessors();
100 static tstring GetProcessorArchitectureName(uint architecture);
101 static const TProcessorInfo& GetProcessorInfo();
102
103 /// @}
104
105private:
106
107 // Instantiation and inheritance prevention
108
109 TSystem(); // = delete
110 TSystem(const TSystem&); // = delete
111 TSystem& operator =(const TSystem&); // = delete
112
113};
114
115#include <owl/posclass.h>
116
117} // OWL namespace
118
119#endif // OWL_SYSTEM_H
TModuleVersionInfo provides access to a TModule's VERSIONINFO resource.
Definition module.h:185
Encapsulates information about a processor core.
Definition system.h:57
int GetNominalFrequency() const
Returns the frequency of CPU 0 as reported by the Windows Registry ("CentralProcessor/0/~MHz").
Definition system.cpp:296
TProcessorInfo()
Queries CPU info and initializes members.
Definition system.cpp:244
static tstring GetVendorName(const tstring &vendorId)
Returns the name of the CPU vendor.
Definition system.cpp:273
tstring GetVendorId() const
Definition system.cpp:259
auto GetIdentifier() const -> tstring
Definition system.cpp:264
tstring GetName() const
Definition system.cpp:254
static uint GetBuildNumber()
Definition system.cpp:91
static bool IsWin64Bit()
Returns true if the OS is 64-bit.
Definition system.cpp:104
static int GetNumberOfProcessors()
Returns the value of the SYSTEM_INFO::dwNumberOfProcessors field returned by GetSystemInfo.
Definition system.cpp:131
static auto GetVersionStr() -> tstring
Definition system.cpp:96
static uint GetMinorVersion()
Definition system.cpp:86
static uint GetProcessorArchitecture()
Returns the value of the SYSTEM_INFO::wProcessorArchitecture field returned by GetSystemInfo.
Definition system.cpp:141
static uint GetMajorVersion()
Definition system.cpp:81
static tstring GetProcessorArchitectureName(uint architecture)
Returns the description string for the given processor architecture.
Definition system.cpp:151
static auto GetVersionInfo() -> TModuleVersionInfo &
Returns the product version for "kernel32.dll".
Definition system.cpp:75
static const TProcessorInfo & GetProcessorInfo()
Returns info for the current processor.
Definition system.cpp:177
static uint GetProductInfo()
Retrieves the product edition for the operating system on the local computer, and maps the type to th...
Definition system.cpp:60
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
General definitions used by all ObjectWindows programs.
#define _OWLCLASS
Definition defs.h:338
Includes windowing system headers, with necessary macros defined.