CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OtherMessage.h
Go to the documentation of this file.
1 
9 #ifndef IOPool_Streamer_OtherMessage_h
10 #define IOPool_Streamer_OtherMessage_h
11 
14 
15 //------------------------------Builds the Message -------------------------
16 
18 {
19 public:
20 
21  //Constructor to Create OtherMessage
22  OtherMessageBuilder(void* buf, uint32 code, uint32 bodySize=0):
23  buf_((uint8*)buf),
24  h_((Header*)buf)
25  {
26  new (h_) Header (code, (unsigned int)sizeof(Header)+bodySize);
27  }
28 
29  uint32 code() const { return h_->code_; }
30  uint32 size() const { return convert32(h_->size_); }
31  uint8* msgBody() { return buf_+sizeof(Header); }
32  uint8* startAddress() { return buf_; }
33 
34 private:
37 };
38 
39 // ----------------------- Looks at the Message ------------------------
40 
42 {
43 public:
44 
45 
46  //Constructor to View OtherMessage
47  OtherMessageView(void* buf):
48  buf_((uint8*)buf),
49  head_((Header*)buf)
50  {
51  msg_body_start_ = buf_ + sizeof(Header);
52  }
53 
54  uint32 code() const { return head_->code_; }
55  uint32 size() const { return convert32(head_->size_); }
56  uint8* msgBody() const {return msg_body_start_; }
57  uint8* startAddress() { return buf_; }
58  uint32 bodySize() const {
59  return convert32(head_->size_) - (msg_body_start_ - buf_);
60  }
61 
62 private:
66 };
67 
68 #endif
69 
uint32 code() const
Definition: OtherMessage.h:54
uint32 size() const
Definition: OtherMessage.h:55
uint8 * startAddress()
Definition: OtherMessage.h:57
uint8 * msgBody() const
Definition: OtherMessage.h:56
OtherMessageBuilder(void *buf, uint32 code, uint32 bodySize=0)
Definition: OtherMessage.h:22
uint8 * startAddress()
Definition: OtherMessage.h:32
uint32 code() const
Definition: OtherMessage.h:29
uint32 bodySize() const
Definition: OtherMessage.h:58
unsigned int uint32
Definition: MsgTools.h:13
uint8 code_
Definition: MsgHeader.h:11
char_uint32 size_
Definition: MsgHeader.h:12
OtherMessageView(void *buf)
Definition: OtherMessage.h:47
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:30
unsigned char uint8
Definition: MsgTools.h:11
uint8 * msg_body_start_
Definition: OtherMessage.h:64
uint32 size() const
Definition: OtherMessage.h:30