Belle II Software  release-08-01-10
SendTrailer.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include "daq/dataobjects/SendTrailer.h"
10 
11 #include <cstring>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 //ClassImp(SendTrailer);
17 
18 SendTrailer::SendTrailer()
19 {
20  Initialize();
21  // cout << "SendTrailer NULL constructor" << endl;
22 }
23 
24 SendTrailer::SendTrailer(int* buffer)
25 {
26  memcpy(m_buffer, buffer, SENDTRL_NWORDS * sizeof(int));
27 }
28 
29 SendTrailer::~SendTrailer()
30 {
31 }
32 
33 int* SendTrailer::GetBuffer()
34 {
35  return m_buffer;
36 }
37 
38 void SendTrailer::SetBuffer(int* bufin)
39 {
40  memcpy(m_buffer, bufin, SENDTRL_NWORDS * sizeof(int));
41 }
42 
43 void SendTrailer::Initialize()
44 {
45  memset(m_buffer, 0, SENDTRL_NWORDS * sizeof(int));
46  SetMagicWord();
47 }
48 
49 
50 void SendTrailer::SetChksum(int chksum)
51 {
52  m_buffer[ POS_CHKSUM ] = chksum;
53 }
54 
55 void SendTrailer::SetMagicWord()
56 {
57  m_buffer[ POS_TERM_WORD ] = MAGIC_WORD_SEND_TRAILER;
58 }
59 
60 int SendTrailer::GetMagicWord()
61 {
62  return m_buffer[ POS_TERM_WORD ];
63 }
64 
65 int SendTrailer::GetTrlNwords()
66 {
67  return SENDTRL_NWORDS;
68 }
Abstract base class for different kinds of events.