artdaq  v3_09_00
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 #include "fhiclcpp/fwd.h"
7 
8 #include <memory>
9 
10 namespace artdaq {
16 typedef std::unique_ptr<artdaq::RoutingManagerPolicy> makeFunc_t(fhicl::ParameterSet const& ps);
17 } // namespace artdaq
18 
19 #ifndef EXTERN_C_FUNC_DECLARE_START
20 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
21 #endif
22 
23 #define DEFINE_ARTDAQ_ROUTING_POLICY(klass) \
24  EXTERN_C_FUNC_DECLARE_START \
25  std::unique_ptr<artdaq::RoutingManagerPolicy> \
26  make(fhicl::ParameterSet const& ps) \
27  { \
28  return std::unique_ptr<artdaq::RoutingManagerPolicy>(new klass(ps)); \
29  } \
30  }
31 
32 #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.