CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Friends

evf::MsgBuf Class Reference

#include <MsgBuf.h>

Inheritance diagram for evf::MsgBuf:
evf::DQMMsgBuf evf::RawMsgBuf evf::RecoMsgBuf evf::SimpleMsgBuf

List of all members.

Public Member Functions

 MsgBuf ()
 MsgBuf (unsigned int size, unsigned int type)
 MsgBuf (const MsgBuf &b)
size_t msize ()
msgbuf * operator-> ()
MsgBufoperator= (const MsgBuf &)
virtual ~MsgBuf ()

Protected Attributes

unsigned char * buf_
size_t msize_
struct msgbuf * ptr_

Friends

class MasterQueue
class SlaveQueue

Detailed Description

Definition at line 9 of file MsgBuf.h.


Constructor & Destructor Documentation

evf::MsgBuf::MsgBuf ( )

Definition at line 5 of file MsgBuf.cc.

References buf_, msize_, MSQM_MESSAGE_TYPE_NOP, and ptr_.

               :
        msize_(MAX_MSG_SIZE) {

        buf_ = new unsigned char[msize_ + sizeof(long int)];
        ptr_ = (msgbuf*) buf_;
        ptr_->mtype = MSQM_MESSAGE_TYPE_NOP;
}
evf::MsgBuf::MsgBuf ( unsigned int  size,
unsigned int  type 
)

Definition at line 13 of file MsgBuf.cc.

References buf_, msize_, and ptr_.

                                                   :
        msize_(size) {
        buf_ = new unsigned char[msize_ + sizeof(long int)];
        ptr_ = (msgbuf*) buf_;
        ptr_->mtype = type;
}
evf::MsgBuf::MsgBuf ( const MsgBuf b)

Definition at line 20 of file MsgBuf.cc.

References buf_, msize_, and ptr_.

                              :
        msize_(b.msize_) {
        buf_ = new unsigned char[msize_ + sizeof(long int)];
        ptr_ = (msgbuf*) buf_;
        memcpy(buf_, b.buf_, msize_);
}
evf::MsgBuf::~MsgBuf ( ) [virtual]

Definition at line 36 of file MsgBuf.cc.

References buf_.

                {
        delete[] buf_;
}

Member Function Documentation

size_t evf::MsgBuf::msize ( )
msgbuf * evf::MsgBuf::operator-> ( )

Definition at line 39 of file MsgBuf.cc.

References ptr_.

                           {
        return ptr_;
}
MsgBuf & evf::MsgBuf::operator= ( const MsgBuf b)

Definition at line 26 of file MsgBuf.cc.

References buf_, msize_, and ptr_.

                                          {
        msize_ = b.msize_;
        buf_ = new unsigned char[msize_ + sizeof(long int)];
        ptr_ = (msgbuf*) buf_;
        memcpy(buf_, b.buf_, msize_ + sizeof(long int));
        return *this;
}

Friends And Related Function Documentation

friend class MasterQueue [friend]

Reimplemented in evf::DQMMsgBuf, evf::RawMsgBuf, evf::RecoMsgBuf, and evf::SimpleMsgBuf.

Definition at line 25 of file MsgBuf.h.

friend class SlaveQueue [friend]

Definition at line 26 of file MsgBuf.h.


Member Data Documentation

unsigned char* evf::MsgBuf::buf_ [protected]

Definition at line 23 of file MsgBuf.h.

Referenced by MsgBuf(), operator=(), and ~MsgBuf().

size_t evf::MsgBuf::msize_ [protected]

Definition at line 22 of file MsgBuf.h.

Referenced by MsgBuf(), msize(), and operator=().

struct msgbuf* evf::MsgBuf::ptr_ [protected]