test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual std::string save (const edm::EventSetup &setup) const
 
virtual ~WriterProxyT ()
 
- 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 >
virtual l1t::WriterProxyT< Record, Type >::~WriterProxyT ( )
inlinevirtual

Definition at line 49 of file WriterProxy.h.

49 {}

Member Function Documentation

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

tr.start(false);

tr.commit();

Implements l1t::WriterProxy.

Definition at line 52 of file WriterProxy.h.

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

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

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  boost::shared_ptr<Type> pointer(new 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
tuple handle
Definition: patZpeak.py:22
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
cond::Hash storePayload(const T &payload, const boost::posix_time::ptime &creationTime=boost::posix_time::microsec_clock::universal_time())
Definition: Session.h:177
session
Definition: models.py:201