Jpp  15.0.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 }
void chrono_set(chronometrable &chr)
bool isRunning()
Definition: DFInterface.hh:37
RecipientsHandler & m_recipients
Definition: DFInterface.hh:16
#define LOG_DEBUG
Definition: log.hh:109
void chrono_dump(const Frame &frame)
void operator()()
Definition: DFInterface.cc:8
#define LOG_NOTICE
Definition: log.hh:112
unsigned int getNItems() const
Definition: frame.hh:39
unsigned int getFrameLength() const
Definition: frame.hh:34
void getFrame(Frame &frame)
Definition: frame_farm.cc:36
FrameFarm & m_farm
Definition: DFInterface.hh:18
Template Frame for ARS data.
Definition: frame.hh:12
bool send(const Frame &data)