File indexing completed on 2024-09-07 04:35:29
0001 #ifndef CONDCORE_ESSOURCES_REGISTRATION_MACROS_H
0002 #define CONDCORE_ESSOURCES_REGISTRATION_MACROS_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "CondCore/ESSources/interface/ProductResolverFactory.h"
0025 #include "CondCore/ESSources/interface/ProductResolver.h"
0026 #include "CondFormats/SerializationHelper/interface/SerializationHelperFactory.h"
0027
0028
0029
0030
0031 #define INSTANTIATE_RESOLVER(record_, type_) template class ProductResolverWrapper<record_, type_>;
0032
0033 #define ONLY_REGISTER_PLUGIN(record_, type_) \
0034 typedef ProductResolverWrapper<record_, type_> EDM_PLUGIN_SYM(ProductResolver, __LINE__); \
0035 DEFINE_EDM_PLUGIN2(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, __LINE__), #record_ "@NewProxy")
0036
0037 #define REGISTER_PLUGIN(record_, type_) \
0038 INSTANTIATE_RESOLVER(record_, type_) \
0039 DEFINE_COND_SERIAL_REGISTER_PLUGIN(type_); \
0040 ONLY_REGISTER_PLUGIN(record_, type_)
0041
0042 #define REGISTER_PLUGIN_NO_SERIAL(record_, type_) \
0043 INSTANTIATE_RESOLVER(record_, type_) \
0044 ONLY_REGISTER_PLUGIN(record_, type_)
0045
0046 #define INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
0047 template class ProductResolverWrapper<record_, type_, initializer_>;
0048
0049 #define ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_) \
0050 typedef ProductResolverWrapper<record_, type_, initializer_> EDM_PLUGIN_SYM(ProductResolver, __LINE__); \
0051 DEFINE_EDM_PLUGIN2(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, __LINE__), #record_ "@NewProxy")
0052
0053 #define REGISTER_PLUGIN_INIT(record_, type_, initializer_) \
0054 INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
0055 DEFINE_COND_SERIAL_REGISTER_PLUGIN_INIT(type_, initializer_); \
0056 ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_)
0057
0058 #define REGISTER_PLUGIN_NO_SERIAL_INIT(record_, type_, initializer_) \
0059 INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
0060 ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_)
0061
0062
0063 #define REGISTER_KEYLIST_PLUGIN(record_, type_, source_) \
0064 template class ProductResolverWrapper<record_, type_>; \
0065 struct EDM_PLUGIN_SYM(ProductResolver, record_) : public ProductResolverWrapper<record_, type_> { \
0066 EDM_PLUGIN_SYM(ProductResolver, record_)() : ProductResolverWrapper<record_, type_>(#source_) {} \
0067 }; \
0068 DEFINE_EDM_PLUGIN(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, record_), #record_ "@NewProxy")
0069
0070 #endif