Loading...
Searching...
No Matches
juce_SystemStats.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API SystemStats final
{
public:
//==============================================================================
static String getJUCEVersion();
//==============================================================================
enum OperatingSystemType
{
UnknownOS = 0,
MacOSX = 0x0100,
Windows = 0x0200,
Linux = 0x0400,
Android = 0x0800,
iOS = 0x1000,
WASM = 0x2000,
MacOSX_10_7 = MacOSX | 7,
MacOSX_10_8 = MacOSX | 8,
MacOSX_10_9 = MacOSX | 9,
MacOSX_10_10 = MacOSX | 10,
MacOSX_10_11 = MacOSX | 11,
MacOSX_10_12 = MacOSX | 12,
MacOSX_10_13 = MacOSX | 13,
MacOSX_10_14 = MacOSX | 14,
MacOSX_10_15 = MacOSX | 15,
MacOS_11 = MacOSX | 16,
MacOS_12 = MacOSX | 17,
MacOS_13 = MacOSX | 18,
MacOS_14 = MacOSX | 19,
Win2000 = Windows | 1,
WinXP = Windows | 2,
WinVista = Windows | 3,
Windows7 = Windows | 4,
Windows8_0 = Windows | 5,
Windows8_1 = Windows | 6,
Windows10 = Windows | 7,
Windows11 = Windows | 8
};
static OperatingSystemType getOperatingSystemType();
static String getOperatingSystemName();
static bool isOperatingSystem64Bit();
static String getEnvironmentVariable (const String& name, const String& defaultValue);
//==============================================================================
static String getLogonName();
static String getFullUserName();
static String getComputerName();
static String getUserLanguage();
static String getUserRegion();
static String getDisplayLanguage();
static String getDeviceDescription();
static String getDeviceManufacturer();
[[deprecated ("The identifiers produced by this function are not reliable. Use getUniqueDeviceID() instead.")]]
static StringArray getDeviceIdentifiers();
static String getUniqueDeviceID();
enum class MachineIdFlags
{
macAddresses = 1 << 0,
fileSystemId = 1 << 1,
legacyUniqueId = 1 << 2,
uniqueId = 1 << 3,
};
static StringArray getMachineIdentifiers (MachineIdFlags flags);
//==============================================================================
// CPU and memory information..
static int getNumCpus() noexcept;
static int getNumPhysicalCpus() noexcept;
static int getCpuSpeedInMegahertz();
static String getCpuVendor();
static String getCpuModel();
static bool hasMMX() noexcept;
static bool has3DNow() noexcept;
static bool hasFMA3() noexcept;
static bool hasFMA4() noexcept;
static bool hasSSE() noexcept;
static bool hasSSE2() noexcept;
static bool hasSSE3() noexcept;
static bool hasSSSE3() noexcept;
static bool hasSSE41() noexcept;
static bool hasSSE42() noexcept;
static bool hasAVX() noexcept;
static bool hasAVX2() noexcept;
static bool hasAVX512F() noexcept;
static bool hasAVX512BW() noexcept;
static bool hasAVX512CD() noexcept;
static bool hasAVX512DQ() noexcept;
static bool hasAVX512ER() noexcept;
static bool hasAVX512IFMA() noexcept;
static bool hasAVX512PF() noexcept;
static bool hasAVX512VBMI() noexcept;
static bool hasAVX512VL() noexcept;
static bool hasAVX512VPOPCNTDQ() noexcept;
static bool hasNeon() noexcept;
//==============================================================================
static int getMemorySizeInMegabytes();
static int getPageSize();
//==============================================================================
static String getStackBacktrace();
using CrashHandlerFunction = void (*) (void*);
static void setApplicationCrashHandler (CrashHandlerFunction);
static bool isRunningInAppExtensionSandbox() noexcept;
#if JUCE_MAC
static bool isAppSandboxEnabled();
#endif
//==============================================================================
#ifndef DOXYGEN
[[deprecated ("This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz instead.")]]
static int getCpuSpeedInMegaherz() { return getCpuSpeedInMegahertz(); }
#endif
private:
SystemStats() = delete; // uses only static methods
JUCE_DECLARE_NON_COPYABLE (SystemStats)
};
JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS (SystemStats::MachineIdFlags)
} // namespace juce
juce::StringArray
Definition juce_StringArray.h:35
juce::String
Definition juce_String.h:53
juce::SystemStats
Definition juce_SystemStats.h:33
juce::SystemStats::hasAVX512CD
static bool hasAVX512CD() noexcept
Definition juce_SystemStats.cpp:165
juce::SystemStats::getStackBacktrace
static String getStackBacktrace()
Definition juce_SystemStats.cpp:177
juce::SystemStats::hasMMX
static bool hasMMX() noexcept
Definition juce_SystemStats.cpp:151
juce::SystemStats::setApplicationCrashHandler
static void setApplicationCrashHandler(CrashHandlerFunction)
Definition juce_SystemStats.cpp:250
juce::SystemStats::getOperatingSystemName
static String getOperatingSystemName()
juce::SystemStats::getCpuModel
static String getCpuModel()
juce::SystemStats::getUserRegion
static String getUserRegion()
juce::SystemStats::getFullUserName
static String getFullUserName()
juce::SystemStats::hasAVX512ER
static bool hasAVX512ER() noexcept
Definition juce_SystemStats.cpp:167
juce::SystemStats::has3DNow
static bool has3DNow() noexcept
Definition juce_SystemStats.cpp:152
juce::SystemStats::hasAVX2
static bool hasAVX2() noexcept
Definition juce_SystemStats.cpp:162
juce::SystemStats::hasAVX512VPOPCNTDQ
static bool hasAVX512VPOPCNTDQ() noexcept
Definition juce_SystemStats.cpp:172
juce::SystemStats::hasSSE
static bool hasSSE() noexcept
Definition juce_SystemStats.cpp:155
juce::SystemStats::getLogonName
static String getLogonName()
juce::SystemStats::hasAVX512DQ
static bool hasAVX512DQ() noexcept
Definition juce_SystemStats.cpp:166
juce::SystemStats::isRunningInAppExtensionSandbox
static bool isRunningInAppExtensionSandbox() noexcept
Definition juce_SystemStats.cpp:270
juce::SystemStats::getOperatingSystemType
static OperatingSystemType getOperatingSystemType()
juce::SystemStats::getDeviceManufacturer
static String getDeviceManufacturer()
juce::SystemStats::hasNeon
static bool hasNeon() noexcept
Definition juce_SystemStats.cpp:173
juce::SystemStats::hasAVX512F
static bool hasAVX512F() noexcept
Definition juce_SystemStats.cpp:163
juce::SystemStats::isOperatingSystem64Bit
static bool isOperatingSystem64Bit()
juce::SystemStats::hasSSE3
static bool hasSSE3() noexcept
Definition juce_SystemStats.cpp:157
juce::SystemStats::hasSSE2
static bool hasSSE2() noexcept
Definition juce_SystemStats.cpp:156
juce::SystemStats::getDisplayLanguage
static String getDisplayLanguage()
juce::SystemStats::hasAVX
static bool hasAVX() noexcept
Definition juce_SystemStats.cpp:161
juce::SystemStats::CrashHandlerFunction
void(*)(void *) CrashHandlerFunction
Definition juce_SystemStats.h:263
juce::SystemStats::getCpuSpeedInMegahertz
static int getCpuSpeedInMegahertz()
juce::SystemStats::hasAVX512VBMI
static bool hasAVX512VBMI() noexcept
Definition juce_SystemStats.cpp:170
juce::SystemStats::getUniqueDeviceID
static String getUniqueDeviceID()
juce::SystemStats::MachineIdFlags
MachineIdFlags
Definition juce_SystemStats.h:169
juce::SystemStats::getEnvironmentVariable
static String getEnvironmentVariable(const String &name, const String &defaultValue)
juce::SystemStats::hasSSSE3
static bool hasSSSE3() noexcept
Definition juce_SystemStats.cpp:158
juce::SystemStats::OperatingSystemType
OperatingSystemType
Definition juce_SystemStats.h:44
juce::SystemStats::MacOSX
@ MacOSX
Definition juce_SystemStats.h:47
juce::SystemStats::Windows
@ Windows
Definition juce_SystemStats.h:49
juce::SystemStats::hasAVX512VL
static bool hasAVX512VL() noexcept
Definition juce_SystemStats.cpp:171
juce::SystemStats::hasAVX512PF
static bool hasAVX512PF() noexcept
Definition juce_SystemStats.cpp:169
juce::SystemStats::getComputerName
static String getComputerName()
juce::SystemStats::hasSSE41
static bool hasSSE41() noexcept
Definition juce_SystemStats.cpp:159
juce::SystemStats::getPageSize
static int getPageSize()
juce::SystemStats::getDeviceIdentifiers
static StringArray getDeviceIdentifiers()
Definition juce_SystemStats.cpp:61
juce::SystemStats::hasFMA4
static bool hasFMA4() noexcept
Definition juce_SystemStats.cpp:154
juce::SystemStats::getDeviceDescription
static String getDeviceDescription()
juce::SystemStats::getJUCEVersion
static String getJUCEVersion()
Definition juce_SystemStats.cpp:26
juce::SystemStats::getUserLanguage
static String getUserLanguage()
juce::SystemStats::hasSSE42
static bool hasSSE42() noexcept
Definition juce_SystemStats.cpp:160
juce::SystemStats::getCpuVendor
static String getCpuVendor()
juce::SystemStats::getMemorySizeInMegabytes
static int getMemorySizeInMegabytes()
juce::SystemStats::hasFMA3
static bool hasFMA3() noexcept
Definition juce_SystemStats.cpp:153
juce::SystemStats::hasAVX512IFMA
static bool hasAVX512IFMA() noexcept
Definition juce_SystemStats.cpp:168
juce::SystemStats::hasAVX512BW
static bool hasAVX512BW() noexcept
Definition juce_SystemStats.cpp:164