Public Types | Public Member Functions | Protected Attributes | List of all members
evd::ThreadsafeGalleryEvent Class Reference

#include <ThreadsafeGalleryEvent.h>

Public Types

template<class PROD >
using HandleT = gallery::Event::template HandleT< PROD >
 

Public Member Functions

 ThreadsafeGalleryEvent (const gallery::Event *evt)
 
template<class T >
bool getByLabel (const art::InputTag &tag, gallery::Handle< T > &result) const
 
template<class T >
std::vector< art::InputTaggetInputTags () const
 
const art::EventAuxiliaryeventAuxiliary () const
 

Protected Attributes

std::mutex fLock
 
const gallery::EventfEvt
 

Detailed Description

gallery::Event is not designed to be threadsafe. Serializing calls through this wrapper should be more efficient than giving up on threading as a whole. This way we can still write and transfer the PNGs in parallel for example.

Definition at line 14 of file ThreadsafeGalleryEvent.h.

Member Typedef Documentation

template<class PROD >
using evd::ThreadsafeGalleryEvent::HandleT = gallery::Event::template HandleT<PROD>

Definition at line 17 of file ThreadsafeGalleryEvent.h.

Constructor & Destructor Documentation

evd::ThreadsafeGalleryEvent::ThreadsafeGalleryEvent ( const gallery::Event evt)
inline

Definition at line 19 of file ThreadsafeGalleryEvent.h.

19  : fEvt(evt)
20  {
21  }

Member Function Documentation

const art::EventAuxiliary& evd::ThreadsafeGalleryEvent::eventAuxiliary ( ) const
inline

Definition at line 37 of file ThreadsafeGalleryEvent.h.

38  {
39  std::lock_guard guard(fLock);
40  return fEvt->eventAuxiliary();
41  }
art::EventAuxiliary const & eventAuxiliary() const
Definition: Event.cc:35
template<class T >
bool evd::ThreadsafeGalleryEvent::getByLabel ( const art::InputTag tag,
gallery::Handle< T > &  result 
) const
inline

Definition at line 24 of file ThreadsafeGalleryEvent.h.

25  {
26  std::lock_guard guard(fLock);
27  return fEvt->getByLabel(tag, result);
28  }
bool getByLabel(art::InputTag const &, Handle< PROD > &result) const
Definition: Event.h:174
template<class T >
std::vector<art::InputTag> evd::ThreadsafeGalleryEvent::getInputTags ( ) const
inline

Definition at line 31 of file ThreadsafeGalleryEvent.h.

32  {
33  std::lock_guard guard(fLock);
34  return fEvt->getInputTags<T>();
35  }
std::vector< art::InputTag > getInputTags() const
Definition: Event.h:218

Member Data Documentation

const gallery::Event* evd::ThreadsafeGalleryEvent::fEvt
protected

Definition at line 45 of file ThreadsafeGalleryEvent.h.

std::mutex evd::ThreadsafeGalleryEvent::fLock
mutableprotected

Definition at line 44 of file ThreadsafeGalleryEvent.h.


The documentation for this class was generated from the following file: