LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::ServiceHandle< T, SCOPE > Class Template Reference

#include "ServiceHandle.h"

Public Member Functions

 ServiceHandle ()
 
T * operator-> () const
 
T & operator* () const
 
T * get () const
 

Private Attributes

T * instance
 

Detailed Description

template<typename T, ServiceScope SCOPE = detail::ServiceHelper<std::remove_const_t<T>>::scope_val>
class art::ServiceHandle< T, SCOPE >

Definition at line 37 of file ServiceHandle.h.

Constructor & Destructor Documentation

template<typename T, ServiceScope SCOPE = detail::ServiceHelper<std::remove_const_t<T>>::scope_val>
art::ServiceHandle< T, SCOPE >::ServiceHandle ( )
inline

Definition at line 44 of file ServiceHandle.h.

45  : instance{&ServiceRegistry::instance().get<std::remove_const_t<T>>()} {
46  }
47  catch (Exception const& x) {
49  << "Unable to create ServiceHandle.\n"
50  << "Perhaps the FHiCL configuration does not specify the necessary "
51  "service?\n"
52  << "The class of the service is noted below...\n"
53  << x;
54  }
Float_t x
Definition: compare.C:6
static ServiceRegistry & instance() noexcept
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Function Documentation

template<typename T, ServiceScope SCOPE = detail::ServiceHelper<std::remove_const_t<T>>::scope_val>
T& art::ServiceHandle< T, SCOPE >::operator* ( ) const
inline

Definition at line 63 of file ServiceHandle.h.

64  {
65  return *instance;
66  }
template<typename T, ServiceScope SCOPE = detail::ServiceHelper<std::remove_const_t<T>>::scope_val>
T* art::ServiceHandle< T, SCOPE >::operator-> ( ) const
inline

Definition at line 57 of file ServiceHandle.h.

58  {
59  return instance;
60  }

Member Data Documentation

template<typename T, ServiceScope SCOPE = detail::ServiceHelper<std::remove_const_t<T>>::scope_val>
T* art::ServiceHandle< T, SCOPE >::instance
private

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