CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
evf::SimpleMsgBuf Class Reference

#include <SimpleMsgBuf.h>

Inheritance diagram for evf::SimpleMsgBuf:
evf::MsgBuf

Public Member Functions

void addFedData (const unsigned char *fedRawData, unsigned int segmentSize)
 
void addFedSize (unsigned int fedSize)
 
void getEvt (unsigned int &) const
 
char * getFedDataEnd ()
 
char * getFedDataStart ()
 
char * getFedSizeStart ()
 
void getLumi (unsigned int &) const
 
void getRun (unsigned int &) const
 
void reset ()
 
void setRLE (unsigned int run, unsigned int lumi, unsigned int evt)
 
 SimpleMsgBuf ()
 
 SimpleMsgBuf (unsigned int size, unsigned int type)
 
 SimpleMsgBuf (const SimpleMsgBuf &b)
 
virtual ~SimpleMsgBuf ()
 
- Public Member Functions inherited from evf::MsgBuf
 MsgBuf ()
 
 MsgBuf (unsigned int size, unsigned int type)
 
 MsgBuf (const MsgBuf &b)
 
size_t msize ()
 
msgbuf * operator-> ()
 
MsgBufoperator= (const MsgBuf &)
 
virtual ~MsgBuf ()
 

Private Member Functions

void setBufferPointers ()
 

Private Attributes

char * pEvt_
 
char * pFedRawData_
 
char * pFedSizes_
 
char * pLumi_
 
char * pRun_
 
char * pVarData_
 
char * pVarSize_
 
size_t usedSize_
 

Friends

class MasterQueue
 

Additional Inherited Members

- Protected Attributes inherited from evf::MsgBuf
unsigned char * buf_
 
size_t msize_
 
struct msgbuf * ptr_
 

Detailed Description

Definition at line 23 of file SimpleMsgBuf.h.

Constructor & Destructor Documentation

SimpleMsgBuf::SimpleMsgBuf ( )

Definition at line 7 of file SimpleMsgBuf.cc.

References setBufferPointers().

7  :
8  MsgBuf(), usedSize_(0) {
10 }
void setBufferPointers()
Definition: SimpleMsgBuf.cc:71
MsgBuf()
Definition: MsgBuf.cc:5
SimpleMsgBuf::SimpleMsgBuf ( unsigned int  size,
unsigned int  type 
)

Definition at line 12 of file SimpleMsgBuf.cc.

References setBufferPointers().

12  :
13  MsgBuf(size, type), usedSize_(0) {
15 }
type
Definition: HCALResponse.h:22
void setBufferPointers()
Definition: SimpleMsgBuf.cc:71
MsgBuf()
Definition: MsgBuf.cc:5
tuple size
Write out results.
evf::SimpleMsgBuf::SimpleMsgBuf ( const SimpleMsgBuf b)
SimpleMsgBuf::~SimpleMsgBuf ( )
virtual

Definition at line 17 of file SimpleMsgBuf.cc.

17  {
18 
19 }

Member Function Documentation

void SimpleMsgBuf::addFedData ( const unsigned char *  fedRawData,
unsigned int  segmentSize 
)

Definition at line 37 of file SimpleMsgBuf.cc.

References pVarData_, and usedSize_.

38  {
39  memcpy(pVarData_, fedRawData, segmentSize);
40  pVarData_ += segmentSize;
41 
42  // increase used size by current fed data
43  usedSize_ += segmentSize;
44 
45 }
void SimpleMsgBuf::addFedSize ( unsigned int  fedSize)

Definition at line 32 of file SimpleMsgBuf.cc.

References pVarSize_.

32  {
33  memcpy(pVarSize_, &fedSize, sizeof(unsigned int));
34  pVarSize_ += sizeof(unsigned int);
35 }
void SimpleMsgBuf::getEvt ( unsigned int &  evt) const

Definition at line 55 of file SimpleMsgBuf.cc.

References pEvt_.

55  {
56  memcpy(&evt, pEvt_, sizeof(unsigned int));
57 }
char * SimpleMsgBuf::getFedDataEnd ( )

Definition at line 67 of file SimpleMsgBuf.cc.

References pVarData_.

67  {
68  return pVarData_;
69 }
char * SimpleMsgBuf::getFedDataStart ( )

Definition at line 63 of file SimpleMsgBuf.cc.

References pFedRawData_.

