00001 #include "IOPool/Streamer/interface/StreamDQMOutputFile.h" 00002 00003 StreamDQMOutputFile::~StreamDQMOutputFile() 00004 { 00005 } 00006 00007 StreamDQMOutputFile::StreamDQMOutputFile(const std::string& name): 00008 dqmstreamfile_(new OutputFile(name)) 00009 { 00010 } 00011 00012 uint64 StreamDQMOutputFile::write(const DQMEventMsgBuilder& inmsg) 00013 { 00015 uint64 offset_to_return = dqmstreamfile_->current_offset(); 00016 00018 dqmstreamfile_->set_last_event_offset(dqmstreamfile_->current_offset()); 00019 00020 writeDQMEventHeader(inmsg); 00021 dqmstreamfile_->write((const char*) inmsg.eventAddress(), 00022 inmsg.size() - inmsg.headerSize()); 00023 00024 dqmstreamfile_->inc_events(); 00025 00026 return offset_to_return; 00027 } 00028 00029 uint64 StreamDQMOutputFile::write(const DQMEventMsgView& ineview) 00030 { 00032 uint64 offset_to_return = dqmstreamfile_->current_offset(); 00033 00035 dqmstreamfile_->set_last_event_offset(dqmstreamfile_->current_offset()); 00036 00037 writeDQMEventHeader(ineview); 00038 dqmstreamfile_->write((const char*) ineview.eventAddress(), 00039 ineview.size() - ineview.headerSize()); 00040 00041 dqmstreamfile_->inc_events(); 00042 00043 return offset_to_return; 00044 } 00045 00046 void StreamDQMOutputFile::writeDQMEventHeader(const DQMEventMsgBuilder& inmsg) 00047 { 00048 dqmstreamfile_->write((const char*) 00049 inmsg.startAddress(), 00050 inmsg.headerSize()) ; 00051 } 00052 00053 void StreamDQMOutputFile::writeDQMEventHeader(const DQMEventMsgView& ineview) 00054 { 00055 dqmstreamfile_->write((const char*) 00056 ineview.startAddress(), 00057 ineview.headerSize()) ; 00058 }