artdaq_mfextensions  v1_03_05
ReceiverMacros.hh
1 #ifndef mfextensions_Receivers_ReceiverMacros_hh
2 #define mfextensions_Receivers_ReceiverMacros_hh
3 
4 #include "fhiclcpp/fwd.h"
5 #include "mfextensions/Receivers/MVReceiver.hh"
6 
7 #include <memory>
8 #include "cetlib/compiler_macros.h"
9 
10 namespace mfviewer {
16 typedef std::unique_ptr<mfviewer::MVReceiver> makeFunc_t(fhicl::ParameterSet const& ps);
17 } // namespace mfviewer
18 
19 #ifndef EXTERN_C_FUNC_DECLARE_START
20 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
21 #endif
22 
23 #define DEFINE_MFVIEWER_RECEIVER(klass) \
24  EXTERN_C_FUNC_DECLARE_START \
25  std::unique_ptr<mfviewer::MVReceiver> make(fhicl::ParameterSet const& ps) { \
26  return std::unique_ptr<mfviewer::MVReceiver>(new klass(ps)); \
27  } \
28  }
29 #endif /* mfextensions_Receivers_RecevierMacros_h */