00001 #ifndef artdaq_core_Generators_GeneratorMacros_hh
00002 #define artdaq_core_Generators_GeneratorMacros_hh
00003
00004 #include "artdaq-core/Generators/FragmentGenerator.hh"
00005 #include "fhiclcpp/fwd.h"
00006
00007 #include <memory>
00008 #include "cetlib/compiler_macros.h"
00009
00010 namespace artdaq {
00016 typedef std::unique_ptr<artdaq::FragmentGenerator> makeFunc_t(fhicl::ParameterSet const& ps);
00017 }
00018
00019 #ifndef EXTERN_C_FUNC_DECLARE_START
00020 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
00021 #endif
00022
00023 #define DEFINE_ARTDAQ_GENERATOR(klass) \
00024 \
00029 EXTERN_C_FUNC_DECLARE_START \
00030 std::unique_ptr<artdaq::FragmentGenerator> \
00031 make(fhicl::ParameterSet const& ps) \
00032 { \
00033 return std::unique_ptr<artdaq::FragmentGenerator>(new klass(ps)); \
00034 } \
00035 }
00036
00037 #endif