LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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, art::ServiceScope SCOPE>
class art::ServiceHandle< T, SCOPE >

Definition at line 39 of file ServiceHandle.h.

Constructor & Destructor Documentation

template<typename T, art::ServiceScope SCOPE>
art::ServiceHandle< T, SCOPE >::ServiceHandle ( )
inline

Definition at line 53 of file ServiceHandle.h.

53  : instance {
54  &ServiceRegistry::instance().get<std::remove_const_t<T>>()
55  }
56  {
57  }
58  catch (art::Exception const& x)
59  {
61  << "Unable to create ServiceHandle.\n"
62  << "Perhaps the FHiCL configuration does not specify the necessary "
63  "service?\n"
64  << "The class of the service is noted below...\n"
65  << x;
66  }
Float_t x
Definition: compare.C:6
static ServiceRegistry & instance()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Function Documentation

template<typename T, art::ServiceScope SCOPE>
T* art::ServiceHandle< T, SCOPE >::get ( ) const
inline
template<typename T, art::ServiceScope SCOPE>
T& art::ServiceHandle< T, SCOPE >::operator* ( ) const
inline

Definition at line 69 of file ServiceHandle.h.

69 { return *instance; }
template<typename T, art::ServiceScope SCOPE>
T* art::ServiceHandle< T, SCOPE >::operator-> ( ) const
inline

Definition at line 68 of file ServiceHandle.h.

68 { return instance; }

Member Data Documentation


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