Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JNet
JLigierObjectIterator.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JDAQ/JDAQTimesliceIO.hh
"
6
#include "
JDAQ/JDAQEventIO.hh
"
7
#include "
JDAQ/JDAQSummarysliceIO.hh
"
8
9
#include "
JDAQ/JDAQTags.hh
"
10
#include "
JNet/JLigierObjectIterator.hh
"
11
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
*
19
* Example program to test JNET::JLigierObjectIterator.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
* argv[])
23
{
24
using namespace
std;
25
using namespace
JPP;
26
using namespace
KM3NETDAQ;
27
28
int
port;
29
int
backlog;
30
int
debug
;
31
32
try
{
33
34
JParser<>
zap(
"Example program to test receiving of objects as Ligier server."
);
35
36
zap[
'P'
] =
make_field
(port);
37
zap[
'q'
] =
make_field
(backlog) = 1024;
38
zap[
'd'
] =
make_field
(
debug
) = 1;
39
40
zap(argc, argv);
41
}
42
catch
(
const
exception &error) {
43
FATAL
(error.what() << endl);
44
}
45
46
47
setDAQLongprint
(
debug
>=
debug_t
);
48
49
try
{
50
51
typedef
JDAQEvent
data_type;
52
53
JLigierObjectIterator<data_type>
in
(port, backlog);
54
55
while
(in.
hasNext
()) {
56
57
data_type* p = in.
next
();
58
59
if
(
debug
<
debug_t
)
60
NOTICE
(p->getDAQHeader() << endl);
61
else
62
DEBUG
(*p << endl);
63
}
64
}
65
catch
(
const
JSocketException
& error) {
66
ERROR
(error.
what
() << endl);
67
}
68
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JEEP::debug_t
debug
Definition:
JMessage.hh:29
JLANG::JAbstractObjectIterator::next
virtual const pointer_type & next()
Get next element.
Definition:
JAbstractObjectIterator.hh:71
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
KM3NETDAQ::setDAQLongprint
void setDAQLongprint(const bool option)
Set DAQ print option.
Definition:
JDAQPrint.hh:28
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition:
JDAQEvent.hh:30
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
ERROR
#define ERROR(A)
Definition:
JMessage.hh:66
JDAQSummarysliceIO.hh
debug
int debug
debug level
Definition:
JSirene.cc:61
JLigierObjectIterator.hh
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JLANG::JSocketException
Exception for socket.
Definition:
JException.hh:432
JLANG::JAbstractObjectIterator::hasNext
virtual bool hasNext()
Check availability of next element.
Definition:
JAbstractObjectIterator.hh:56
JNET::JLigierObjectIterator
Object iteration through ControlHost server.
Definition:
JLigierObjectIterator.hh:46
JDAQTags.hh
Fixed parameters andd ControlHost tags for KM3NeT DAQ.
JLANG::JException::what
virtual const char * what() const
Get error message.
Definition:
JException.hh:48
JDAQEventIO.hh
JDAQTimesliceIO.hh
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5