Belle II Software development
HistoRelay Class Reference

Public Member Functions

 HistoRelay (std::string &filename, std::string &dest, int port)
 
int collect ()
 

Private Attributes

std::string m_filename
 
DqmMemFilem_memfile
 
EvtSocketSendm_sock
 
std::string m_dest
 
int m_port
 

Detailed Description

Definition at line 21 of file HistoRelay.h.

Constructor & Destructor Documentation

◆ HistoRelay()

HistoRelay ( std::string &  filename,
std::string &  dest,
int  port 
)

Definition at line 15 of file HistoRelay.cc.

16{
17 m_dest = dest;
18 m_port = port;
19 m_memfile = new DqmMemFile(file);
20 m_sock = new EvtSocketSend(m_dest, m_port);
21}

◆ ~HistoRelay()

~HistoRelay ( )

Definition at line 23 of file HistoRelay.cc.

24{
25 delete m_sock;
26 delete m_memfile;
27}

Member Function Documentation

◆ collect()

int collect ( )

Definition at line 29 of file HistoRelay.cc.

30{
31 // printf ( "HistoRelay : collect!!\n" );
32 EvtMessage* msg = m_memfile->StreamMemFile();
33
34 auto ret = m_sock->send(msg);
35
36 delete (msg);
37
38 if (ret < 0) {
39 // Socket error, e.g server died
40 delete m_sock;
41 // try reconnect
42 printf("HistoRelay: socket seems dead -> reconnect\n");
43 m_sock = new EvtSocketSend(m_dest, m_port);
44 }
45
46 return 0;
47}
Class to manage streamed object.
Definition: EvtMessage.h:59

Member Data Documentation

◆ m_dest

std::string m_dest
private

Definition at line 31 of file HistoRelay.h.

◆ m_filename

std::string m_filename
private

Definition at line 28 of file HistoRelay.h.

◆ m_memfile

DqmMemFile* m_memfile
private

Definition at line 29 of file HistoRelay.h.

◆ m_port

int m_port
private

Definition at line 32 of file HistoRelay.h.

◆ m_sock

EvtSocketSend* m_sock
private

Definition at line 30 of file HistoRelay.h.


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