LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
reco::shower::ShowerUniqueAssnPtr< T > Class Template Reference

#include "ShowerProducedPtrsHolder.hh"

Inheritance diagram for reco::shower::ShowerUniqueAssnPtr< T >:
reco::shower::ShowerUniqueProduerPtrBase

Public Member Functions

 ShowerUniqueAssnPtr (const std::string &Instancename)
 
std::unique_ptr< T > & GetPtr ()
 
void reset () override
 
void MoveToEvent (art::Event &evt) override
 
void AddDataProduct (const reco::shower::ShowerElementHolder &selement_holder, const std::string &Name) override
 
std::string GetType () const override
 
std::string GetInstanceName () const override
 
virtual int GetVectorPtrSize () const
 

Private Attributes

std::unique_ptr< T > showeruniqueptr
 
bool ptr
 
std::string InstanceName
 

Detailed Description

template<class T>
class reco::shower::ShowerUniqueAssnPtr< T >

Definition at line 30 of file ShowerProducedPtrsHolder.hh.

Constructor & Destructor Documentation

template<class T>
reco::shower::ShowerUniqueAssnPtr< T >::ShowerUniqueAssnPtr ( const std::string &  Instancename)
inline

Definition at line 161 of file ShowerProducedPtrsHolder.hh.

162  {
163  ptr = 1;
164  showeruniqueptr = std::make_unique<T>();
165  InstanceName = Instancename;
166  }

Member Function Documentation

template<class T>
void reco::shower::ShowerUniqueAssnPtr< T >::AddDataProduct ( const reco::shower::ShowerElementHolder selement_holder,
const std::string &  Name 
)
inlineoverridevirtual

Implements reco::shower::ShowerUniqueProduerPtrBase.

Definition at line 183 of file ShowerProducedPtrsHolder.hh.

185  {
186  throw cet::exception("ShowerUniqueAssnPtr")
187  << "The creator of this code has failed you. Please contact Dominic Bakrer" << std::endl;
188  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
std::string reco::shower::ShowerUniqueAssnPtr< T >::GetInstanceName ( ) const
inlineoverridevirtual
template<class T>
std::unique_ptr<T>& reco::shower::ShowerUniqueAssnPtr< T >::GetPtr ( )
inline

Definition at line 169 of file ShowerProducedPtrsHolder.hh.

Referenced by reco::shower::ShowerProducedPtrsHolder::AddSingle(), and reco::shower::ShowerProducedPtrsHolder::GetPtr().

170  {
171  if (ptr) { return showeruniqueptr; }
172  else {
173  throw cet::exception("ShowerUniqueAssnPtr") << "Element does not exist" << std::endl;
174  }
175  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
std::string reco::shower::ShowerUniqueAssnPtr< T >::GetType ( ) const
inlineoverridevirtual

Implements reco::shower::ShowerUniqueProduerPtrBase.

Definition at line 191 of file ShowerProducedPtrsHolder.hh.

192  {
193  return cet::demangle_symbol(typeid(showeruniqueptr.get()).name());
194  }
virtual int reco::shower::ShowerUniqueProduerPtrBase::GetVectorPtrSize ( ) const
inlinevirtualinherited

Reimplemented in reco::shower::ShowerUniqueProductPtr< std::vector< T > >.

Definition at line 75 of file ShowerProducedPtrsHolder.hh.

75 { return -1; }
template<class T>
void reco::shower::ShowerUniqueAssnPtr< T >::MoveToEvent ( art::Event evt)
inlineoverridevirtual

Implements reco::shower::ShowerUniqueProduerPtrBase.

Definition at line 180 of file ShowerProducedPtrsHolder.hh.

References art::Event::put().

180 { evt.put(std::move(showeruniqueptr), InstanceName); }
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
template<class T>
void reco::shower::ShowerUniqueAssnPtr< T >::reset ( )
inlineoverridevirtual

Implements reco::shower::ShowerUniqueProduerPtrBase.

Definition at line 177 of file ShowerProducedPtrsHolder.hh.

177 { showeruniqueptr.reset(new T()); }

Member Data Documentation

template<class T>
std::string reco::shower::ShowerUniqueAssnPtr< T >::InstanceName
private

Definition at line 207 of file ShowerProducedPtrsHolder.hh.

template<class T>
bool reco::shower::ShowerUniqueAssnPtr< T >::ptr
private

Definition at line 204 of file ShowerProducedPtrsHolder.hh.

template<class T>
std::unique_ptr<T> reco::shower::ShowerUniqueAssnPtr< T >::showeruniqueptr
private

Definition at line 201 of file ShowerProducedPtrsHolder.hh.


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