CMS 3D CMS Logo

edm::EventOutputService Class Reference

#include <EventFilter/StorageManager/interface/EventOutputService.h>

Inheritance diagram for edm::EventOutputService:

edm::OutputService

List of all members.

Public Member Functions

 EventOutputService (boost::shared_ptr< FileRecord >, InitMsgView const &)
void report (std::ostream &os, int indentation) const
void writeEvent (const uint8 *const)
 ~EventOutputService ()

Private Member Functions

void closeFile ()
void writeHeader (InitMsgView const &)

Private Attributes

boost::shared_ptr
< StreamerFileWriter
writer_


Detailed Description

Definition at line 12 of file EventOutputService.h.


Constructor & Destructor Documentation

EventOutputService::EventOutputService ( boost::shared_ptr< FileRecord file,
InitMsgView const &  view 
)

Definition at line 16 of file EventOutputService.cc.

References edm::OutputService::file_, aod_PYTHIA_cfg::fileName, edm::OutputService::getTimeStamp(), writeHeader(), and writer_.

00018 {
00019   file_ = file;
00020 
00021   string streamerFileName = file_ -> filePath() + file_ -> fileName() + file_ -> fileCounterStr() + ".dat";
00022   string indexFileName    = file_ -> filePath() + file_ -> fileName() + file_ -> fileCounterStr() + ".ind";
00023 
00024   writer_ = shared_ptr<StreamerFileWriter> (new StreamerFileWriter(streamerFileName, indexFileName));
00025   writeHeader(view);
00026 
00027   file_ -> firstEntry(getTimeStamp());
00028   file_ -> insertFileInDatabase();
00029 }

EventOutputService::~EventOutputService (  ) 

Definition at line 35 of file EventOutputService.cc.

References closeFile().

00036 {
00037   //std::cout << "EventOutputService Destructor called." << std::endl;
00038   closeFile();
00039 }


Member Function Documentation

void EventOutputService::closeFile (  )  [private]

Definition at line 76 of file EventOutputService.cc.

References edm::OutputService::file_, and writer_.

Referenced by ~EventOutputService().

00077 {
00078   writer_ -> stop();
00079   file_   -> increaseFileSize(writer_->getStreamEOFSize());
00080   file_   -> setadler(writer_->get_adler32_stream(),writer_->get_adler32_index());
00081   file_   -> moveFileToClosed();
00082   file_   -> writeToSummaryCatalog();
00083   file_   -> updateDatabase();
00084 }

void edm::EventOutputService::report ( std::ostream &  os,
int  indentation 
) const [virtual]

Implements edm::OutputService.

void EventOutputService::writeEvent ( const uint8 * const  bufPtr  )  [virtual]

Implements edm::OutputService.

Definition at line 59 of file EventOutputService.cc.

References edm::OutputService::file_, edm::OutputService::getTimeStamp(), edm::OutputService::lastEntry(), EventMsgView::size(), and writer_.

00060 {
00061   EventMsgView view((void *) bufPtr);
00062   writer_ -> doOutputEvent(view);
00063   file_   -> increaseFileSize(view.size());
00064   file_   -> lastEntry(getTimeStamp());
00065   file_   -> increaseEventCount();
00066 }

void EventOutputService::writeHeader ( InitMsgView const &  view  )  [private]

Definition at line 46 of file EventOutputService.cc.

References edm::OutputService::file_, InitMsgView::size(), and writer_.

Referenced by EventOutputService().

00047 {
00048   writer_ -> doOutputHeader(view);
00049   file_   -> increaseFileSize(view.size());
00050 }


Member Data Documentation

boost::shared_ptr<StreamerFileWriter> edm::EventOutputService::writer_ [private]

Definition at line 25 of file EventOutputService.h.

Referenced by closeFile(), EventOutputService(), writeEvent(), and writeHeader().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:40:53 2009 for CMSSW by  doxygen 1.5.4