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

Example program to test JNET::JControlHost::WhereIs. More...

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

Go to the source code of this file.

Functions

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

Detailed Description

Example program to test JNET::JControlHost::WhereIs.

Author
mdejong

Definition in file JWhereIs.cc.

Function Documentation

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

Definition at line 18 of file JWhereIs.cc.

19 {
20  using namespace std;
21  using namespace JPP;
22 
23  string hostname;
24  string nickname;
25  int debug;
26 
27  try {
28 
29  JParser<> zap("Example program to test where is functionality of ControlHost server.");
30 
31  zap['H'] = make_field(hostname) = "localhost";
32  zap['M'] = make_field(nickname);
33  zap['d'] = make_field(debug) = 1;
34 
35  zap(argc, argv);
36  }
37  catch(const exception &error) {
38  FATAL(error.what() << endl);
39  }
40 
41 
42  string answer;
43 
44  JControlHost::WhereIs(hostname, nickname, answer);
45 
46  istringstream is(answer);
47 
48  for (string buffer; is >> buffer; ) {
49  NOTICE("Host: " << buffer << endl);
50  }
51 }
Utility class to parse command line options.
Definition: JParser.hh:1500
is
Definition: JDAQCHSM.chsm:167
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
#define NOTICE(A)
Definition: JMessage.hh:64
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67