Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
DFInterface Class Reference

#include <DFInterface.hh>

Public Member Functions

 DFInterface (FrameFarm &FF, RecipientsHandler &recipients)
 
void operator() ()
 
void stop ()
 
bool isRunning ()
 

Private Attributes

boost::atomic< bool > status
 
RecipientsHandlerm_recipients
 
FrameFarmm_farm
 

Detailed Description

Author
cpellegrino

Definition at line 12 of file DFInterface.hh.

Constructor & Destructor Documentation

DFInterface::DFInterface ( FrameFarm FF,
RecipientsHandler recipients 
)
inline

Definition at line 22 of file DFInterface.hh.

23  :
24  m_recipients(recipients),
25  m_farm(FF)
26  {
27  status = true;
28  }
RecipientsHandler & m_recipients
Definition: DFInterface.hh:16
boost::atomic< bool > status
Definition: DFInterface.hh:14
FrameFarm & m_farm
Definition: DFInterface.hh:18

Member Function Documentation

void DFInterface::operator() ( )
Author
cpellegrino

Definition at line 8 of file DFInterface.cc.

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)
#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)
void DFInterface::stop ( )
inline

Definition at line 32 of file DFInterface.hh.

33  {
34  status = false;
35  }
boost::atomic< bool > status
Definition: DFInterface.hh:14
bool DFInterface::isRunning ( )
inline

Definition at line 37 of file DFInterface.hh.

38  {
39  return status.load();
40  }
boost::atomic< bool > status
Definition: DFInterface.hh:14

Member Data Documentation

boost::atomic<bool> DFInterface::status
private

Definition at line 14 of file DFInterface.hh.

RecipientsHandler& DFInterface::m_recipients
private

Definition at line 16 of file DFInterface.hh.

FrameFarm& DFInterface::m_farm
private

Definition at line 18 of file DFInterface.hh.


The documentation for this class was generated from the following files: