artdaq_core  v3_01_04
GeneratorMacros.hh
1 #ifndef artdaq_core_Generators_GeneratorMacros_hh
2 #define artdaq_core_Generators_GeneratorMacros_hh
3 
4 #include "artdaq-core/Generators/FragmentGenerator.hh"
5 #include "fhiclcpp/fwd.h"
6 
7 #include <memory>
8 
9 namespace artdaq
10 {
16  typedef std::unique_ptr<artdaq::FragmentGenerator> makeFunc_t(fhicl::ParameterSet const& ps);
17 }
18 
19 #define DEFINE_ARTDAQ_GENERATOR(klass) \
20  \
25  extern "C" \
26  std::unique_ptr<artdaq::FragmentGenerator> \
27  make(fhicl::ParameterSet const & ps) { \
28  return std::unique_ptr<artdaq::FragmentGenerator>(new klass(ps)); \
29  }
30 
31 #endif /* artdaq_core_Generators_GeneratorMacros_hh */
std::unique_ptr< artdaq::FragmentGenerator > makeFunc_t(fhicl::ParameterSet const &ps)
Constructs a FragmentGenerator instance, and returns a pointer to it.