HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SYS_Platform.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * Authored by:
7  * Side Effects Software Inc.
8  *
9  * NAME: SYS_Platform.h (SYS Library, C++)
10  *
11  * COMMENTS: Functions related to OS/Machine specific
12  * information.
13  */
14 
15 #ifndef __SYS_Platform_h__
16 #define __SYS_Platform_h__
17 
18 #include "SYS_API.h"
19 #include "SYS_Types.h"
20 #include <string>
21 
22 /// Get processor information about the CPU that Houdini is running on.
23 /// Please see SYS_ProcessorDefines.h for CPU information
24 SYS_API extern void SYSgetProcessor(int &majortype, int &flags);
25 
26 /// Determine if we satisfy minimum processor requirements
27 SYS_API extern bool SYShasMinimumProcessor();
28 
29 /// Returns the number of processors available for the process, taking into
30 /// account affinity masks.
31 ///
32 /// NOTE: Unless you have a good reason to call this directly, you probably
33 /// want to call UT_Thread::getNumProcessors(), instead, because that
34 /// takes into account users opting to limit the thread count,
35 /// and caches the number for fast querying.
36 SYS_API extern int SYSgetProcessorCount();
37 
38 #if defined(WIN32)
39 /// These are intended for private use by UT_Thread
40 /// @{
41 struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX;
42 SYS_API extern const struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *SYSgetProcessorGroupInfo();
43 struct _GROUP_AFFINITY;
44 typedef int (__stdcall *SetThreadGroupAffinityFunc)(void*, const struct _GROUP_AFFINITY *, struct _GROUP_AFFINITY*);
45 SYS_API extern SetThreadGroupAffinityFunc SYSgetSetThreadGroupAffinity();
46 /// @}
47 #endif
48 
49 /// Find the name of the operating system that Houdini was compiled for
50 SYS_API extern const char *SYSgetOsProc();
51 
52 /// Return a "nice" name of the current operating system
54 
55 /// Find the exact OS, 32-bit or 64-bit build, compiler version
56 SYS_API extern const char *SYSgetPlatformSpec();
57 
58 /// Returns the amount of installed memory (not VM).
60 
61 /// Returns string representing the manufacturerer's name.
62 /// @warning The format of this string is OS specific! Use SYSgetCPUBrand()
63 /// if you need to programatically switch on the processor manufacturer.
65 
66 enum class SYS_CPUBrand
67 {
68  Unknown = -1,
69  Intel,
70  Amd,
71  Apple,
72  Arm
73 };
74 
76 {
83 };
84 
85 /// Returns CPU manufacturer
87 
88 /// Returns the CPU model information
90 
91 /// Just a handy, quick, and fast function to test the platform for which
92 /// the code is being compiled.
93 SYS_API extern bool SYSisMBSD();
94 SYS_API extern bool SYSisLinux();
95 SYS_API extern bool SYSisWindows();
96 
97 /// Return the MAC addresses for all the deviced on this system. The caller is
98 /// responsible to delete [] the addresses if num_addresses > 0.
99 SYS_API extern void SYSgetMACAddresses(
100  unsigned char *&addresses,
101  int &num_addresses);
102 
103 /// Return a single MAC address that we treat as the main MAC address for this
104 /// machine. Returns false if no MAC address could be determined.
105 SYS_API extern bool SYSgetMACAddress(unsigned char mac_address[6]);
106 
107 // Return the MAC address giving the same value returned by Python's
108 // uuid.getnode().
109 SYS_API extern bool SYSgetMACAddressAsInteger(int64 &mac_address);
110 
111 #endif // __UT_SysSpecific_h__
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
GLbitfield flags
Definition: glcorearb.h:1596
uint8 myFamily
Definition: SYS_Platform.h:78
SYS_API const char * SYSgetPlatformSpec()
Find the exact OS, 32-bit or 64-bit build, compiler version.
uint8 myExtModel
Definition: SYS_Platform.h:79
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
int64 exint
Definition: SYS_Types.h:125
SYS_API std::string SYSgetCPUBrandString()
unsigned char uint8
Definition: SYS_Types.h:36
SYS_API std::string SYSgetRuntimeOSLabel()
Return a "nice" name of the current operating system.
SYS_API bool SYSisWindows()
SYS_API SYS_CPUBrand SYSgetCPUBrand()
Returns CPU manufacturer.
uint8 myExtFamily
Definition: SYS_Platform.h:77
SYS_API bool SYSisLinux()
SYS_API SYS_CPUModel SYSgetCPUModel()
Returns the CPU model information.
SYS_API bool SYSisMBSD()
long long int64
Definition: SYS_Types.h:116
SYS_API void SYSgetMACAddresses(unsigned char *&addresses, int &num_addresses)
uint8 mySteppingId
Definition: SYS_Platform.h:82
SYS_API const char * SYSgetOsProc()
Find the name of the operating system that Houdini was compiled for.
SYS_API bool SYSgetMACAddressAsInteger(int64 &mac_address)
SYS_API bool SYSgetMACAddress(unsigned char mac_address[6])
SYS_CPUBrand
Definition: SYS_Platform.h:66
SYS_API exint SYSgetMemorySize()
Returns the amount of installed memory (not VM).
SYS_API bool SYShasMinimumProcessor()
Determine if we satisfy minimum processor requirements.
SYS_API int SYSgetProcessorCount()
#define SYS_API
Definition: SYS_API.h:11
SYS_API void SYSgetProcessor(int &majortype, int &flags)
uint8 myProcType
Definition: SYS_Platform.h:81