artdaq  v3_12_02
PolicyMacros.hh
1 #ifndef artdaq_Application_Routing_PolicyMacros_hh
2 #define artdaq_Application_Routing_PolicyMacros_hh
3 
4 #include "artdaq/RoutingPolicies/RoutingManagerPolicy.hh"
5 #include "cetlib/compiler_macros.h"
6 
7 namespace fhicl {
8 class ParameterSet;
9 }
10 
11 #include <memory>
12 
13 namespace artdaq {
19 typedef std::unique_ptr<artdaq::RoutingManagerPolicy> makeFunc_t(fhicl::ParameterSet const& ps);
20 } // namespace artdaq
21 
22 #ifndef EXTERN_C_FUNC_DECLARE_START
23 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
24 #endif
25 
26 #define DEFINE_ARTDAQ_ROUTING_POLICY(klass) \
27  EXTERN_C_FUNC_DECLARE_START \
28  std::unique_ptr<artdaq::RoutingManagerPolicy> \
29  make(fhicl::ParameterSet const& ps) \
30  { \
31  return std::unique_ptr<artdaq::RoutingManagerPolicy>(new klass(ps)); \
32  } \
33  }
34 
35 #endif /* artdaq_Application_Routing_PolicyMacros_hh */
std::unique_ptr< artdaq::CommandableFragmentGenerator > makeFunc_t(fhicl::ParameterSet const &ps)
Constructs a CommandableFragmentGenerator instance, and returns a pointer to it.