CMS 3D CMS Logo

registration_macros.h
Go to the documentation of this file.
1 #ifndef CONDCORE_ESSOURCES_REGISTRATION_MACROS_H
2 #define CONDCORE_ESSOURCES_REGISTRATION_MACROS_H
3 // -*- C++ -*-
4 //
5 // Package: ESSources
6 // Class : registration_macros
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Jul 25 06:47:37 EDT 2005
19 //
20 
21 // system include files
22 
23 // user include files
27 
28 // forward declarations
29 
30 // macros
31 #define INSTANTIATE_RESOLVER(record_, type_) template class ProductResolverWrapper<record_, type_>;
32 
33 #define ONLY_REGISTER_PLUGIN(record_, type_) \
34  typedef ProductResolverWrapper<record_, type_> EDM_PLUGIN_SYM(ProductResolver, __LINE__); \
35  DEFINE_EDM_PLUGIN2(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, __LINE__), #record_ "@NewProxy")
36 
37 #define REGISTER_PLUGIN(record_, type_) \
38  INSTANTIATE_RESOLVER(record_, type_) \
39  DEFINE_COND_SERIAL_REGISTER_PLUGIN(type_); \
40  ONLY_REGISTER_PLUGIN(record_, type_)
41 
42 #define REGISTER_PLUGIN_NO_SERIAL(record_, type_) \
43  INSTANTIATE_RESOLVER(record_, type_) \
44  ONLY_REGISTER_PLUGIN(record_, type_)
45 
46 #define INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
47  template class ProductResolverWrapper<record_, type_, initializer_>;
48 
49 #define ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_) \
50  typedef ProductResolverWrapper<record_, type_, initializer_> EDM_PLUGIN_SYM(ProductResolver, __LINE__); \
51  DEFINE_EDM_PLUGIN2(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, __LINE__), #record_ "@NewProxy")
52 
53 #define REGISTER_PLUGIN_INIT(record_, type_, initializer_) \
54  INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
55  DEFINE_COND_SERIAL_REGISTER_PLUGIN_INIT(type_, initializer_); \
56  ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_)
57 
58 #define REGISTER_PLUGIN_NO_SERIAL_INIT(record_, type_, initializer_) \
59  INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
60  ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_)
61 
62 // source_ is the record name of the keyed objects
63 #define REGISTER_KEYLIST_PLUGIN(record_, type_, source_) \
64  template class ProductResolverWrapper<record_, type_>; \
65  struct EDM_PLUGIN_SYM(ProductResolver, record_) : public ProductResolverWrapper<record_, type_> { \
66  EDM_PLUGIN_SYM(ProductResolver, record_)() : ProductResolverWrapper<record_, type_>(#source_){}; \
67  }; \
68  DEFINE_EDM_PLUGIN(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, record_), #record_ "@NewProxy")
69 
70 #endif /* CONDCORE_ESSOURCES_REGISTRATION_MACROS_H */