HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  ~UT_SysResource();
21 
22  // Do not update the CPU idle if you're calling this from a static
23  // construction code path or else it will hang houdini on Windows!
24  void update( bool skip_update_idle = false );
25 
26  // Return information about memory on the system. All results are Kb.
27  int64 getPhysMemory() const { return myPhysMemory; }
28  int64 getFreeMemory() const { return myFreeMemory; }
29 
30  // If not supported, returns 0
31  int64 getTotalSwap() const { return myTotalSwap; }
32  int64 getFreeSwap() const { return myFreeSwap; }
33 
34  // This is a number between 0 (fully loaded) and 1 (fully idle).
35  // If not supported, returns -1
36  fpreal getCPUIdle() const { return myCPUIdle; }
37 
38  const char *getSystemName() const { return mySystemName; }
39 
40 private:
41  int64 myPhysMemory;
42  int64 myFreeMemory;
43  int64 myTotalSwap;
44  int64 myFreeSwap;
45  const char *mySystemName;
46 
47  float myCPUIdle;
48 };
49 
50 #endif
fpreal getCPUIdle() const
#define UT_API
Definition: UT_API.h:12
int64 getFreeSwap() const
long long int64
Definition: SYS_Types.h:100
const char * getSystemName() const
int64 getTotalSwap() const
double fpreal
Definition: SYS_Types.h:263
int64 getFreeMemory() const
int64 getPhysMemory() const