Jpp
DFInterface.cc
Go to the documentation of this file.
1 #include "DFInterface.hh"
2 #include "log.hh"
3 
4 /**
5  * \author cpellegrino
6  */
7 
9 {
10  Frame frame;
11 
12  while (isRunning())
13  {
14  // wait for and get data
15  m_farm.getFrame(frame);
16 
17  if (frame.size()) {
18 
19  benchmark::chrono_set(frame);
20 
21  #ifdef DEBUG_DAQ_HEADER
22  DAQHeaderPrinter const daq_head(frame.data());
23  LOG_DEBUG << "DFInterface: Got this from the queue " << daq_head;
24  #endif
25 
26  if (!frame.getNItems())
27  {
28  DAQHeaderPrinter const daq_head(frame.data());
29  LOG_NOTICE << "DFInterface: No data to transmit: " << daq_head;
30  continue;
31  }
32 
33  #ifdef DEBUG_FRAME_LENGHT
34  static unsigned int nframes = 0;
35  ++nframes;
36  if (!(nframes % 10000))
37  {
38  LOG_DEBUG << "DFInterface: FrameLenght(): " << frame.getFrameLength();
39  }
40  #endif
41 
42  m_recipients.send(frame);
43 
44  benchmark::chrono_set(frame);
46  }
47  }
48 }
LOG_DEBUG
#define LOG_DEBUG
Definition: log.hh:109
RecipientsHandler::send
bool send(const Frame &data)
Definition: recipients_handler.hh:70
log.hh
Frame
Template Frame for ARS data.
Definition: frame.hh:12
benchmark::chrono_set
void chrono_set(chronometrable &chr)
Definition: time_tracking.hh:39
LOG_NOTICE
#define LOG_NOTICE
Definition: log.hh:112
Frame::getFrameLength
unsigned int getFrameLength() const
Definition: frame.hh:34
DFInterface::operator()
void operator()()
Definition: DFInterface.cc:8
benchmark::chrono_dump
void chrono_dump(const Frame &frame)
Definition: time_tracking.hh:65
Frame::getNItems
unsigned int getNItems() const
Definition: frame.hh:39
FrameFarm::getFrame
void getFrame(Frame &frame)
Definition: frame_farm.cc:34
DFInterface::m_farm
FrameFarm & m_farm
Definition: DFInterface.hh:18
DFInterface.hh
DFInterface::isRunning
bool isRunning()
Definition: DFInterface.hh:37
DFInterface::m_recipients
RecipientsHandler & m_recipients
Definition: DFInterface.hh:16
DAQHeaderPrinter
Definition: daq_common_header.hh:30