LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ServiceDefinitionMacros.h
Go to the documentation of this file.
1 #ifndef art_Framework_Services_Registry_ServiceDefinitionMacros_h
2 #define art_Framework_Services_Registry_ServiceDefinitionMacros_h
3 // ServiceDefinitionMacros - define the macros used to define an art
5 // service.
6 //
7 // Notes:
8 //
9 // * Unlike modules, services require macro invocations in their headers
10 // *and* their compile units: see ServiceDeclarationMacros.h.
11 //
12 // * In the case where there is a user-callable interface (i.e. a public
13 // header), the <service>_service.cc compilation unit should contain
14 // *only* the appropriate definition macro and include the appropriate
15 // header(s) to define the types used.
16 //
18 // User-callable macros:
19 //
20 // DEFINE_ART_SERVICE(svc)
21 // Define (in MyService_service.cc) the service declared with
22 // DECLARE_ART_SERVICE.
23 //
24 // DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)
25 // Define an art service of type <svc> implementing (inheriting from)
26 // interface <iface>, with scope <scope>.
29 #include "cetlib/ProvideFilePathMacro.h"
31 
32 // User service macros, Service must provide a constructor with the
33 // correct signature (see notes above).
34 
35 // Define a service.
36 #define DEFINE_ART_SERVICE(svc) \
37  DEFINE_ART_SH_CREATE(svc) \
38  CET_PROVIDE_FILE_PATH() \
39  FHICL_PROVIDE_ALLOWED_CONFIGURATION(svc)
40 
41 // Define a service implementing an interface.
42 #define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface) \
43  DEFINE_ART_SERVICE(svc) \
44  DEFINE_ART_SIH_CREATE(iface)
45 
46 #endif /* art_Framework_Services_Registry_ServiceDefinitionMacros_h */
47 
48 // Local Variables:
49 // mode: c++
50 // End: