CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/IOPool/Streamer/interface/FRDEventFileWriter.h

Go to the documentation of this file.
00001 #ifndef IOPool_Streamer_FRDEventFileWriter_h
00002 #define IOPool_Streamer_FRDEventFileWriter_h 
00003 
00004 // $Id: FRDEventFileWriter.h,v 1.3 2010/02/18 09:19:02 mommsen Exp $
00005 
00006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00007 #include "IOPool/Streamer/interface/FRDEventMessage.h"
00008 
00009 #include <fstream>
00010 
00011 class FRDEventFileWriter 
00012 {
00013  public:
00014 
00015   explicit FRDEventFileWriter(edm::ParameterSet const& ps);
00016   explicit FRDEventFileWriter(std::string const& fileName);
00017   ~FRDEventFileWriter();
00018 
00019   void doOutputEvent(FRDEventMsgView const& msg);
00020   void doOutputEventFragment(unsigned char* dataPtr,
00021                              unsigned long dataSize);
00022 
00023   uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
00024 
00025   void start() {}
00026   void stop() {}
00027  
00028  private:
00029 
00030   void initialize(std::string const& name);
00031 
00032   std::auto_ptr<std::ofstream> ost_;
00033   std::string fileName_;
00034 
00035   uint32 adlera_;
00036   uint32 adlerb_;
00037 
00038 };
00039 #endif