CMS 3D CMS Logo

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

#include <StreamerOutputFile.h>

Public Member Functions

uint32 adler32 () const
 
void close ()
 
 StreamerOutputFile (const std::string &name, uint32 padding=0)
 
void write (const InitMsgBuilder &)
 
void write (const InitMsgView &)
 
uint64 write (const EventMsgBuilder &)
 
uint64 write (const EventMsgView &)
 
uint64 writeEventFragment (uint32 fragIndex, uint32 fragCount, const char *dataPtr, uint32 dataSize)
 
void writeInitFragment (uint32 fragIndex, uint32 fragCount, const char *dataPtr, uint32 dataSize)
 
 ~StreamerOutputFile ()
 

Private Member Functions

void writeEventHeader (const EventMsgView &ineview)
 
void writeStart (const InitMsgView &inview)
 

Private Attributes

edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_
 

Detailed Description

Class for doing Streamer Write operations

Definition at line 24 of file StreamerOutputFile.h.

Constructor & Destructor Documentation

◆ StreamerOutputFile()

edm::streamer::StreamerOutputFile::StreamerOutputFile ( const std::string &  name,
uint32  padding = 0 
)
explicit

Definition at line 7 of file StreamerOutputFile.cc.

References streamerfile_.

8  : streamerfile_(std::make_shared<edm::streamer::OutputFile>(name, padding)) {
9  streamerfile_->set_do_adler(true);
10  }
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ ~StreamerOutputFile()

edm::streamer::StreamerOutputFile::~StreamerOutputFile ( )

CTOR, takes file path name as argument

Definition at line 5 of file StreamerOutputFile.cc.

5 {}

Member Function Documentation

◆ adler32()

uint32 edm::streamer::StreamerOutputFile::adler32 ( ) const
inline

Definition at line 56 of file StreamerOutputFile.h.

References streamerfile_.

Referenced by evf::GlobalEvFOutputModule::globalBeginRun().

56 { return streamerfile_->adler32(); }
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ close()

void edm::streamer::StreamerOutputFile::close ( void  )
inline

Definition at line 58 of file StreamerOutputFile.h.

References streamerfile_.

Referenced by evf::GlobalEvFOutputModule::globalBeginRun(), esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().

58 { streamerfile_->close(); }
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ write() [1/4]

void edm::streamer::StreamerOutputFile::write ( const InitMsgBuilder inview)

Definition at line 56 of file StreamerOutputFile.cc.

References edm::streamer::InitMsgBuilder::startAddress().

Referenced by evf::GlobalEvFOutputModule::globalBeginRun(), and write().

56  {
57  InitMsgView tmpView(inview.startAddress());
58  return write(tmpView);
59  }
void write(const InitMsgBuilder &)

◆ write() [2/4]

void edm::streamer::StreamerOutputFile::write ( const InitMsgView inview)

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

Definition at line 61 of file StreamerOutputFile.cc.

References edm::streamer::InitMsgView::descData(), Exception, edm::streamer::InitMsgView::headerSize(), runTheMatrix::ret, edm::streamer::InitMsgView::size(), streamerfile_, and writeStart().

61  {
62  writeStart(inview);
63  bool ret = streamerfile_->write((const char*)inview.descData(), inview.size() - inview.headerSize(), true);
64  if (ret) {
65  throw cms::Exception("OutputFile", "write(InitMsgView)")
66  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
67  << "is full?" << std::endl;
68  }
69  }
ret
prodAgent to be discontinued
void writeStart(const InitMsgView &inview)
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ write() [3/4]

uint64 edm::streamer::StreamerOutputFile::write ( const EventMsgBuilder ineview)

Definition at line 12 of file StreamerOutputFile.cc.

References edm::streamer::EventMsgBuilder::startAddress(), and write().

12  {
13  EventMsgView tmpView(ineview.startAddress());
14  return write(tmpView);
15  }
void write(const InitMsgBuilder &)

◆ write() [4/4]

uint64 edm::streamer::StreamerOutputFile::write ( const EventMsgView ineview)

