CMS 3D CMS Logo

List of all members | Public Member Functions
l1t::WriterProxyT< Record, Type > Class Template Reference

#include <WriterProxy.h>

Inheritance diagram for l1t::WriterProxyT< Record, Type >:
l1t::WriterProxy

Public Member Functions

std::string save (const edm::EventSetup &setup) const override
 
 ~WriterProxyT () override
 
- Public Member Functions inherited from l1t::WriterProxy
virtual ~WriterProxy ()
 

Detailed Description

template<class Record, class Type>
class l1t::WriterProxyT< Record, Type >

Definition at line 46 of file WriterProxy.h.

Constructor & Destructor Documentation

template<class Record , class Type >
l1t::WriterProxyT< Record, Type >::~WriterProxyT ( )
inlineoverride

Definition at line 49 of file WriterProxy.h.

49 {}

Member Function Documentation

template<class Record , class Type >
std::string l1t::WriterProxyT< Record, Type >::save ( const edm::EventSetup setup) const
inlineoverridevirtual

tr.start(false);

tr.commit();

Implements l1t::WriterProxy.

Definition at line 52 of file WriterProxy.h.

References cond::service::PoolDBOutputService::forceInit(), edm::EventSetup::get(), cmsBatch::handle, edm::Service< T >::isAvailable(), edm::ESHandle< T >::product(), cond::service::PoolDBOutputService::session(), dataDML::session, cond::persistency::Session::storePayload(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::persistency::Session::transaction().

Referenced by Vispa.Main.TabController.TabController::allowClose(), Vispa.Main.TabController.TabController::checkModificationTimestamp(), and SpecificationBuilder_cfi.Specification::saveAll().

53  {
54  // load record and type from EventSetup and save them in db
56 
57  try
58  {
59  setup.get<Record> ().get (handle);
60  }
62  {
63  return std::string() ;
64  }
65 
66  // If handle is invalid, then data is already in DB
67 
69  if (!poolDb.isAvailable())
70  {
71  throw cond::Exception( "DataWriter: PoolDBOutputService not available."
72  ) ;
73  }
74  poolDb->forceInit();
77  // if throw transaction will unroll
79 
80  std::shared_ptr<Type> pointer = std::make_shared<Type>(*(handle.product ()));
81  std::string payloadToken = session.storePayload( *pointer );
83  tr.close();
84  return payloadToken ;
85  }
persistency::Exception Exception
Definition: Exception.h:25
cond::persistency::Session session() const
Transaction & transaction()
Definition: Session.cc:66
bool isAvailable() const
Definition: Service.h:46
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:189
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86