Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cSystemInfo Class Reference

OS build type name. OS target known at compile time. Actually run environment may vary of course. More...

#include <cSystemInfo.h>

Inheritance diagram for Gray::cSystemInfo:
Gray::cSingleton< cSystemInfo > Gray::cSingletonStatic< TYPE > Gray::cSingletonRegister Gray::CObject Gray::cHeapObject Gray::IHeapObject

Public Member Functions

UINT get_NumberOfProcessors () const
 
bool isOS64Bit () const
 
UINT get_OSVer () const
 
const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 
- Public Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
virtual bool isValidCheck () const noexcept
 < memory allocation and structure definitions are valid. More...
 
virtual void AssertValid () const
 < memory allocation and structure definitions are valid. More...
 
virtual void Serialize (cArchive &a)
 
- Public Member Functions inherited from Gray::cHeapObject
 cHeapObject ()
 
virtual ~cHeapObject ()
 
bool IsValidInsideN (INT_PTR index) const
 
bool IsValidInsidePtr (void const *pTest) const
 
virtual size_t GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const
 
virtual bool isValidCheck () const noexcept
 

Static Public Member Functions

static StrLen_t __stdcall GetSystemDir (FILECHAR_t *pszDir, StrLen_t iLenMax)
 
static HRESULT __stdcall GetSystemName (FILECHAR_t *pszName, StrLen_t iLenMax)
 
static bool __stdcall SystemShutdown (bool bReboot)
 
static void __stdcall SystemBeep ()
 
- Static Public Member Functions inherited from Gray::cSingleton< cSystemInfo >
static cSystemInfo *__stdcall get_Single ()
 
static TYPE2 *__stdcall get_SingleT ()
 
static cSystemInfo &__stdcall I ()
 
- Static Public Member Functions inherited from Gray::cSingletonStatic< TYPE >
static bool isSingleCreated () noexcept
 
static TYPEget_SingleU () noexcept
 
static TYPEget_Single ()
 
template<class TYPE2 >
static TYPE2 *__stdcall get_SingleCast ()
 
static TYPEI () noexcept
 
- Static Public Member Functions inherited from Gray::cSingletonRegister
static void __stdcall ReleaseModule (HMODULE hMod)
 

Protected Member Functions

 cSystemInfo ()
 
 ~cSystemInfo ()
 
- Protected Member Functions inherited from Gray::cSingleton< cSystemInfo >
 cSingleton (cSystemInfo *pObject, const TYPEINFO_t &rAddrCode=typeid(cSystemInfo)) noexcept
 
virtual ~cSingleton ()
 
- Protected Member Functions inherited from Gray::cSingletonStatic< TYPE >
 cSingletonStatic (TYPE *pObject) noexcept
 
virtual ~cSingletonStatic () noexcept
 
- Protected Member Functions inherited from Gray::cSingletonRegister
 cSingletonRegister (const TYPEINFO_t &rAddrCode) noexcept
 
virtual ~cSingletonRegister ()
 
void RegisterSingleton ()
 

Friends

class cSingleton< cSystemInfo >
 
class cSystemInfoTests
 

Additional Inherited Members

- Static Public Attributes inherited from Gray::cSingletonRegister
static cThreadLockFast sm_LockSingle
 common lock for all cSingleton. More...
 
- Protected Attributes inherited from Gray::cSingletonRegister
HMODULE m_hModuleLoaded
 What modules loaded this ? So singletons can be destroyed if DLL/SO unloads. More...
 
- Static Protected Attributes inherited from Gray::cSingletonStatic< TYPE >
static TYPEsm_pThe = nullptr
 pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More...
 

Detailed Description

OS build type name. OS target known at compile time. Actually run environment may vary of course.

The system as a whole. (as far as we can detect) not just the current running app/process or user login. The detected system params may be effected by system virtualization.

Constructor & Destructor Documentation

◆ cSystemInfo()

Gray::cSystemInfo::cSystemInfo ( )
protected

◆ ~cSystemInfo()

Gray::cSystemInfo::~cSystemInfo ( )
protected

Member Function Documentation

◆ get_HeapPtr()

const void* Gray::cSystemInfo::get_HeapPtr ( ) const
inlineoverridevirtualnoexcept

Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr().

Reimplemented from Gray::cHeapObject.

◆ get_NumberOfProcessors()

UINT Gray::cSystemInfo::get_NumberOfProcessors ( ) const

Is SMP an issue? Do i need to worry about multiple processors ? Creating more worker threads than CPU's might not help you if its a CPU heavy task.

◆ get_OSVer()

UINT Gray::cSystemInfo::get_OSVer ( ) const

from http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx

Returns
>= 0x600 = Vista 4.0 = Windows NT 5.0 = Windows 2000 5.1 = Windows XP (Pro or Home) 5.2 = Windows Server 2003 R2 or Home Server or Storage Server 2003 6.0 = Windows Vista or Server 2008 R1 6.1 = Windows 7 or Server 2008 R2 6.2 = Windows 8 or Server 2012

◆ GetSystemDir()

StrLen_t GRAYCALL Gray::cSystemInfo::GetSystemDir ( FILECHAR_t pszDir,
StrLen_t  iLenMax 
)
static

Where does the OS keep its files. CSIDL_SYSTEM HRESULT hRes = _FNF(::SHGetFolderPath)( g_MainFrame.GetSafeHwnd(), CSIDL_SYSTEM, nullptr, 0, szPath );

◆ GetSystemName()

HRESULT GRAYCALL Gray::cSystemInfo::GetSystemName ( FILECHAR_t pszName,
StrLen_t  iLenMax 
)
static

◆ isOS64Bit()

bool Gray::cSystemInfo::isOS64Bit ( ) const

can both the OS and CPU handle 64 bit apps. A 32 bit app can run on 64 bit system.

◆ SystemBeep()

void GRAYCALL Gray::cSystemInfo::SystemBeep ( )
static

◆ SystemShutdown()

bool GRAYCALL Gray::cSystemInfo::SystemShutdown ( bool  bReboot)
static

Shut down or reboot the whole system. not just log off the user or close the app.

Friends And Related Function Documentation

◆ cSingleton< cSystemInfo >

friend class cSingleton< cSystemInfo >
friend

◆ cSystemInfoTests

friend class cSystemInfoTests
friend

The documentation for this class was generated from the following files: