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 
29 
30 #include "CondFormats/Serialization/interface/eos/portable_iarchive.hpp"
32 
33 template<class DataType, class MyRecord>
35 {
36 public:
37  typedef std::unique_ptr<DataType> ReturnType;
38 
40  {setWhatProduced(this);}
41 
42  inline ~BufferedBoostIOESProducer() override {}
43 
44  ReturnType produce(const MyRecord&);
45 };
46 
47 template<class DataType, class MyRecord>
50 {
52  iRecord.get(handle);
53  std::istringstream is(handle->str());
54  eos::portable_iarchive ar(is);
55  auto ret = std::make_unique<DataType>();
56  ar & *ret;
57  return ret;
58 }
59 
60 #endif // CondTools_Hcal_BufferedBoostIOESProducer_h
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
BufferedBoostIOESProducer(const edm::ParameterSet &)
const std::string & str() const
ReturnType produce(const MyRecord &)
std::unique_ptr< DataType > ReturnType