LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::ServiceDirector Class Reference

#include "ServiceDirector.h"

Public Member Functions

 ServiceDirector (fhicl::ParameterSet &&services, ActivityRegistry &areg, ServiceToken &token)
 
template<typename SERVICE , typename... ARGS>
void addSystemService (ARGS &&...args)
 

Private Attributes

ServiceTokenserviceToken_
 

Detailed Description

Definition at line 18 of file ServiceDirector.h.

Constructor & Destructor Documentation

art::ServiceDirector::ServiceDirector ( fhicl::ParameterSet &&  services,
ActivityRegistry areg,
ServiceToken token 
)
explicit

Definition at line 64 of file ServiceDirector.cc.

References art::ServiceRegistry::createSet(), and serviceToken_.

67  : serviceToken_{serviceToken}
68 {
70  ServiceRegistry::createSet(extractServices(std::move(services)), areg);
71 }
static ServiceToken createSet(ParameterSets const &, ActivityRegistry &)
ServiceToken & serviceToken_

Member Function Documentation

template<typename SERVICE , typename... ARGS>
void art::ServiceDirector::addSystemService ( ARGS &&...  args)

Definition at line 33 of file ServiceDirector.h.

References art::ServiceToken::add(), art::detail::bold_fontify(), art::errors::Configuration, e, SERVICE, serviceToken_, and fhicl::detail::validationException::what().

33  {
34  serviceToken_.add(std::make_unique<SERVICE>(std::forward<ARGS>(args)...));
35 }
37  constexpr cet::HorizontalRule rule{100};
39  << "\n"
40  << rule('=') << "\n\n"
41  << "!! The following service has been misconfigured: !!"
42  << "\n\n"
43  << rule('-') << "\n\nservice_type: "
44  << art::detail::bold_fontify(cet::demangle_symbol(typeid(SERVICE).name()))
45  << "\n\n"
46  << e.what() << "\n"
47  << rule('=') << "\n\n";
48 }
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:9
void add(std::unique_ptr< T > &&serv)
Definition: ServiceToken.h:46
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
char const * what() const noexcept override
Float_t e
Definition: plot.C:34
ServiceToken & serviceToken_

Member Data Documentation

ServiceToken& art::ServiceDirector::serviceToken_
private

Definition at line 28 of file ServiceDirector.h.

Referenced by addSystemService(), and ServiceDirector().


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