Belle II Software development
SendTrailer Class Reference

Public Types

enum  { SENDTRL_NWORDS = 2 }
 
enum  {
  POS_CHKSUM = 0 ,
  POS_TERM_WORD = 1
}
 
enum  { MAGIC_WORD_SEND_TRAILER = 0x7fff0007 }
 

Public Member Functions

 SendTrailer ()
 Default constructor.
 
 SendTrailer (int *)
 Constructor using existing pointer to raw data buffer.
 
 ~SendTrailer ()
 Destructor.
 
int * GetBuffer ()
 
void SetBuffer (int *bufin)
 return buffer
 
void Initialize ()
 set buffer
 
void SetChksum (int chksum)
 initialize header
 
void SetMagicWord ()
 initialize header
 
int GetTrlNwords ()
 
int GetMagicWord ()
 

Private Attributes

int m_buffer [SENDTRL_NWORDS]
 

Detailed Description

Definition at line 20 of file SendTrailer.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 45 of file SendTrailer.h.

45 {
46 SENDTRL_NWORDS = 2
47 };

◆ anonymous enum

anonymous enum

Definition at line 49 of file SendTrailer.h.

49 {
50 POS_CHKSUM = 0,
51 POS_TERM_WORD = 1
52 };

◆ anonymous enum

anonymous enum

Definition at line 54 of file SendTrailer.h.

54 {
55 MAGIC_WORD_SEND_TRAILER = 0x7fff0007
56 };

Constructor & Destructor Documentation

◆ SendTrailer() [1/2]

Default constructor.

Definition at line 18 of file SendTrailer.cc.

19{
20 Initialize();
21 // cout << "SendTrailer NULL constructor" << endl;
22}
void Initialize()
set buffer
Definition: SendTrailer.cc:43

◆ SendTrailer() [2/2]

SendTrailer ( int *  buffer)

Constructor using existing pointer to raw data buffer.

Definition at line 24 of file SendTrailer.cc.

25{
26 memcpy(m_buffer, buffer, SENDTRL_NWORDS * sizeof(int));
27}

◆ ~SendTrailer()

Destructor.

Definition at line 29 of file SendTrailer.cc.

30{
31}

Member Function Documentation

◆ GetBuffer()

int * GetBuffer ( )

Definition at line 33 of file SendTrailer.cc.

34{
35 return m_buffer;
36}

◆ GetMagicWord()

int GetMagicWord ( )

Definition at line 60 of file SendTrailer.cc.

61{
62 return m_buffer[ POS_TERM_WORD ];
63}

◆ GetTrlNwords()

int GetTrlNwords ( )

Definition at line 65 of file SendTrailer.cc.

66{
67 return SENDTRL_NWORDS;
68}

◆ Initialize()

void Initialize ( )

set buffer

Definition at line 43 of file SendTrailer.cc.

44{
45 memset(m_buffer, 0, SENDTRL_NWORDS * sizeof(int));
47}
void SetMagicWord()
initialize header
Definition: SendTrailer.cc:55

◆ SetBuffer()

void SetBuffer ( int *  bufin)

return buffer

Definition at line 38 of file SendTrailer.cc.

39{
40 memcpy(m_buffer, bufin, SENDTRL_NWORDS * sizeof(int));
41}

◆ SetChksum()

void SetChksum ( int  chksum)

initialize header

Definition at line 50 of file SendTrailer.cc.

51{
52 m_buffer[ POS_CHKSUM ] = chksum;
53}

◆ SetMagicWord()

void SetMagicWord ( )

initialize header

Definition at line 55 of file SendTrailer.cc.

56{
57 m_buffer[ POS_TERM_WORD ] = MAGIC_WORD_SEND_TRAILER;
58}

Member Data Documentation

◆ m_buffer

int m_buffer[SENDTRL_NWORDS]
private

Definition at line 60 of file SendTrailer.h.


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