ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TrigL2MuonSA::MuCalCircClient Class Reference

#include <MuCalCircClient.h>

Collaboration diagram for TrigL2MuonSA::MuCalCircClient:

Public Member Functions

 MuCalCircClient (unsigned short port, std::string &buffer_name, unsigned int buffer_size)
 
virtual ~MuCalCircClient ()
 
bool dumpToCirc (LVL2_MUON_CALIBRATION::CalibEvent &event) const
 

Private Attributes

int m_cid
 
unsigned short m_port
 
std::string m_bufferName
 
unsigned int m_bufferSize
 

Detailed Description

Definition at line 27 of file MuCalCircClient.h.

Constructor & Destructor Documentation

◆ MuCalCircClient()

TrigL2MuonSA::MuCalCircClient::MuCalCircClient ( unsigned short  port,
std::string &  buffer_name,
unsigned int  buffer_size 
)

Definition at line 15 of file MuCalCircClient.cxx.

16  : m_port (port), m_bufferName (buffer_name), m_bufferSize (buffer_size)
17 {
18 
19  std::vector<char> writable(m_bufferName.begin(), m_bufferName.end());
20  writable.push_back('\0');
21 
22  // char *name = const_cast <char *> (m_bufferName.c_str());
23  if ( ( m_cid = CircOpenCircConnection_t (m_port, &*writable.begin(), m_bufferSize) ) < 0)
24  {
26  throw e;
27  }
28 }

◆ ~MuCalCircClient()

TrigL2MuonSA::MuCalCircClient::~MuCalCircClient ( )
virtual

Definition at line 30 of file MuCalCircClient.cxx.

31 {
32  std::vector<char> writable(m_bufferName.begin(), m_bufferName.end());
33  writable.push_back('\0');
34  if (m_cid >=0 )
35  CircCloseCircConnection_t (m_port, &*writable.begin() , m_cid);
36 }

Member Function Documentation

◆ dumpToCirc()

bool TrigL2MuonSA::MuCalCircClient::dumpToCirc ( LVL2_MUON_CALIBRATION::CalibEvent &  event) const

Definition at line 38 of file MuCalCircClient.cxx.

39 {
40  char *ptr;
41  bool success = false;
42  uint16_t event_size = event.size ();
43 
44  if (m_cid>=0){
45  if ((ptr = CircReserve_t (m_cid, event_size )) != (char *) -1)
46  {
47  uint8_t *buff = reinterpret_cast <uint8_t *> (ptr);
48  int bufsize = event.dumpWords (buff, event_size);
49 
50  (void) CircValidate_t (m_cid, ptr, bufsize);
51  success = true;
52  }
53  }
54  return success;
55 }

Member Data Documentation

◆ m_bufferName

std::string TrigL2MuonSA::MuCalCircClient::m_bufferName
private

Definition at line 38 of file MuCalCircClient.h.

◆ m_bufferSize

unsigned int TrigL2MuonSA::MuCalCircClient::m_bufferSize
private

Definition at line 39 of file MuCalCircClient.h.

◆ m_cid

int TrigL2MuonSA::MuCalCircClient::m_cid
private

Definition at line 36 of file MuCalCircClient.h.

◆ m_port

unsigned short TrigL2MuonSA::MuCalCircClient::m_port
private

Definition at line 37 of file MuCalCircClient.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
get_hdefs.buff
buff
Definition: get_hdefs.py:61
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
TrigL2MuonSA::MuCalCircClient::m_cid
int m_cid
Definition: MuCalCircClient.h:36
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigL2MuonSA::MuCalCircClient::m_bufferSize
unsigned int m_bufferSize
Definition: MuCalCircClient.h:39
TrigL2MuonSA::MuCalCircClient::m_bufferName
std::string m_bufferName
Definition: MuCalCircClient.h:38
TrigL2MuonSA::Circexception
Definition: MuCalCircClient.h:20
TrigL2MuonSA::MuCalCircClient::m_port
unsigned short m_port
Definition: MuCalCircClient.h:37