Classes | Public Types | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
art::ServiceRegistry Class Reference

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

Classes

class  Operate
 

Public Types

using ParameterSets = std::vector< fhicl::ParameterSet >
 

Static Public Member Functions

template<typename T >
static bool isAvailable ()
 
static ServiceToken createSet (ParameterSets const &, ActivityRegistry &)
 

Private Member Functions

 ServiceRegistry (ServiceRegistry const &)=delete
 
ServiceRegistryoperator= (ServiceRegistry const &)=delete
 
ServiceToken presentToken () const
 
ServiceToken setContext (ServiceToken const &iNewToken)
 
void unsetContext (ServiceToken const &iOldToken)
 
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val != ServiceScope::PER_SCHEDULE>>
Tget () const
 
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val == ServiceScope::PER_SCHEDULE>>
Tget (ScheduleID sID) const
 
 ServiceRegistry ()=default
 

Static Private Member Functions

static ServiceRegistryinstance ()
 

Private Attributes

cet::LibraryManager lm_ {Suffixes::service()}
 
std::shared_ptr< ServicesManagermanager_ {nullptr}
 

Friends

class Operate
 
template<typename T , art::ServiceScope >
class ServiceHandle
 

Detailed Description

Definition at line 26 of file ServiceRegistry.h.

Member Typedef Documentation

Definition at line 65 of file ServiceRegistry.h.

Constructor & Destructor Documentation

art::ServiceRegistry::ServiceRegistry ( ServiceRegistry const &  )
privatedelete
art::ServiceRegistry::ServiceRegistry ( )
privatedefault

Referenced by get().

Member Function Documentation

static ServiceToken art::ServiceRegistry::createSet ( ParameterSets const &  ,
ActivityRegistry  
)
static
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val != ServiceScope::PER_SCHEDULE>>
T& art::ServiceRegistry::get ( ) const
inlineprivate

Definition at line 83 of file ServiceRegistry.h.

References manager_, art::PER_SCHEDULE, art::errors::ServiceNotFound, and T.

Referenced by art::ServiceHandle< art::FileTransfer >::ServiceHandle(), and art::ServiceHandle< T, art::ServiceScope::PER_SCHEDULE >::ServiceHandle().

84  {
85  if (!manager_) {
87  << " no ServiceRegistry has been set for this thread";
88  }
89  return manager_->get<T>();
90  }
std::shared_ptr< ServicesManager > manager_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
double T
Definition: Xdiff_gwt.C:5
template<typename T , typename = std::enable_if_t<detail::ServiceHelper<T>::scope_val == ServiceScope::PER_SCHEDULE>>
T& art::ServiceRegistry::get ( ScheduleID  sID) const
inlineprivate

Definition at line 96 of file ServiceRegistry.h.

References manager_, art::errors::ServiceNotFound, and ServiceRegistry().

97  {
98  if (!manager_) {
100  << " no ServiceRegistry has been set for this thread";
101  }
102  return manager_->get<T>(sID);
103  }
std::shared_ptr< ServicesManager > manager_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
double T
Definition: Xdiff_gwt.C:5
static ServiceRegistry& art::ServiceRegistry::instance ( )
staticprivate
template<typename T >
static bool art::ServiceRegistry::isAvailable ( )
inlinestatic

Definition at line 55 of file ServiceRegistry.h.

References instance(), manager_, art::errors::ServiceNotFound, and T.

56  {
57  if (auto& mgr = instance().manager_) {
58  return mgr->isAvailable<T>();
59  }
60 
62  << " no ServiceRegistry has been set for this thread";
63  }
std::shared_ptr< ServicesManager > manager_
static ServiceRegistry & instance()
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
double T
Definition: Xdiff_gwt.C:5
ServiceRegistry& art::ServiceRegistry::operator= ( ServiceRegistry const &  )
privatedelete
ServiceToken art::ServiceRegistry::presentToken ( ) const
private
ServiceToken art::ServiceRegistry::setContext ( ServiceToken const &  iNewToken)
private
void art::ServiceRegistry::unsetContext ( ServiceToken const &  iOldToken)
private

Friends And Related Function Documentation

friend class Operate
friend

Definition at line 49 of file ServiceRegistry.h.

template<typename T , art::ServiceScope >
friend class ServiceHandle
friend

Definition at line 51 of file ServiceRegistry.h.

Member Data Documentation

cet::LibraryManager art::ServiceRegistry::lm_ {Suffixes::service()}
private

Definition at line 108 of file ServiceRegistry.h.

std::shared_ptr<ServicesManager> art::ServiceRegistry::manager_ {nullptr}
private

Definition at line 109 of file ServiceRegistry.h.

Referenced by get(), and isAvailable().


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