00001 #ifndef IOPool_Streamer_StreamerOutputModule_h 00002 #define IOPool_Streamer_StreamerOutputModule_h 00003 00004 #include "IOPool/Streamer/interface/StreamerOutputModuleBase.h" 00005 00006 namespace edm { 00007 template <class Consumer> 00008 class StreamerOutputModule : public StreamerOutputModuleBase { 00009 00017 public: 00018 explicit StreamerOutputModule(ParameterSet const& ps); 00019 virtual ~StreamerOutputModule(); 00020 00021 private: 00022 virtual void start() const; 00023 virtual void stop() const; 00024 virtual void doOutputHeader(InitMsgBuilder const& init_message) const; 00025 virtual void doOutputEvent(EventMsgBuilder const& msg) const; 00026 00027 private: 00028 std::auto_ptr<Consumer> c_; 00029 }; //end-of-class-def 00030 00031 00032 00033 template <class Consumer> 00034 StreamerOutputModule<Consumer>::StreamerOutputModule(ParameterSet const& ps) : 00035 StreamerOutputModuleBase(ps), 00036 c_(new Consumer(ps)) { 00037 } 00038 00039 template <class Consumer> 00040 StreamerOutputModule<Consumer>::~StreamerOutputModule() {} 00041 00042 template <class Consumer> 00043 void 00044 StreamerOutputModule<Consumer>::start() const { 00045 c_->start(); 00046 } 00047 00048 template <class Consumer> 00049 void 00050 StreamerOutputModule<Consumer>::stop() const { 00051 c_->stop(); 00052 } 00053 00054 template <class Consumer> 00055 void 00056 StreamerOutputModule<Consumer>::doOutputHeader(InitMsgBuilder const& init_message) const { 00057 c_->doOutputHeader(init_message); 00058 } 00059 00060 //______________________________________________________________________________ 00061 template <class Consumer> 00062 void 00063 StreamerOutputModule<Consumer>::doOutputEvent(EventMsgBuilder const& msg) const { 00064 c_->doOutputEvent(msg); // You can't use msg in StreamerOutputModule after this point 00065 } 00066 } // end of namespace-edm 00067 00068 #endif 00069