Jpp
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
JSYSTEM::JSysinfo::JSysinfo
JSysinfo()
Default constructor.
Definition: JSysinfo.hh:27
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JSYSTEM
Auxiliary classes and methods for operating system calls.
Definition: JDate.hh:13
JSYSTEM::JSysinfo::getTotalRAM
unsigned long long int getTotalRAM() const
Get total RAM.
Definition: JSysinfo.hh:38
JSYSTEM::JSysinfo
Auxiliary class for system information.
Definition: JSysinfo.hh:21