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 "cetlib/compiler_macros.h"
00008 #include <memory>
00009
00010 namespace artdaq
00011 {
00017 typedef std::unique_ptr<artdaq::FragmentGenerator> makeFunc_t(fhicl::ParameterSet const& ps);
00018 }
00019
00020 #ifndef EXTERN_C_FUNC_DECLARE_START
00021 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
00022 #endif
00023
00024 #define DEFINE_ARTDAQ_GENERATOR(klass) \
00025 \
00030 EXTERN_C_FUNC_DECLARE_START \
00031 std::unique_ptr<artdaq::FragmentGenerator> \
00032 make(fhicl::ParameterSet const & ps) { \
00033 return std::unique_ptr<artdaq::FragmentGenerator>(new klass(ps)); \
00034 }}
00035
00036 #endif