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 Member Functions | Private Attributes
StreamDQMOutputFile Class Reference

#include <StreamDQMOutputFile.h>

Public Member Functions

 StreamDQMOutputFile (const std::string &name)
 
uint64 write (const DQMEventMsgView &)
 
uint64 write (const DQMEventMsgBuilder &)
 
 ~StreamDQMOutputFile ()
 

Private Member Functions

void writeDQMEventHeader (const DQMEventMsgView &inview)
 
void writeDQMEventHeader (const DQMEventMsgBuilder &inview)
 

Private Attributes

boost::shared_ptr< OutputFiledqmstreamfile_
 

Detailed Description

StreamDQMOutputFile: Class for doing Streamer Write operations Class for doing Streamer Write operations

Definition at line 19 of file StreamDQMOutputFile.h.

Constructor & Destructor Documentation

StreamDQMOutputFile::StreamDQMOutputFile ( const std::string &  name)
explicit

Definition at line 7 of file StreamDQMOutputFile.cc.

StreamDQMOutputFile::~StreamDQMOutputFile ( )

CTOR, takes file path name as argument

Definition at line 3 of file StreamDQMOutputFile.cc.

4  {
5  }

Member Function Documentation

uint64 StreamDQMOutputFile::write ( const DQMEventMsgView ineview)

Performs write on InitMsgBuilder type, Header + Blob, both are written out.

Offset where current event starts

Offset of last written event

Definition at line 29 of file StreamDQMOutputFile.cc.

References dqmstreamfile_, DQMEventMsgView::eventAddress(), DQMEventMsgView::headerSize(), DQMEventMsgView::size(), and writeDQMEventHeader().

30  {
32  uint64 offset_to_return = dqmstreamfile_->current_offset();
33 
35  dqmstreamfile_->set_last_event_offset(dqmstreamfile_->current_offset());
36 
37  writeDQMEventHeader(ineview);
38  dqmstreamfile_->write((const char*) ineview.eventAddress(),
39  ineview.size() - ineview.headerSize());
40 
41  dqmstreamfile_->inc_events();
42 
43  return offset_to_return;
44  }
uint8 * eventAddress() const
void writeDQMEventHeader(const DQMEventMsgView &inview)
boost::shared_ptr< OutputFile > dqmstreamfile_
uint32 headerSize() const
unsigned long long uint64
Definition: MsgTools.h:14
uint32 size() const
uint64 StreamDQMOutputFile::write ( const DQMEventMsgBuilder inmsg)

Offset where current event starts

Offset of last written event

Definition at line 12 of file StreamDQMOutputFile.cc.

References dqmstreamfile_, DQMEventMsgBuilder::eventAddress(), DQMEventMsgBuilder::headerSize(), DQMEventMsgBuilder::size(), and writeDQMEventHeader().

13  {
15  uint64 offset_to_return = dqmstreamfile_->current_offset();
16 
18  dqmstreamfile_->set_last_event_offset(dqmstreamfile_->current_offset());
19 
20  writeDQMEventHeader(inmsg);
21  dqmstreamfile_->write((const char*) inmsg.eventAddress(),
22  inmsg.size() - inmsg.headerSize());
23 
24  dqmstreamfile_->inc_events();
25 
26  return offset_to_return;
27  }
void writeDQMEventHeader(const DQMEventMsgView &inview)
boost::shared_ptr< OutputFile > dqmstreamfile_
uint8 * eventAddress() const
unsigned long long uint64
Definition: MsgTools.h:14
uint32 headerSize() const
void StreamDQMOutputFile::writeDQMEventHeader ( const DQMEventMsgView inview)
private

Definition at line 53 of file StreamDQMOutputFile.cc.

References dqmstreamfile_, DQMEventMsgView::headerSize(), and DQMEventMsgView::startAddress().

Referenced by write().

54  {
55  dqmstreamfile_->write((const char*)
56  ineview.startAddress(),
57  ineview.headerSize()) ;
58  }
boost::shared_ptr< OutputFile > dqmstreamfile_
void StreamDQMOutputFile::writeDQMEventHeader ( const DQMEventMsgBuilder inview)
private

Definition at line 46 of file StreamDQMOutputFile.cc.

References dqmstreamfile_, DQMEventMsgBuilder::headerSize(), and DQMEventMsgBuilder::startAddress().

47  {
48  dqmstreamfile_->write((const char*)
49  inmsg.startAddress(),
50  inmsg.headerSize()) ;
51  }
boost::shared_ptr< OutputFile > dqmstreamfile_

Member Data Documentation

boost::shared_ptr<OutputFile> StreamDQMOutputFile::dqmstreamfile_
private

Definition at line 46 of file StreamDQMOutputFile.h.

Referenced by write(), and writeDQMEventHeader().