HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SysResource.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  * NAME: UT_SysResource.h ( UT Library, C++)
7  *
8  * COMMENTS: SysResource class to retrieve system specific information
9  */
10 
11 #ifndef __UT_SysResource__
12 #define __UT_SysResource__
13 
14 #include "UT_API.h"
15 #include <SYS/SYS_Types.h>
16 
18 public:
20 
21  // Do not update the CPU idle if you're calling this from a static
22  // construction code path or else it will hang houdini on Windows!
23  void update( bool skip_update_idle = false );
24 
25  // Return information about memory on the system. All results are Kb.
26  int64 getPhysMemory() const { return myPhysMemory; }
27  int64 getFreeMemory() const { return myFreeMemory; }
28 
29  // If not supported, returns -1
30  int64 getAvailMemory() const { return myAvailMemory; }
31 
32  // If not supported, returns 0
33  int64 getTotalSwap() const { return myTotalSwap; }
34  int64 getFreeSwap() const { return myFreeSwap; }
35 
36  // This is a number between 0 (fully loaded) and 1 (fully idle).
37  // If not supported, returns -1
38  fpreal getCPUIdle() const { return myCPUIdle; }
39 
40  const char *getSystemName() const { return mySystemName; }
41 
42 private:
43  int64 myPhysMemory;
44  int64 myFreeMemory;
45  int64 myAvailMemory;
46  int64 myTotalSwap;
47  int64 myFreeSwap;
48  const char *mySystemName;
49 
50  float myCPUIdle;
51 };
52 
53 #endif
fpreal getCPUIdle() const
#define UT_API
Definition: UT_API.h:14
int64 getFreeSwap() const
int64 getAvailMemory() const
const char * getSystemName() const
long long int64
Definition: SYS_Types.h:116
int64 getTotalSwap() const
fpreal64 fpreal
Definition: SYS_Types.h:283
int64 getFreeMemory() const
int64 getPhysMemory() const