CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MsgBuf.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 namespace evf {
6  msize_(MAX_MSG_SIZE) {
7 
8  buf_ = new unsigned char[msize_ + sizeof(long int)];
9  ptr_ = (msgbuf*) buf_;
10  ptr_->mtype = MSQM_MESSAGE_TYPE_NOP;
11 }
12 
13 MsgBuf::MsgBuf(unsigned int size, unsigned int type) :
14  msize_(size) {
15  buf_ = new unsigned char[msize_ + sizeof(long int)];
16  ptr_ = (msgbuf*) buf_;
17  ptr_->mtype = type;
18 }
19 
21  msize_(b.msize_) {
22  buf_ = new unsigned char[msize_ + sizeof(long int)];
23  ptr_ = (msgbuf*) buf_;
24  memcpy(buf_, b.buf_, msize_);
25 }
27  msize_ = b.msize_;
28  buf_ = new unsigned char[msize_ + sizeof(long int)];
29  ptr_ = (msgbuf*) buf_;
30  memcpy(buf_, b.buf_, msize_ + sizeof(long int));
31  return *this;
32 }
33 size_t MsgBuf::msize() {
34  return msize_;
35 }
37  delete[] buf_;
38 }
39 msgbuf* MsgBuf::operator->() {
40  return ptr_;
41 }
42 }
size_t msize_
Definition: MsgBuf.h:22
type
Definition: HCALResponse.h:22
size_t msize()
Definition: MsgBuf.cc:33
struct msgbuf * ptr_
Definition: MsgBuf.h:24
MsgBuf & operator=(const MsgBuf &)
Definition: MsgBuf.cc:26
#define MAX_MSG_SIZE
Definition: queue_defs.h:10
#define MSQM_MESSAGE_TYPE_NOP
Definition: queue_defs.h:15
MsgBuf()
Definition: MsgBuf.cc:5
unsigned char * buf_
Definition: MsgBuf.h:23
double b
Definition: hdecay.h:120
msgbuf * operator->()
Definition: MsgBuf.cc:39
tuple size
Write out results.
virtual ~MsgBuf()
Definition: MsgBuf.cc:36