tdaq-develop-2025-02-12
InterfacePluginMacros.h
1 #ifndef _ots_InterfacePluginMacro_h_
2 #define _ots_InterfacePluginMacro_h_
3 
4 #include <memory>
5 #include "cetlib/compiler_macros.h"
6 #include "otsdaq/FECore/FEVInterface.h"
7 
8 #ifndef EXTERN_C_FUNC_DECLARE_START
9 #define EXTERN_C_FUNC_DECLARE_START extern "C" {
10 #endif
11 
12 #define DEFINE_OTS_INTERFACE(klass) \
13  EXTERN_C_FUNC_DECLARE_START \
14  std::unique_ptr<ots::FEVInterface> make( \
15  const std::string& interfaceUID, \
16  const ots::ConfigurationTree& configurationTree, \
17  const std::string& pathToInterfaceConfiguration) \
18  { \
19  return std::unique_ptr<ots::FEVInterface>( \
20  new klass(interfaceUID, configurationTree, pathToInterfaceConfiguration)); \
21  } \
22  }
23 
24 #endif /* _ots_InterfacePluginMacro_h_ */