CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

evf::SimpleMsgBuf Class Reference

#include <SimpleMsgBuf.h>

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

List of all members.

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 (unsigned int size, unsigned int type)
 SimpleMsgBuf ()
 SimpleMsgBuf (const SimpleMsgBuf &b)
virtual ~SimpleMsgBuf ()

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

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().

SimpleMsgBuf::SimpleMsgBuf ( unsigned int  size,
unsigned int  type 
)

Definition at line 12 of file SimpleMsgBuf.cc.

References setBufferPointers().

evf::SimpleMsgBuf::SimpleMsgBuf ( const SimpleMsgBuf b)
SimpleMsgBuf::~SimpleMsgBuf ( ) [virtual]

Definition at line 17 of file SimpleMsgBuf.cc.

                            {

}

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_.

                                          {
        memcpy(pVarData_, fedRawData, segmentSize);
        pVarData_ += segmentSize;

        // increase used size by current fed data
        usedSize_ += segmentSize;

}
void SimpleMsgBuf::addFedSize ( unsigned int  fedSize)

Definition at line 32 of file SimpleMsgBuf.cc.

References pVarSize_.

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

Definition at line 55 of file SimpleMsgBuf.cc.

References pEvt_.

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

Definition at line 67 of file SimpleMsgBuf.cc.

References pVarData_.

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

Definition at line 63 of file SimpleMsgBuf.cc.

References pFedRawData_.

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

Definition at line 59 of file SimpleMsgBuf.cc.

References pFedSizes_.

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

Definition at line 51 of file SimpleMsgBuf.cc.

References pLumi_.

                                                   {
        memcpy(&lumi, pLumi_, sizeof(unsigned int));
}
void SimpleMsgBuf::getRun ( unsigned int &  run) const

Definition at line 47 of file SimpleMsgBuf.cc.

References pRun_.

                                                 {
        memcpy(&run, pRun_, sizeof(unsigned int));
}
void evf::SimpleMsgBuf::reset ( void  ) [inline]

Definition at line 45 of file SimpleMsgBuf.h.

References setBufferPointers().

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().

                                     {
        pRun_ = ptr_->mtext;
        pLumi_ = pRun_ + sizeof(unsigned int);
        pEvt_ = pLumi_ + sizeof(unsigned int);
        pFedSizes_ = pEvt_ + sizeof(unsigned int);
        pFedRawData_ = pFedSizes_ + N_FEDS * sizeof(unsigned int);

        // used size is size of header (run, lumi, evt, N_FEDS * sizeof(unsigned int))
        // increases as raw data is added
        usedSize_ = pFedRawData_ - pRun_;

        pVarSize_ = pFedSizes_;
        pVarData_ = pFedRawData_;
}
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_.

                                                                               {
        // copy run number
        memcpy(pRun_, &run, sizeof(unsigned int));
        // copy lumi number
        memcpy(pLumi_, &lumi, sizeof(unsigned int));
        // copy event number
        memcpy(pEvt_, &evt, sizeof(unsigned int));
}

Friends And Related Function Documentation

friend class MasterQueue [friend]

Reimplemented from evf::MsgBuf.

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().

Definition at line 61 of file SimpleMsgBuf.h.

Referenced by getFedDataStart(), and setBufferPointers().

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().

Definition at line 65 of file SimpleMsgBuf.h.

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

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().