#include <IOPool/Streamer/interface/StreamerOutputIndexFile.h>
Public Member Functions | |
uint32 | adler32 () const |
StreamerOutputIndexFile (const std::string &name) | |
void | write (const EventMsgView &, uint64) |
void | write (const EventMsgBuilder &, uint64) |
void | write (const InitMsgView &) |
void | write (const InitMsgBuilder &) |
uint32 | writeEOF (uint32 statusCode, const std::vector< uint32 > &hltStats) |
void | writeIndexFileHeader (uint32 magicNumber, uint64 reserved) |
~StreamerOutputIndexFile () | |
Private Attributes | |
OutputFile * | indexfile_ |
Class for doing Index write operations.
Definition at line 18 of file StreamerOutputIndexFile.h.
StreamerOutputIndexFile::StreamerOutputIndexFile | ( | const std::string & | name | ) | [explicit] |
Definition at line 6 of file StreamerOutputIndexFile.cc.
References indexfile_, and OutputFile::set_do_adler().
00006 : 00007 indexfile_(new OutputFile(name)) 00008 { 00009 indexfile_->set_do_adler(1); 00010 }
StreamerOutputIndexFile::~StreamerOutputIndexFile | ( | ) |
Definition at line 12 of file StreamerOutputIndexFile.cc.
References indexfile_.
00013 { 00014 delete indexfile_; 00015 }
uint32 StreamerOutputIndexFile::adler32 | ( | ) | const [inline] |
Definition at line 38 of file StreamerOutputIndexFile.h.
References OutputFile::adler32(), and indexfile_.
00038 { return indexfile_->adler32(); }
void StreamerOutputIndexFile::write | ( | const EventMsgView & | ineview, | |
uint64 | offset | |||
) |
Write the Event Offset
Offset of last written event
Definition at line 52 of file StreamerOutputIndexFile.cc.
References convert(), OutputFile::events(), EventMsgView::headerSize(), OutputFile::inc_events(), indexfile_, OutputFile::set_first_event_offset(), OutputFile::set_last_event_offset(), EventMsgView::startAddress(), and OutputFile::write().
00054 { 00056 indexfile_->write((const char*) 00057 ineview.startAddress(), 00058 ineview.headerSize() ) ; 00059 00061 uint64 offsetstr; 00062 convert(offset, (unsigned char*)&offsetstr); 00063 indexfile_->write((const char*) &offsetstr, sizeof(uint64) ); 00064 if (indexfile_->events() == 0) 00065 indexfile_->set_first_event_offset(offset); 00066 indexfile_->inc_events(); 00068 indexfile_->set_last_event_offset(offset); 00069 }
void StreamerOutputIndexFile::write | ( | const EventMsgBuilder & | ineview, | |
uint64 | offset | |||
) |
Write the Event Offset
Offset of last written event
Definition at line 33 of file StreamerOutputIndexFile.cc.
References convert(), OutputFile::events(), EventMsgBuilder::headerSize(), OutputFile::inc_events(), indexfile_, OutputFile::set_first_event_offset(), OutputFile::set_last_event_offset(), EventMsgBuilder::startAddress(), and OutputFile::write().
00035 { 00037 indexfile_->write((const char*) 00038 ineview.startAddress(), 00039 ineview.headerSize() ) ; 00040 00042 uint64 offsetstr; 00043 convert(offset, (unsigned char*)&offsetstr); 00044 indexfile_->write((const char*) &offsetstr, sizeof(uint64) ); 00045 if (indexfile_->events() == 0) 00046 indexfile_->set_first_event_offset(offset); 00047 indexfile_->inc_events(); 00049 indexfile_->set_last_event_offset(offset); 00050 }
void StreamerOutputIndexFile::write | ( | const InitMsgView & | inview | ) |
Definition at line 25 of file StreamerOutputIndexFile.cc.
References InitMsgView::headerSize(), indexfile_, InitMsgView::run(), OutputFile::set_run(), InitMsgView::startAddress(), and OutputFile::write().
00026 { 00027 indexfile_->write((const char*) 00028 inview.startAddress(), 00029 inview.headerSize() ) ; 00030 indexfile_->set_run(inview.run()); 00031 }
void StreamerOutputIndexFile::write | ( | const InitMsgBuilder & | inview | ) |
Definition at line 17 of file StreamerOutputIndexFile.cc.
References InitMsgBuilder::headerSize(), indexfile_, InitMsgBuilder::run(), OutputFile::set_run(), InitMsgBuilder::startAddress(), and OutputFile::write().
00018 { 00019 indexfile_->write((const char*) 00020 inview.startAddress(), 00021 inview.headerSize() ) ; 00022 indexfile_->set_run(inview.run()); 00023 }
uint32 StreamerOutputIndexFile::writeEOF | ( | uint32 | statusCode, | |
const std::vector< uint32 > & | hltStats | |||
) |
Definition at line 87 of file StreamerOutputIndexFile.cc.
References outputToXml::eof, OutputFile::events(), OutputFile::first_event_offset(), indexfile_, OutputFile::last_event_offset(), OutputFile::run(), and OutputFile::write().
00089 { 00090 00091 EOFRecordBuilder eof(indexfile_->run(), 00092 indexfile_->events(), 00093 statusCode, 00094 hltStats, 00095 indexfile_->first_event_offset(), 00096 indexfile_->last_event_offset()); 00097 indexfile_->write((const char*) 00098 eof.recAddress(), 00099 eof.size() ); 00100 return eof.size(); 00101 }
Definition at line 72 of file StreamerOutputIndexFile.cc.
References convert(), indexfile_, and OutputFile::write().
00074 { 00075 //04 Bytes Magic Number 00076 uint32 magicstr; 00077 convert(magicNumber, (unsigned char*)&magicstr); 00078 indexfile_->write((const char*) &magicstr, sizeof(uint32) ); 00079 00080 //08 Bytes Reserved Value 00081 uint64 reservedstr; 00082 convert(reserved, (unsigned char*)&reservedstr); 00083 indexfile_->write((const char*) &reservedstr, sizeof(uint64) ); 00084 }
OutputFile* StreamerOutputIndexFile::indexfile_ [private] |
Definition at line 41 of file StreamerOutputIndexFile.h.
Referenced by adler32(), StreamerOutputIndexFile(), write(), writeEOF(), writeIndexFileHeader(), and ~StreamerOutputIndexFile().