#include <FRDFileHandler.h>
Public Member Functions | |
virtual void | closeFile (const FilesMonitorCollection::FileRecord::ClosingReason &) |
FRDFileHandler (FilesMonitorCollection::FileRecordPtr, const DbFileHandlerPtr, const DiskWritingParams &, 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 DiskWritingParams & | dwParams, | ||
const uint64_t & | maxFileSize | ||
) |
Definition at line 15 of file FRDFileHandler.cc.
: FileHandler(fileRecord, dbFileHandler, dwParams, 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 38 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 26 of file FRDFileHandler.cc.
References stor::I2OChain::dataLocation(), stor::I2OChain::dataSize(), stor::I2OChain::fragmentCount(), and writer_.
{ unsigned int fragCount = chain.fragmentCount(); for (unsigned int idx = 0; idx < fragCount; ++idx) { writer_->doOutputEventFragment( chain.dataLocation(idx), chain.dataSize(idx)); } }
boost::scoped_ptr<FRDEventFileWriter> stor::FRDFileHandler::writer_ [private] |
Definition at line 52 of file FRDFileHandler.h.
Referenced by closeFile(), and do_writeEvent().