LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::ValidHandle< T > Class Template Reference

#include "Handle.h"

Classes

class  HandleTag
 

Public Types

typedef T element_type
 

Public Member Functions

 ValidHandle ()=delete
 
 ValidHandle (T const *prod, Provenance prov)
 
 ValidHandle (ValidHandle const &)=default
 
ValidHandleoperator= (ValidHandle const &)&=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 259 of file Handle.h.

Constructor & Destructor Documentation

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

Definition at line 293 of file Handle.h.

References art::errors::NullPointerError, and art::ValidHandle< T >::prov_.

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

Member Function Documentation

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

Definition at line 335 of file Handle.h.

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

Definition at line 349 of file Handle.h.

References art::Provenance::productID(), and art::ValidHandle< T >::prov_.

350 {
351  return prov_.productID();
352 }
Provenance prov_
Definition: Handle.h:289
ProductID const & productID() const
Definition: Provenance.h:113
template<class T >
bool art::ValidHandle< T >::isValid ( ) const
inline

Definition at line 328 of file Handle.h.

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

Definition at line 302 of file Handle.h.

References art::ValidHandle< T >::prod_.

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

Definition at line 308 of file Handle.h.

References art::ValidHandle< T >::prod_.

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

Definition at line 314 of file Handle.h.

References art::ValidHandle< T >::prod_.

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

Definition at line 321 of file Handle.h.

References art::ValidHandle< T >::prod_.

Referenced by sim::DumpMCTruth::analyze(), and sim::DumpGTruth::analyze().

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

Definition at line 342 of file Handle.h.

References art::ValidHandle< T >::prov_.

Referenced by art::DataViewImpl::getValidHandle().

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

Definition at line 363 of file Handle.h.

References art::disjoint_ranges(), art::overlapping_ranges(), art::range_of_validity(), art::same_ranges(), art::swap(), art::detail::throw_if_invalid(), and fhicl::detail::atom::value().

364 {
365  std::swap(*this, other);
366 }
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 356 of file Handle.h.

357 {
358  return std::shared_ptr<art::Exception const>();
359 }

Member Data Documentation

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

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