All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
49 #include "art/Framework/Services/Registry/ActivityRegistry.h"
50 #include "art/Framework/Services/Registry/ServicesManager.h"
51 #include "art/Utilities/SharedResource.h"
52 
53 #include <iosfwd>
54 #include <map>
55 #include <string>
56 
58 public:
59  static void load_services(std::string const& config);
60 
61 private:
62  explicit ArtServiceHelper(fhicl::ParameterSet&& pset);
63  art::ActivityRegistry activityRegistry_;
64  art::detail::SharedResources sharedResources_;
65  art::ServicesManager servicesManager_;
66 };
67 
68 #endif
static void load_services(std::string const &config)
art::ActivityRegistry activityRegistry_
art::ServicesManager servicesManager_
ArtServiceHelper(fhicl::ParameterSet &&pset)
art::detail::SharedResources sharedResources_