CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EOFRecordBuilder Class Reference

#include <EOFRecordBuilder.h>

Public Member Functions

 EOFRecordBuilder (uint32 run, uint32 events, uint32 statusCode, const std::vector< uint32 > &hltStats, uint64 first_event_offset, uint64 last_event_offset)
 
uint8recAddress () const
 
uint32 size () const
 

Private Attributes

std::vector< uint8buf_
 

Detailed Description

Definition at line 10 of file EOFRecordBuilder.h.

Constructor & Destructor Documentation

EOFRecordBuilder::EOFRecordBuilder ( uint32  run,
uint32  events,
uint32  statusCode,
const std::vector< uint32 > &  hltStats,
uint64  first_event_offset,
uint64  last_event_offset 
)

Bring the Pos at enof of Message

pos - &buf_ gives legth of message

Code is 4 for EOF

Definition at line 8 of file EOFRecordBuilder.cc.

References buf_, convert(), Header::EOFRECORD, EOFRecordHeader::events_, h, EOFRecordHeader::header_, i, pos, EOFRecordHeader::run_, EOFRecordHeader::status_code_, and v.

13 {
14  uint32 buf_size = 1 + ((sizeof(uint32)) * 8)+ ((sizeof(uint32)) * hltStats.size());
15  buf_.resize(buf_size);
16 
17  uint8* pos = (uint8*)&buf_[0];
19  convert(run,h->run_);
20  convert(statusCode,h->status_code_);
22  pos += sizeof(EOFRecordHeader);
23 
24  for(unsigned int i = 0; i < hltStats.size(); ++i) {
25  char_uint32 v;
26  convert(hltStats.at(i), v);
27  memcpy(pos, v, sizeof(char_uint32));
28  pos += sizeof(char_uint32);
29  }
30 
31  char_uint64 v;
32  convert(first_event_offset, v);
33  memcpy(pos, v, sizeof(char_uint64));
34  pos += sizeof(char_uint64);
35 
36  convert(last_event_offset, v);
37  memcpy(pos, v, sizeof(char_uint64));
38  pos += sizeof(char_uint64);
40  uint32 calculatedSize = (uint8*)pos - (uint8*)&buf_[0];
41  assert(calculatedSize == buf_.size());
43  new (&h->header_) Header(Header::EOFRECORD, calculatedSize);
44 }
int i
Definition: DBlmapReader.cc:9
char_uint32 status_code_
Definition: EOFRecord.h:21
char_uint32 events_
Definition: EOFRecord.h:22
char_uint32 run_
Definition: EOFRecord.h:20
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
unsigned int uint32
Definition: MsgTools.h:13
unsigned char char_uint32[sizeof(uint32)]
Definition: MsgTools.h:16
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
unsigned char char_uint64[sizeof(uint64)]
Definition: MsgTools.h:15
unsigned char uint8
Definition: MsgTools.h:11
tuple events
Definition: patZpeak.py:19
std::vector< uint8 > buf_
Header header_
Definition: EOFRecord.h:19
mathSSE::Vec4< T > v

Member Function Documentation

uint8* EOFRecordBuilder::recAddress ( ) const
inline

Definition at line 20 of file EOFRecordBuilder.h.

References buf_.

20 { return (uint8*) &buf_[0]; }
unsigned char uint8
Definition: MsgTools.h:11
std::vector< uint8 > buf_
uint32 EOFRecordBuilder::size ( void  ) const
inline

Definition at line 21 of file EOFRecordBuilder.h.

References buf_.

21 {return (uint32) buf_.size(); }
unsigned int uint32
Definition: MsgTools.h:13
std::vector< uint8 > buf_

Member Data Documentation

std::vector<uint8> EOFRecordBuilder::buf_
private

Definition at line 24 of file EOFRecordBuilder.h.

Referenced by EOFRecordBuilder(), recAddress(), and size().