Jpp  17.1.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JShowStat.cc File Reference

Auxiliary program to send show status message to JLigier.cc - ControlHost server. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "Jeep/JParser.hh"
#include "JNet/JControlHost.hh"

Go to the source code of this file.

Functions

int main (int argc, const char *argv[])
 

Detailed Description

Auxiliary program to send show status message to JLigier.cc - ControlHost server.


The status will then be printed by the server.

The option -H <hostname>[:port] correponds to the hostname and the port of the server, respectively.

Author
mdejong

Definition in file JShowStat.cc.

Function Documentation

int main ( int  argc,
const char *  argv[] 
)

Definition at line 18 of file JShowStat.cc.

19 {
20  using namespace std;
21  using namespace JPP;
22 
23  string hostname;
24  int debug;
25 
26  try {
27 
28  JParser<> zap("Auxiliary program to send show status messages to JLigier - ControlHost server.");
29 
30  zap['H'] = make_field(hostname) = "localhost";
31  zap['d'] = make_field(debug) = 3;
32 
33  zap(argc, argv);
34  }
35  catch(const exception &error) {
36  FATAL(error.what() << endl);
37  }
38 
39 
40 
41  JControlHost::Throw(true);
42 
43  try {
44 
45  JControlHost out(hostname);
46 
47  out.PutFullString(DISPTAG_ShowStat, "");
48  }
49  catch(const JControlHostException& error) {
50  ERROR(error << endl);
51  }
52 }
Utility class to parse command line options.
Definition: JParser.hh:1517
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
#define ERROR(A)
Definition: JMessage.hh:66
#define FATAL(A)
Definition: JMessage.hh:67
static const JTag DISPTAG_ShowStat("_ShowSta")
int debug
debug level