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
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
BufferedBoostIOESProducer::BufferedBoostIOESProducer
BufferedBoostIOESProducer(const edm::ParameterSet &)
Definition: BufferedBoostIOESProducer.h:37
BufferedBoostIOESProducer::token_
const edm::ESGetToken< OOTPileupCorrectionBuffer, MyRecord > token_
Definition: BufferedBoostIOESProducer.h:44
BufferedBoostIOESProducer::~BufferedBoostIOESProducer
~BufferedBoostIOESProducer() override
Definition: BufferedBoostIOESProducer.h:39
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
ESProducer.h
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
BufferedBoostIOESProducer::ReturnType
std::unique_ptr< DataType > ReturnType
Definition: BufferedBoostIOESProducer.h:35
OOTPileupCorrectionBuffer.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::ESGetToken< OOTPileupCorrectionBuffer, MyRecord >
ModuleFactory.h
edm::ESProducer
Definition: ESProducer.h:104
BufferedBoostIOESProducer
Definition: BufferedBoostIOESProducer.h:33
BufferedBoostIOESProducer::produce
ReturnType produce(const MyRecord &)
Definition: BufferedBoostIOESProducer.h:49