Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
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::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 }
FrameFarm & m_farm
boost::atomic< bool > status
RecipientsHandler & m_recipients

Member Function Documentation

◆ operator()()

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
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
46 }
47 }
48}
bool isRunning()
void getFrame(Frame &frame)
Definition frame_farm.cc:36
Template Frame for ARS data.
Definition frame.hh:13
unsigned int getFrameLength() const
Definition frame.hh:34
unsigned int getNItems() const
Definition frame.hh:39
bool send(const Frame &data)
#define LOG_DEBUG
Definition log.hh:109
#define LOG_NOTICE
Definition log.hh:112
void chrono_set(chronometrable &chr)
void chrono_dump(const Frame &frame)

◆ stop()

void DFInterface::stop ( )
inline

Definition at line 32 of file DFInterface.hh.

33 {
34 status = false;
35 }

◆ isRunning()

bool DFInterface::isRunning ( )
inline

Definition at line 37 of file DFInterface.hh.

38 {
39 return status.load();
40 }

Member Data Documentation

◆ status

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

Definition at line 14 of file DFInterface.hh.

◆ m_recipients

RecipientsHandler& DFInterface::m_recipients
private

Definition at line 16 of file DFInterface.hh.

◆ m_farm

FrameFarm& DFInterface::m_farm
private

Definition at line 18 of file DFInterface.hh.


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