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 48 of file WriterProxy.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file WriterProxy.h.

51 {}

Member Function Documentation

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

Implements l1t::WriterProxy.

Definition at line 54 of file WriterProxy.h.

References edm::hlt::Exception, edm::EventSetup::get(), patZpeak::handle, edm::Service< T >::isAvailable(), edm::ESHandle< class >::product(), cond::service::PoolDBOutputService::session(), python.CommonUtils::session, cond::persistency::TransactionScope::start(), 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().

55  {
56  // load record and type from EventSetup and save them in db
58 
59  try
60  {
61  setup.get<Record> ().get (handle);
62  }
64  {
65  return std::string() ;
66  }
67 
68  // If handle is invalid, then data is already in DB
69 
71  if (!poolDb.isAvailable())
72  {
73  throw cond::Exception( "DataWriter: PoolDBOutputService not available."
74  ) ;
75  }
78  // if throw transaction will unroll
79  tr.start(false);
80 
81  boost::shared_ptr<Type> pointer(new Type (*(handle.product ())));
82  std::string payloadToken = session.storePayload( *pointer );
83  tr.commit();
84  return payloadToken ;
85  }
cond::persistency::Session session() const
Transaction & transaction()
Definition: Session.cc:66
bool isAvailable() const
Definition: Service.h:46
tuple handle
Definition: patZpeak.py:22
void start(bool readOnly=true)
Definition: Session.cc:292
const T & get() const
Definition: EventSetup.h:55
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:202