Jpp  15.0.1-rc.1-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JLigierObjectIterator.cc File Reference

Example program to test JNET::JLigierObjectIterator. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDAQ/JDAQTags.hh"
#include "JNet/JLigierObjectIterator.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::JLigierObjectIterator.

Author
mdejong

Definition in file JLigierObjectIterator.cc.

Function Documentation

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

Definition at line 22 of file JLigierObjectIterator.cc.

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 
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 }
Utility class to parse command line options.
Definition: JParser.hh:1500
debug
Definition: JMessage.hh:29
void setDAQLongprint(const bool option)
Set DAQ print option.
Definition: JDAQPrint.hh:28
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
#define NOTICE(A)
Definition: JMessage.hh:64
#define ERROR(A)
Definition: JMessage.hh:66
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
virtual const char * what() const override
Get error message.
Definition: JException.hh:48
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
Exception for socket.
Definition: JException.hh:432
Object iteration through ControlHost server.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41