Public Member Functions | Private Attributes | List of all members
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.

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

Member Function Documentation

template<typename T, ServiceScope SCOPE = detail::ServiceHelper<std::remove_const_t<T>>::scope_val>
T* art::ServiceHandle< T, SCOPE >::get ( ) 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 60 of file ServiceHandle.h.

60 { return *instance; }
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 58 of file ServiceHandle.h.

58 { return instance; }

Member Data Documentation

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

Definition at line 69 of file ServiceHandle.h.


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