File indexing completed on 2024-04-06 12:02:33
0001 #ifndef CondFormats_SerializationHelper_SerializationHelperFactory_h
0002 #define CondFormats_SerializationHelper_SerializationHelperFactory_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "FWCore/PluginManager/interface/PluginFactory.h"
0025 #include "CondFormats/SerializationHelper/interface/SerializationHelper.h"
0026
0027
0028
0029 namespace cond::serialization {
0030 using SerializationHelperFactory = edmplugin::PluginFactory<SerializationHelperBase*()>;
0031 }
0032
0033 #define DEFINE_COND_CLASSNAME(type_) \
0034 namespace cond::serialization { \
0035 template <> \
0036 struct ClassName<type_> { \
0037 constexpr static std::string_view kName = #type_; \
0038 }; \
0039 }
0040
0041 #define DEFINE_COND_SERIAL_REGISTER_PLUGIN(type_) \
0042 DEFINE_COND_CLASSNAME(type_) \
0043 DEFINE_EDM_PLUGIN( \
0044 cond::serialization::SerializationHelperFactory, cond::serialization::SerializationHelper<type_>, #type_)
0045
0046 #define DEFINE_COND_SERIAL_REGISTER_PLUGIN_INIT(type_, init_) \
0047 namespace cond::serialization { \
0048 template <> \
0049 struct ClassName<type_> { \
0050 constexpr static std::string_view kName = #type_; \
0051 }; \
0052 } \
0053 using EDM_PLUGIN_SYM(SerializationHelper, __LINE__) = cond::serialization::SerializationHelper<type_, init_>; \
0054 DEFINE_EDM_PLUGIN( \
0055 cond::serialization::SerializationHelperFactory, EDM_PLUGIN_SYM(SerializationHelper, __LINE__), #type_)
0056
0057 #endif