63  {
64  return pFedRawData_;
65 }
char * SimpleMsgBuf::getFedSizeStart ( )

Definition at line 59 of file SimpleMsgBuf.cc.

References pFedSizes_.

59  {
60  return pFedSizes_;
61 }
void SimpleMsgBuf::getLumi ( unsigned int &  lumi) const

Definition at line 51 of file SimpleMsgBuf.cc.

References pLumi_.

51  {
52  memcpy(&lumi, pLumi_, sizeof(unsigned int));
53 }
tuple lumi
Definition: fjr2json.py:35
void SimpleMsgBuf::getRun ( unsigned int &  run) const

Definition at line 47 of file SimpleMsgBuf.cc.

References pRun_.

47  {
48  memcpy(&run, pRun_, sizeof(unsigned int));
49 }
void evf::SimpleMsgBuf::reset ( void  )
inline

Definition at line 45 of file SimpleMsgBuf.h.

References setBufferPointers().

45 { setBufferPointers(); }
void setBufferPointers()
Definition: SimpleMsgBuf.cc:71
void SimpleMsgBuf::setBufferPointers ( )
private

Definition at line 71 of file SimpleMsgBuf.cc.

References N_FEDS, pEvt_, pFedRawData_, pFedSizes_, pLumi_, pRun_, evf::MsgBuf::ptr_, pVarData_, pVarSize_, and usedSize_.

Referenced by reset(), and SimpleMsgBuf().

71  {
72  pRun_ = ptr_->mtext;
73  pLumi_ = pRun_ + sizeof(unsigned int);
74  pEvt_ = pLumi_ + sizeof(unsigned int);
75  pFedSizes_ = pEvt_ + sizeof(unsigned int);
76  pFedRawData_ = pFedSizes_ + N_FEDS * sizeof(unsigned int);
77 
78  // used size is size of header (run, lumi, evt, N_FEDS * sizeof(unsigned int))
79  // increases as raw data is added
80  usedSize_ = pFedRawData_ - pRun_;
81 
84 }
struct msgbuf * ptr_
Definition: MsgBuf.h:24
#define N_FEDS
Definition: SimpleMsgBuf.h:21
void SimpleMsgBuf::setRLE ( unsigned int  run,
unsigned int  lumi,
unsigned int  evt 
)

Definition at line 23 of file SimpleMsgBuf.cc.

References pEvt_, pLumi_, and pRun_.

23  {
24  // copy run number
25  memcpy(pRun_, &run, sizeof(unsigned int));
26  // copy lumi number
27  memcpy(pLumi_, &lumi, sizeof(unsigned int));
28  // copy event number
29  memcpy(pEvt_, &evt, sizeof(unsigned int));
30 }
tuple lumi
Definition: fjr2json.py:35

Friends And Related Function Documentation

friend class MasterQueue
friend

Definition at line 52 of file SimpleMsgBuf.h.

Member Data Documentation

char* evf::SimpleMsgBuf::pEvt_
private

Definition at line 59 of file SimpleMsgBuf.h.

Referenced by getEvt(), setBufferPointers(), and setRLE().

char* evf::SimpleMsgBuf::pFedRawData_
private

Definition at line 61 of file SimpleMsgBuf.h.

Referenced by getFedDataStart(), and setBufferPointers().

char* evf::SimpleMsgBuf::pFedSizes_
private

Definition at line 60 of file SimpleMsgBuf.h.

Referenced by getFedSizeStart(), and setBufferPointers().

char* evf::SimpleMsgBuf::pLumi_
private

Definition at line 58 of file SimpleMsgBuf.h.

Referenced by getLumi(), setBufferPointers(), and setRLE().

char* evf::SimpleMsgBuf::pRun_
private

Definition at line 57 of file SimpleMsgBuf.h.

Referenced by getRun(), setBufferPointers(), and setRLE().

char* evf::SimpleMsgBuf::pVarData_
private

Definition at line 65 of file SimpleMsgBuf.h.

Referenced by addFedData(), getFedDataEnd(), and setBufferPointers().

char* evf::SimpleMsgBuf::pVarSize_
private

Definition at line 64 of file SimpleMsgBuf.h.

Referenced by addFedSize(), and setBufferPointers().

size_t evf::SimpleMsgBuf::usedSize_
private

Definition at line 51 of file SimpleMsgBuf.h.

Referenced by addFedData(), and setBufferPointers().