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 0
30  int64 getTotalSwap() const { return myTotalSwap; }
31  int64 getFreeSwap() const { return myFreeSwap; }
32 
33  // This is a number between 0 (fully loaded) and 1 (fully idle).
34  // If not supported, returns -1
35  fpreal getCPUIdle() const { return myCPUIdle; }
36 
37  const char *getSystemName() const { return mySystemName; }
38 
39 private:
40  int64 myPhysMemory;
41  int64 myFreeMemory;
42  int64 myTotalSwap;
43  int64 myFreeSwap;
44  const char *mySystemName;
45 
46  float myCPUIdle;
47 };
48 
49 #endif
fpreal getCPUIdle() const
#define UT_API
Definition: UT_API.h:14
int64 getFreeSwap() const
const char * getSystemName() const
long long int64
Definition: SYS_Types.h:116
int64 getTotalSwap() const
fpreal64 fpreal
Definition: SYS_Types.h:277
int64 getFreeMemory() const
int64 getPhysMemory() const