00001 #ifndef IOPool_Streamer_StreamerFileWriter_h 00002 #define IOPool_Streamer_StreamerFileWriter_h 00003 00004 // $Id: StreamerFileWriter.h,v 1.11 2008/10/22 00:00:42 loizides Exp $ 00005 00006 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00007 00008 #include "IOPool/Streamer/interface/StreamerOutputFile.h" 00009 #include "IOPool/Streamer/interface/StreamerOutputIndexFile.h" 00010 #include "IOPool/Streamer/interface/InitMsgBuilder.h" 00011 #include "IOPool/Streamer/interface/EventMsgBuilder.h" 00012 #include "IOPool/Streamer/interface/InitMessage.h" 00013 #include "IOPool/Streamer/interface/EventMessage.h" 00014 #include "IOPool/Streamer/interface/MsgTools.h" 00015 00016 #include <iostream> 00017 #include <vector> 00018 #include <memory> 00019 #include <string> 00020 00021 namespace edm 00022 { 00023 class StreamerFileWriter 00024 { 00025 public: 00026 00027 explicit StreamerFileWriter(edm::ParameterSet const& ps); 00028 explicit StreamerFileWriter(std::string const& fileName, std::string const& indexFileName); 00029 ~StreamerFileWriter(); 00030 00031 //void doOutputHeader(std::auto_ptr<InitMsgBuilder> init_message); 00032 void doOutputHeader(InitMsgBuilder const& init_message); 00033 void doOutputHeader(InitMsgView const& init_message); 00034 00035 //void doOutputEvent(std::auto_ptr<EventMsgBuilder> msg); 00036 void doOutputEvent(EventMsgBuilder const& msg); 00037 void doOutputEvent(EventMsgView const& msg); 00038 00039 void start(){} 00040 void stop(); 00041 // Returns the sizes of EOF records, call them after 00042 // u called stop, just before destruction 00043 uint32 getStreamEOFSize() const {return stream_eof_size_;} 00044 uint32 getIndexEOFSize() const {return index_eof_size_;} 00045 00046 uint32 get_adler32_stream() const { return stream_writer_->adler32();} 00047 uint32 get_adler32_index() const { return index_writer_->adler32();} 00048 00049 private: 00050 void updateHLTStats(std::vector<uint8> const& packedHlt); 00051 00052 std::auto_ptr<StreamerOutputFile> stream_writer_; 00053 std::auto_ptr<StreamerOutputIndexFile> index_writer_; 00054 uint32 hltCount_; 00055 std::vector<uint32> hltStats_; 00056 uint32 index_eof_size_; 00057 uint32 stream_eof_size_; 00058 00059 }; 00060 } 00061 #endif