Jpp  pmt_effective_area_update
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JShowStat.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <iomanip>
4 
5 #include "Jeep/JParser.hh"
6 #include "JNet/JControlHost.hh"
7 
8 
9 /**
10  * \file
11  *
12  * Auxiliary program to send show status message to ControlHost server.
13  *
14  * The option <tt>-H <hostname>[:port]</tt> correponds to the hostname and the port of the server, respectively.
15  * \author mdejong
16  */
17 int main(int argc, const char *argv[])
18 {
19  using namespace std;
20  using namespace JPP;
21 
22  string hostname;
23  int debug;
24 
25  try {
26 
27  JParser<> zap("Auxiliary program to send show status messages to ControlHost server.");
28 
29  zap['H'] = make_field(hostname) = "localhost";
30  zap['d'] = make_field(debug) = 3;
31 
32  zap(argc, argv);
33  }
34  catch(const exception &error) {
35  FATAL(error.what() << endl);
36  }
37 
38 
39 
40  JControlHost::Throw(true);
41 
42  try {
43 
44  JControlHost out(hostname);
45 
46  out.PutFullString(DISPTAG_ShowStat, "");
47  }
48  catch(const JControlHostException& error) {
49  ERROR(error << endl);
50  }
51 }
52 
53 
Utility class to parse command line options.
Definition: JParser.hh:1500
int main(int argc, char *argv[])
Definition: Main.cc:15
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
#define ERROR(A)
Definition: JMessage.hh:66
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.
static const JTag DISPTAG_ShowStat("_ShowSta")