Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JSysinfo.hh
Go to the documentation of this file.
1 #ifndef __JSYSTEM__JSYSINFO__
2 #define __JSYSTEM__JSYSINFO__
3 
4 #include <sys/sysinfo.h>
5 
6 
7 /**
8  * \file
9  * System information.
10  * \author mdejong
11  */
12 namespace JSYSTEM {}
13 namespace JPP { using namespace JSYSTEM; }
14 
15 namespace JSYSTEM {
16 
17  /**
18  * Auxiliary class for system information.
19  * This class encapsulates the <tt>sysinfo</tt> data structure.
20  */
21  struct JSysinfo :
22  public sysinfo
23  {
24  /**
25  * Default constructor.
26  */
28  {
29  ::sysinfo(static_cast<sysinfo*>(this));
30  }
31 
32 
33  /**
34  * Get total RAM.
35  *
36  * \return total RAM [B]
37  */
38  unsigned long long int getTotalRAM() const
39  {
40  return (unsigned long long int) this->totalram * (unsigned long long int) this->mem_unit;
41  }
42  };
43 }
44 
45 #endif
Auxiliary class for system information.
Definition: JSysinfo.hh:21
JSysinfo()
Default constructor.
Definition: JSysinfo.hh:27
unsigned long long int getTotalRAM() const
Get total RAM.
Definition: JSysinfo.hh:38