CMS 3D CMS Logo

StreamerOutputFile.cc
Go to the documentation of this file.
3 
5 
7  streamerfile_->set_do_adler(true);
8 }
9 
11  EventMsgView tmpView(ineview.startAddress());
12  return write(tmpView);
13 }
14 
17  uint64 offset_to_return = streamerfile_->current_offset();
18 
19  writeEventHeader(ineview);
20  bool ret = streamerfile_->write((const char*)ineview.eventData(), ineview.size() - ineview.headerSize());
21  if (ret) {
22  throw cms::Exception("OutputFile", "write(EventMsgView)")
23  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
24  << "is full?" << std::endl;
25  }
26  return offset_to_return;
27 }
28 
29 uint64 StreamerOutputFile::writeEventFragment(uint32 fragIndex, uint32 fragCount, const char* dataPtr, uint32 dataSize) {
31  uint64 offset_to_return = streamerfile_->current_offset();
32 
33  bool ret = streamerfile_->write(dataPtr, dataSize);
34  if (ret) {
35  throw cms::Exception("OutputFile", "writeEventFragment()")
36  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
37  << "is full?" << std::endl;
38  }
39  return offset_to_return;
40 }
41 
43  bool ret = streamerfile_->write((const char*)ineview.startAddress(), ineview.headerSize());
44  if (ret) {
45  throw cms::Exception("OutputFile", "writeEventHeader")
46  << "Error writing streamer event data to " << streamerfile_->fileName() << ". Possibly the output disk "
47  << "is full?" << std::endl;
48  }
49 }
50 
52  InitMsgView tmpView(inview.startAddress());
53  return write(tmpView);
54 }
55 
57  writeStart(inview);
58  bool ret = streamerfile_->write((const char*)inview.descData(), inview.size() - inview.headerSize());
59  if (ret) {
60  throw cms::Exception("OutputFile", "write(InitMsgView)")
61  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
62  << "is full?" << std::endl;
63  }
64 }
65 
66 void StreamerOutputFile::writeInitFragment(uint32 fragIndex, uint32 fragCount, const char* dataPtr, uint32 dataSize) {
67  bool ret = streamerfile_->write((const char*)dataPtr, dataSize);
68  if (ret) {
69  throw cms::Exception("OutputFile", "writeInitFragment()")
70  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
71  << "is full?" << std::endl;
72  }
73 }
74 
76  bool ret = streamerfile_->write((const char*)inview.startAddress(), inview.headerSize());
77  if (ret) {
78  throw cms::Exception("OutputFile", "writeStart")
79  << "Error writing streamer header data to " << streamerfile_->fileName() << ". Possibly the output disk "
80  << "is full?" << std::endl;
81  }
82 }
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
edm::propagate_const< std::shared_ptr< OutputFile > > streamerfile_
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)
uint8 * startAddress() const
uint32 size() const
Definition: InitMessage.h:66
void writeStart(const InitMsgView &inview)