Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JSysinfo.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 
4 #include "JSystem/JSysinfo.hh"
5 #include "Jeep/JParser.hh"
6 #include "Jeep/JMessage.hh"
7 
8 /**
9  * \file
10  *
11  * Example program to print system information.
12  * \author mdejong
13  */
14 int main(int argc, char* argv[])
15 {
16  using namespace std;
17 
18  try {
19 
20  JParser<> zap("Example program to print system information.");
21 
22  zap(argc, argv);
23  }
24  catch(const exception &error) {
25  FATAL(error.what() << endl);
26  }
27 
28  using namespace JPP;
29 
30  const JSysinfo info;
31 
32  cout << "up-time " << info.uptime << endl;
33  cout << "RAM total " << info.totalram << endl;
34  cout << "RAM free " << info.freeram << endl;
35  cout << "memory " << info.mem_unit << endl;
36  cout << "RAM " << info.getTotalRAM() << endl;
37 }
Utility class to parse command line options.
Definition: JParser.hh:1500
System information.
int main(int argc, char *argv[])
Definition: Main.cc:15
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.