Classes | Public Types | Public Member Functions | Private Attributes | List of all members
art::ValidHandle< T > Class Template Reference

#include <Handle.h>

Classes

class  HandleTag
 

Public Types

typedef T element_type
 

Public Member Functions

 ~ValidHandle ()=default
 
 ValidHandle ()=delete
 
 ValidHandle (T const *prod, Provenance prov)
 
 ValidHandle (ValidHandle const &)=default
 
 ValidHandle (ValidHandle &&)=default
 
ValidHandleoperator= (ValidHandle const &)&=default
 
ValidHandleoperator= (ValidHandle &&)&=default
 
 operator T const * () const
 
T const & operator* () const
 
T const * operator-> () const
 
T const * product () const
 
bool isValid () const
 
bool failedToGet () const
 
Provenance const * provenance () const
 
ProductID id () const
 
std::shared_ptr< art::Exception const > whyFailed () const
 
void swap (ValidHandle< T > &other)
 

Private Attributes

T const * prod_
 
Provenance prov_
 

Detailed Description

template<typename T>
class art::ValidHandle< T >

Definition at line 48 of file Handle.h.

Member Typedef Documentation

template<typename T>
typedef T art::ValidHandle< T >::element_type

Definition at line 258 of file Handle.h.

Constructor & Destructor Documentation

template<typename T>
art::ValidHandle< T >::~ValidHandle ( )
default
template<typename T>
art::ValidHandle< T >::ValidHandle ( )
delete
template<class T >
art::ValidHandle< T >::ValidHandle ( T const *  prod,
Provenance  prov 
)
explicit

Definition at line 294 of file Handle.h.

295  : prod_{prod}, prov_{prov}
296 {
297  if (prod == nullptr) {
299  << "Attempt to create ValidHandle with null pointer";
300  }
301 }
Provenance prov_
Definition: Handle.h:290
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
T const * prod_
Definition: Handle.h:289
template<typename T>
art::ValidHandle< T >::ValidHandle ( ValidHandle< T > const &  )
default
template<typename T>
art::ValidHandle< T >::ValidHandle ( ValidHandle< T > &&  )
default

Member Function Documentation

template<class T >
bool art::ValidHandle< T >::failedToGet ( ) const
inline

Definition at line 337 of file Handle.h.

338 {
339  return false;
340 }
template<class T >
art::ProductID art::ValidHandle< T >::id ( ) const
inline

Definition at line 351 of file Handle.h.

352 {
353  return prov_.productID();
354 }
Provenance prov_
Definition: Handle.h:290
ProductID productID() const noexcept
Definition: Provenance.cc:72
template<class T >
bool art::ValidHandle< T >::isValid ( ) const
inline

Definition at line 330 of file Handle.h.

331 {
332  return true;
333 }
template<class T >
art::ValidHandle< T >::operator T const * ( ) const
inline

Definition at line 304 of file Handle.h.

305 {
306  return prod_;
307 }
T const * prod_
Definition: Handle.h:289
template<class T >
T const & art::ValidHandle< T >::operator* ( ) const
inline

Definition at line 310 of file Handle.h.

311 {
312  return *prod_;
313 }
T const * prod_
Definition: Handle.h:289
template<class T >
T const * art::ValidHandle< T >::operator-> ( ) const
inline

Definition at line 316 of file Handle.h.

317 {
318  return prod_;
319 }
T const * prod_
Definition: Handle.h:289
template<typename T>
ValidHandle& art::ValidHandle< T >::operator= ( ValidHandle< T > const &  )
default
template<typename T>
ValidHandle& art::ValidHandle< T >::operator= ( ValidHandle< T > &&  )
default
template<class T >
T const * art::ValidHandle< T >::product ( ) const
inline

Definition at line 323 of file Handle.h.

324 {
325  return prod_;
326 }
T const * prod_
Definition: Handle.h:289
template<class T >
art::Provenance const * art::ValidHandle< T >::provenance ( ) const
inline

Definition at line 344 of file Handle.h.

345 {
346  return &prov_;
347 }
Provenance prov_
Definition: Handle.h:290
template<class T >
void art::ValidHandle< T >::swap ( art::ValidHandle< T > &  other)
inline

Definition at line 365 of file Handle.h.

366 {
367  std::swap(*this, other);
368 }
void swap(ValidHandle< T > &a, ValidHandle< T > &b)
template<class T >
std::shared_ptr< art::Exception const > art::ValidHandle< T >::whyFailed ( ) const
inline

Definition at line 358 of file Handle.h.

359 {
360  return std::shared_ptr<art::Exception const>();
361 }

Member Data Documentation

template<typename T>
T const* art::ValidHandle< T >::prod_
private

Definition at line 289 of file Handle.h.

template<typename T>
Provenance art::ValidHandle< T >::prov_
private

Definition at line 290 of file Handle.h.


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