ServiceDirector.h
Go to the documentation of this file.
1 #ifndef art_Framework_EventProcessor_ServiceDirector_h
2 #define art_Framework_EventProcessor_ServiceDirector_h
8 #include "cetlib_except/demangle.h"
11 
12 #include <memory>
13 
14 namespace art {
15  class ServiceDirector;
16 }
17 
19 public:
20  explicit ServiceDirector(fhicl::ParameterSet&& services,
21  ActivityRegistry& areg,
23 
24  template <typename SERVICE, typename... ARGS>
25  void addSystemService(ARGS&&... args);
26 
27 private:
29 };
30 
31 template <typename SERVICE, typename... ARGS>
32 void
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 }
49 
50 #endif /* art_Framework_EventProcessor_ServiceDirector_h */
51 
52 // Local Variables:
53 // mode: c++
54 // End:
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:9
const XML_Char * name
Definition: expat.h:151
void add(std::unique_ptr< T > &&serv)
Definition: ServiceToken.h:46
ServiceDirector(fhicl::ParameterSet &&services, ActivityRegistry &areg, ServiceToken &token)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
char const * what() const noexcept override
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
void addSystemService(ARGS &&...args)
Float_t e
Definition: plot.C:35
::xsd::cxx::tree::token< char, normalized_string > token
Definition: Database.h:156
ServiceToken & serviceToken_