CMS 3D CMS Logo

BufferedBoostIOESProducer.h
Go to the documentation of this file.
1 #ifndef CondTools_Hcal_BufferedBoostIOESProducer_h
2 #define CondTools_Hcal_BufferedBoostIOESProducer_h
3 
4 // -*- C++ -*-
5 //
6 // Package: CondTools/Hcal
7 // Class: BufferedBoostIOESProducer
8 //
16 //
17 // Original Author: Igor Volobouev
18 // Created: Sun Aug 31 22:18:44 CDT 2014
19 // $Id: BufferedBoostIOESProducer.h,v 1.0 2014/08/31 22:18:44 igv Exp $
20 //
21 //
22 
23 #include <sstream>
24 #include <memory>
25 
28 
29 #include "CondFormats/Serialization/interface/eos/portable_iarchive.hpp"
31 
32 template <class DataType, class MyRecord>
34 public:
35  typedef std::unique_ptr<DataType> ReturnType;
36 
37  inline BufferedBoostIOESProducer(const edm::ParameterSet&) : token_(setWhatProduced(this).consumes()) {}
38 
39  inline ~BufferedBoostIOESProducer() override {}
40 
41  ReturnType produce(const MyRecord&);
42 
43 private:
45 };
46 
47 template <class DataType, class MyRecord>
50  const auto& buffer = iRecord.get(token_);
51  std::istringstream is(buffer.str());
52  eos::portable_iarchive ar(is);
53  auto ret = std::make_unique<DataType>();
54  ar&* ret;
55  return ret;
56 }
57 
58 #endif // CondTools_Hcal_BufferedBoostIOESProducer_h
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:165
const edm::ESGetToken< OOTPileupCorrectionBuffer, MyRecord > token_
ret
prodAgent to be discontinued
BufferedBoostIOESProducer(const edm::ParameterSet &)
ReturnType produce(const MyRecord &)
std::unique_ptr< DataType > ReturnType