Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
IOPool
Streamer
interface
OtherMessage.h
Go to the documentation of this file.
1
9
#ifndef IOPool_Streamer_OtherMessage_h
10
#define IOPool_Streamer_OtherMessage_h
11
12
#include "
IOPool/Streamer/interface/MsgTools.h
"
13
#include "
IOPool/Streamer/interface/MsgHeader.h
"
14
15
//------------------------------Builds the Message -------------------------
16
17
class
OtherMessageBuilder
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
:
35
uint8
*
buf_
;
36
Header
*
h_
;
37
};
38
39
// ----------------------- Looks at the Message ------------------------
40
41
class
OtherMessageView
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
:
63
uint8
*
buf_
;
64
uint8
*
msg_body_start_
;
65
Header
*
head_
;
66
};
67
68
#endif
69
OtherMessageView::code
uint32 code() const
Definition:
OtherMessage.h:54
Header
Definition:
MsgHeader.h:6
OtherMessageBuilder
Definition:
OtherMessage.h:17
OtherMessageView::size
uint32 size() const
Definition:
OtherMessage.h:55
OtherMessageView
Definition:
OtherMessage.h:41
OtherMessageView::startAddress
uint8 * startAddress()
Definition:
OtherMessage.h:57
OtherMessageView::msgBody
uint8 * msgBody() const
Definition:
OtherMessage.h:56
OtherMessageBuilder::OtherMessageBuilder
OtherMessageBuilder(void *buf, uint32 code, uint32 bodySize=0)
Definition:
OtherMessage.h:22
OtherMessageBuilder::startAddress
uint8 * startAddress()
Definition:
OtherMessage.h:32
OtherMessageBuilder::code
uint32 code() const
Definition:
OtherMessage.h:29
OtherMessageView::bodySize
uint32 bodySize() const
Definition:
OtherMessage.h:58
OtherMessageBuilder::buf_
uint8 * buf_
Definition:
OtherMessage.h:35
OtherMessageBuilder::h_
Header * h_
Definition:
OtherMessage.h:36
uint32
unsigned int uint32
Definition:
MsgTools.h:13
Header::code_
uint8 code_
Definition:
MsgHeader.h:11
MsgHeader.h
Header::size_
char_uint32 size_
Definition:
MsgHeader.h:12
OtherMessageView::buf_
uint8 * buf_
Definition:
OtherMessage.h:63
OtherMessageView::OtherMessageView
OtherMessageView(void *buf)
Definition:
OtherMessage.h:47
OtherMessageView::head_
Header * head_
Definition:
OtherMessage.h:65
convert32
uint32 convert32(char_uint32 v)
Definition:
MsgTools.h:30
uint8
unsigned char uint8
Definition:
MsgTools.h:11
OtherMessageView::msg_body_start_
uint8 * msg_body_start_
Definition:
OtherMessage.h:64
OtherMessageBuilder::size
uint32 size() const
Definition:
OtherMessage.h:30
MsgTools.h
OtherMessageBuilder::msgBody
uint8 * msgBody()
Definition:
OtherMessage.h:31
Generated for CMSSW Reference Manual by
1.8.5