Performs write on EventMsgBuilder type, Header + Blob, both are written out. RETURNS the Offset in Stream while at which EventForOutputwas written.

Offset where current event starts

Definition at line 17 of file StreamerOutputFile.cc.

References edm::streamer::EventMsgView::eventData(), Exception, edm::streamer::EventMsgView::headerSize(), runTheMatrix::ret, edm::streamer::EventMsgView::size(), streamerfile_, and writeEventHeader().

17  {
19  uint64 offset_to_return = streamerfile_->current_offset();
20 
21  writeEventHeader(ineview);
22  bool ret = streamerfile_->write((const char*)ineview.eventData(), ineview.size() - ineview.headerSize(), true);
23  if (ret) {
24  throw cms::Exception("OutputFile", "write(EventMsgView)")
25  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
26  << "is full?" << std::endl;
27  }
28  return offset_to_return;
29  }
ret
prodAgent to be discontinued
void writeEventHeader(const EventMsgView &ineview)
unsigned long long uint64
Definition: MsgTools.h:15
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ writeEventFragment()

uint64 edm::streamer::StreamerOutputFile::writeEventFragment ( uint32  fragIndex,
uint32  fragCount,
const char *  dataPtr,
uint32  dataSize 
)

Offset where current event starts

Definition at line 31 of file StreamerOutputFile.cc.

References Exception, runTheMatrix::ret, and streamerfile_.

34  {
36  uint64 offset_to_return = streamerfile_->current_offset();
37 
38  bool ret = streamerfile_->write(dataPtr, dataSize);
39  if (ret) {
40  throw cms::Exception("OutputFile", "writeEventFragment()")
41  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
42  << "is full?" << std::endl;
43  }
44  return offset_to_return;
45  }
ret
prodAgent to be discontinued
unsigned long long uint64
Definition: MsgTools.h:15
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ writeEventHeader()

void edm::streamer::StreamerOutputFile::writeEventHeader ( const EventMsgView ineview)
private

Definition at line 47 of file StreamerOutputFile.cc.

References Exception, edm::streamer::EventMsgView::headerSize(), runTheMatrix::ret, edm::streamer::EventMsgView::startAddress(), and streamerfile_.

Referenced by write().

47  {
48  bool ret = streamerfile_->write((const char*)ineview.startAddress(), ineview.headerSize());
49  if (ret) {
50  throw cms::Exception("OutputFile", "writeEventHeader")
51  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
52  << "is full?" << std::endl;
53  }
54  }
ret
prodAgent to be discontinued
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ writeInitFragment()

void edm::streamer::StreamerOutputFile::writeInitFragment ( uint32  fragIndex,
uint32  fragCount,
const char *  dataPtr,
uint32  dataSize 
)

Definition at line 71 of file StreamerOutputFile.cc.

References Exception, runTheMatrix::ret, and streamerfile_.

71  {
72  bool ret = streamerfile_->write((const char*)dataPtr, dataSize);
73  if (ret) {
74  throw cms::Exception("OutputFile", "writeInitFragment()")
75  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
76  << "is full?" << std::endl;
77  }
78  }
ret
prodAgent to be discontinued
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

◆ writeStart()

void edm::streamer::StreamerOutputFile::writeStart ( const InitMsgView inview)
private

Definition at line 80 of file StreamerOutputFile.cc.

References Exception, edm::streamer::InitMsgView::headerSize(), runTheMatrix::ret, edm::streamer::InitMsgView::startAddress(), and streamerfile_.

Referenced by write().

80  {
81  bool ret = streamerfile_->write((const char*)inview.startAddress(), inview.headerSize());
82  if (ret) {
83  throw cms::Exception("OutputFile", "writeStart")
84  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
85  << "is full?" << std::endl;
86  }
87  }
ret
prodAgent to be discontinued
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_

Member Data Documentation

◆ streamerfile_

edm::propagate_const<std::shared_ptr<edm::streamer::OutputFile> > edm::streamer::StreamerOutputFile::streamerfile_
private