Public Member Functions | Private Attributes | List of all members
art::ServiceHandle< T, SCOPE > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v3_05_01/source/art/Framework/Services/Registry/ServiceHandle.h"

Public Member Functions

 ServiceHandle ()
 
Toperator-> () const
 
Toperator* () const
 
Tget () const
 

Private Attributes

Tinstance
 

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

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.

Referenced by calib::Calibrator::GetAttenCurve(), and art::TimeTracker::TimeTracker().

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

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