Jpp
examples
JNet
JWhereIs.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
#include <sstream>
5
6
#include "
JNet/JControlHost.hh
"
7
8
#include "
Jeep/JParser.hh
"
9
#include "
Jeep/JMessage.hh
"
10
11
12
/**
13
* \file
14
*
15
* Example program to test JNET::JControlHost::WhereIs.
16
* \author mdejong
17
*/
18
int
main
(
int
argc,
char
* argv[])
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
}
main
int main(int argc, char *argv[])
Definition:
JWhereIs.cc:18
JMessage.hh
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
debug
int debug
debug level
Definition:
JSirene.cc:59
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JControlHost.hh
std
Definition:
jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
Generated by
1.8.16