#include <FRDFileHandler.h>
Public Member Functions | |
virtual void | closeFile (const FilesMonitorCollection::FileRecord::ClosingReason &) |
FRDFileHandler (FilesMonitorCollection::FileRecordPtr, const DbFileHandlerPtr, const uint64_t &maxFileSize) | |
Private Member Functions | |
virtual void | do_writeEvent (const I2OChain &) |
Private Attributes | |
boost::scoped_ptr < FRDEventFileWriter > | writer_ |
Represents a file holding HLT error events in the FED Raw Data (FRD) format.
Definition at line 28 of file FRDFileHandler.h.
stor::FRDFileHandler::FRDFileHandler | ( | FilesMonitorCollection::FileRecordPtr | fileRecord, |
const DbFileHandlerPtr | dbFileHandler, | ||
const uint64_t & | maxFileSize | ||
) |
Definition at line 15 of file FRDFileHandler.cc.
: FileHandler(fileRecord, dbFileHandler, maxFileSize), writer_(new FRDEventFileWriter(fileRecord->completeFileName())) {}
void stor::FRDFileHandler::closeFile | ( | const FilesMonitorCollection::FileRecord::ClosingReason & | reason | ) | [virtual] |
Close the file
Implements stor::FileHandler.
Definition at line 37 of file FRDFileHandler.cc.
References stor::FileHandler::fileRecord_, stor::FileHandler::moveFileToClosed(), stor::FileHandler::updateDatabase(), and writer_.
{ if ( ! fileRecord_->isOpen ) return; if (writer_) { // if writer was reset, we already closed the stream but failed to move the file to the closed position writer_->stop(); fileRecord_->adler32 = writer_->adler32(); writer_.reset(); // Destruct the writer to flush the file stream } moveFileToClosed(reason); updateDatabase(); }
void stor::FRDFileHandler::do_writeEvent | ( | const I2OChain & | chain | ) | [private, virtual] |
Write the I2OChain to the file
Implements stor::FileHandler.
Definition at line 25 of file FRDFileHandler.cc.
References stor::I2OChain::dataLocation(), stor::I2OChain::dataSize(), stor::I2OChain::fragmentCount(), UserOptions_cff::idx, and writer_.
boost::scoped_ptr<FRDEventFileWriter> stor::FRDFileHandler::writer_ [private] |
Definition at line 51 of file FRDFileHandler.h.
Referenced by closeFile(), and do_writeEvent().