CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

evf::MsgBuf Class Reference

#include <MsgBuf.h>

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

Private Attributes

unsigned char * buf_
size_t msize_
struct msgbuf * ptr_

Friends

class MasterQueue
class SlaveQueue

Detailed Description

Definition at line 10 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 35 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]

Definition at line 23 of file MsgBuf.h.

friend class SlaveQueue [friend]

Definition at line 24 of file MsgBuf.h.


Member Data Documentation

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

Definition at line 21 of file MsgBuf.h.

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

size_t evf::MsgBuf::msize_ [private]

Definition at line 20 of file MsgBuf.h.

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

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