CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
StreamerOutputFile.cc
Go to the documentation of this file.
3 
5 
7  : streamerfile_(std::make_shared<edm::streamer::OutputFile>(name)) {
8  streamerfile_->set_do_adler(true);
9 }
10 
12  EventMsgView tmpView(ineview.startAddress());
13  return write(tmpView);
14 }
15 
18  uint64 offset_to_return = streamerfile_->current_offset();
19 
20  writeEventHeader(ineview);
21  bool ret = streamerfile_->write((const char*)ineview.eventData(), ineview.size() - ineview.headerSize());
22  if (ret) {
23  throw cms::Exception("OutputFile", "write(EventMsgView)")
24  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
25  << "is full?" << std::endl;
26  }
27  return offset_to_return;
28 }
29 
30 uint64 StreamerOutputFile::writeEventFragment(uint32 fragIndex, uint32 fragCount, const char* dataPtr, uint32 dataSize) {
32  uint64 offset_to_return = streamerfile_->current_offset();
33 
34  bool ret = streamerfile_->write(dataPtr, dataSize);
35  if (ret) {
36  throw cms::Exception("OutputFile", "writeEventFragment()")
37  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
38  << "is full?" << std::endl;
39  }
40  return offset_to_return;
41 }
42 
44  bool ret = streamerfile_->write((const char*)ineview.startAddress(), ineview.headerSize());
45  if (ret) {
46  throw cms::Exception("OutputFile", "writeEventHeader")
47  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
48  << "is full?" << std::endl;
49  }
50 }
51 
53  InitMsgView tmpView(inview.startAddress());
54  return write(tmpView);
55 }
56 
58  writeStart(inview);
59  bool ret = streamerfile_->write((const char*)inview.descData(), inview.size() - inview.headerSize());
60  if (ret) {
61  throw cms::Exception("OutputFile", "write(InitMsgView)")
62  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
63  << "is full?" << std::endl;
64  }
65 }
66 
67 void StreamerOutputFile::writeInitFragment(uint32 fragIndex, uint32 fragCount, const char* dataPtr, uint32 dataSize) {
68  bool ret = streamerfile_->write((const char*)dataPtr, dataSize);
69  if (ret) {
70  throw cms::Exception("OutputFile", "writeInitFragment()")
71  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
72  << "is full?" << std::endl;
73  }
74 }
75 
77  bool ret = streamerfile_->write((const char*)inview.startAddress(), inview.headerSize());
78  if (ret) {
79  throw cms::Exception("OutputFile", "writeStart")
80  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
81  << "is full?" << std::endl;
82  }
83 }
tuple ret
prodAgent to be discontinued
const uint8 * eventData() const
Definition: EventMessage.h:79
uint8 * startAddress() const
Definition: EventMessage.h:80
const uint8 * descData() const
Definition: InitMessage.h:86
uint64 writeEventFragment(uint32 fragIndex, uint32 fragCount, const char *dataPtr, uint32 dataSize)
void write(const InitMsgBuilder &)
uint8 * startAddress() const
uint8 * startAddress() const
Definition: InitMessage.h:67
void writeEventHeader(const EventMsgView &ineview)
uint32 headerSize() const
Definition: EventMessage.h:82
unsigned int uint32
Definition: MsgTools.h:13
StreamerOutputFile(const std::string &name)
uint32 headerSize() const
Definition: InitMessage.h:87
unsigned long long uint64
Definition: MsgTools.h:14
uint32 size() const
Definition: EventMessage.h:77
void writeInitFragment(uint32 fragIndex, uint32 fragCount, const char *dataPtr, uint32 dataSize)
edm::propagate_const< std::shared_ptr< edm::streamer::OutputFile > > streamerfile_
uint8 * startAddress() const
uint32 size() const
Definition: InitMessage.h:66
void writeStart(const InitMsgView &inview)