ArtServiceHelper.h
Go to the documentation of this file.
1 // ArtServiceHelper.h
2 
3 #ifndef ArtServiceHelper_H
4 #define ArtServiceHelper_H
5 
6 // =================================================================
7 // The purpose of the 'ArtServiceHelper' class is to construct and
8 // manage a set of art services that normally appear in an art job.
9 // In some circumstances, the available means of testing a new
10 // algorithm may rely on functionality that has been expressed in
11 // terms of an art service. In such a case, the ArtServiceHelper
12 // class can be used to initialize the required services and allow
13 // users to create art::ServiceHandle objects for the configured
14 // services.
15 //
16 // Unlike the art framework's services manager, the ArtServiceHelper
17 // is not aware of framework transitions. Because of that, using some
18 // services outside of the context of the framework will not reflect
19 // the same behavior as using them within it. For that reason, using
20 // such services outside of the framework is circumspect. This must
21 // be taken into account when using this class.
22 //
23 // Configuration layout
24 // ====================
25 //
26 // The allowed configuration layout is of two forms. The minimal form
27 // lists all desired services by themselves:
28 //
29 // Service1: {...}
30 // Service2: {...}
31 // ServiceN: {...}
32 //
33 // The other form nests these services inside of a 'services' table,
34 // which supports cases when it is desired to use a configuration file
35 // that would be used for an art job:
36 //
37 // services: {
38 // Service1: {...}
39 // Service2: {...}
40 // ServiceN: {...}
41 // }
42 //
43 // As in art, it is not necessary to specify the 'service_type'
44 // parameter for each service--the ArtServiceHelper class inserts
45 // those configuration parameters automatically.
46 //
47 // =================================================================
48 
52 
53 #include <iosfwd>
54 #include <map>
55 #include <string>
56 
57 class ArtServiceHelper {
58 public:
59  static void load_services(std::string const& config);
60 
61 private:
62  explicit ArtServiceHelper(fhicl::ParameterSet&& pset);
66 };
67 
68 #endif
std::string string
Definition: nybbler.cc:12
static void load_services(std::string const &config)
art::ActivityRegistry activityRegistry_
static Config * config
Definition: config.cpp:1054
art::ServicesManager servicesManager_
ArtServiceHelper(fhicl::ParameterSet &&pset)
art::detail::SharedResources sharedResources_