artdaq_core  v1_07_00
 All Classes Namespaces Functions
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  typedef std::unique_ptr<artdaq::FragmentGenerator>
11  (makeFunc_t) (fhicl::ParameterSet const & ps);
12 }
13 
14 #define DEFINE_ARTDAQ_GENERATOR(klass) \
15  extern "C" \
16  std::unique_ptr<artdaq::FragmentGenerator> \
17  make(fhicl::ParameterSet const & ps) { \
18  return std::unique_ptr<artdaq::FragmentGenerator>(new klass(ps)); \
19  }
20 
21 #endif /* artdaq_core_Generators_GeneratorMacros_hh */