CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::streamer::InitMsgBuilder Class Reference

#include <InitMsgBuilder.h>

Public Member Functions

uint32 bufferSize () const
 
uint8dataAddress () const
 
uint32 headerSize () const
 
 InitMsgBuilder (void *msg_mem, uint32 size, uint32 run, const Version &v, const char *release_tag, const char *process_name, const char *output_module_label, uint32 output_module_id, const Strings &hlt_names, const Strings &hlt_selections, const Strings &l1_names, uint32 adler32_chksum)
 
uint32 run () const
 
void setDataLength (uint32 registry_length)
 
uint32 size () const
 
uint8startAddress () const
 

Private Attributes

uint8buf_
 
uint8data_addr_
 
uint32 size_
 

Detailed Description

Definition at line 9 of file InitMsgBuilder.h.

Constructor & Destructor Documentation

◆ InitMsgBuilder()

InitMsgBuilder::InitMsgBuilder ( void *  msg_mem,
uint32  size,
uint32  run,
const Version v,
const char *  release_tag,
const char *  process_name,
const char *  output_module_label,
uint32  output_module_id,
const Strings hlt_names,
const Strings hlt_selections,
const Strings l1_names,
uint32  adler32_chksum 
)

Definition at line 11 of file InitMsgBuilder.cc.

References cms::cuda::assert(), buf_, edm::streamer::EventMsgBuilder::computeHeaderSize(), edm::streamer::convert(), data_addr_, edm::streamer::MsgTools::fillNames(), h, run(), setDataLength(), and findQualityFiles::v.

23  : buf_((uint8*)buf), size_(size) {
25  // fixed length parts
26  new (&h->version_) Version(v);
27  convert(run, h->run_);
28  // variable length parts
29  uint32 tag_len = strlen(release_tag);
30  assert(tag_len < 0x00ff);
31  uint8* pos = buf_ + sizeof(InitHeader);
32 
33  *pos++ = tag_len; // length of release tag
34  memcpy(pos, release_tag, tag_len); // copy release tag in
35  pos += tag_len;
36 
37  //Lets put Process Name (Length and then Name) right after release_tag
38  uint32 process_name_len = strlen(process_name);
39  assert(process_name_len < 0x00ff);
40  //Put process_name_len
41  *pos++ = process_name_len;
42  //Put process_name
43  memcpy(pos, process_name, process_name_len);
44  pos += process_name_len;
45 
46  // output module label next
47  uint32 outmod_label_len = strlen(output_module_label);
48  assert(outmod_label_len < 0x00ff);
49  *pos++ = outmod_label_len;
50  memcpy(pos, output_module_label, outmod_label_len);
51  pos += outmod_label_len;
52 
53  // output module ID next
54  convert(output_module_id, pos);
55  pos += sizeof(char_uint32);
56 
57  pos = MsgTools::fillNames(hlt_names, pos);
58  pos = MsgTools::fillNames(hlt_selections, pos);
59  pos = MsgTools::fillNames(l1_names, pos);
60 
61  // adler32 check sum of data blob
62  convert(adler_chksum, pos);
63  pos = pos + sizeof(uint32);
64 
65  data_addr_ = pos + sizeof(char_uint32);
66  setDataLength(0);
67 
68  // Two news fileds added to InitMsg in Proto V3 init_header_size, and event_header_size.
69  //Set the size of Init Header Start of buf to Start of desc.
70  convert((uint32)(data_addr_ - buf_), h->init_header_size_);
71 
72  //Size of Event Header
73  uint32 eventHeaderSize = EventMsgBuilder::computeHeaderSize(l1_names.size(), hlt_names.size());
74  convert(eventHeaderSize, h->event_header_size_);
75 }
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:43
void setDataLength(uint32 registry_length)
uint8 * fillNames(const Strings &names, uint8 *pos)
Definition: MsgTools.h:68
assert(be >=bs)
unsigned char uint8
Definition: MsgTools.h:12
static uint32 computeHeaderSize(uint32 l1t_bit_count, uint32 hlt_bit_count)
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:17
unsigned int uint32
Definition: MsgTools.h:14
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Function Documentation

◆ bufferSize()

uint32 edm::streamer::InitMsgBuilder::bufferSize ( ) const
inline

Required by EOF Record Builder

Definition at line 30 of file InitMsgBuilder.h.

References size_.

30 { return size_; }

◆ dataAddress()

uint8* edm::streamer::InitMsgBuilder::dataAddress ( ) const
inline

Definition at line 26 of file InitMsgBuilder.h.

References data_addr_.

26 { return data_addr_; }

◆ headerSize()

uint32 edm::streamer::InitMsgBuilder::headerSize ( ) const
inline

Definition at line 27 of file InitMsgBuilder.h.

References buf_, and data_addr_.

◆ run()

uint32 InitMsgBuilder::run ( ) const

Definition at line 88 of file InitMsgBuilder.cc.

References buf_, edm::streamer::convert32(), and h.

Referenced by InitMsgBuilder().

88  {
90  return convert32(h->run_);
91 }
uint32 convert32(char_uint32 v)
Definition: MsgTools.h:29
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ setDataLength()

void InitMsgBuilder::setDataLength ( uint32  registry_length)

Definition at line 77 of file InitMsgBuilder.cc.

References buf_, edm::streamer::convert(), data_addr_, h, and edm::streamer::Header::INIT.

Referenced by InitMsgBuilder().

77  {
78  convert(len, data_addr_ - sizeof(char_uint32));
80  new (&h->header_) Header(Header::INIT, data_addr_ - buf_ + len);
81 }
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:43
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:17
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ size()

uint32 InitMsgBuilder::size ( void  ) const

◆ startAddress()

uint8* edm::streamer::InitMsgBuilder::startAddress ( ) const
inline

Member Data Documentation

◆ buf_

uint8* edm::streamer::InitMsgBuilder::buf_
private

Definition at line 33 of file InitMsgBuilder.h.

Referenced by headerSize(), InitMsgBuilder(), run(), setDataLength(), size(), and startAddress().

◆ data_addr_

uint8* edm::streamer::InitMsgBuilder::data_addr_
private

Definition at line 35 of file InitMsgBuilder.h.

Referenced by dataAddress(), headerSize(), InitMsgBuilder(), and setDataLength().

◆ size_

uint32 edm::streamer::InitMsgBuilder::size_
private

Definition at line 34 of file InitMsgBuilder.h.

Referenced by bufferSize().