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
26 
27 // forward declarations
28 
29 // macros
30 #define INSTANTIATE_RESOLVER(record_, type_) template class ProductResolverWrapper<record_, type_>;
31 
32 #define ONLY_REGISTER_PLUGIN(record_, type_) \
33  typedef ProductResolverWrapper<record_, type_> EDM_PLUGIN_SYM(ProductResolver, __LINE__); \
34  DEFINE_EDM_PLUGIN(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, __LINE__), #record_ "@NewProxy")
35 
36 #define REGISTER_PLUGIN(record_, type_) \
37  INSTANTIATE_RESOLVER(record_, type_) \
38  ONLY_REGISTER_PLUGIN(record_, type_)
39 
40 #define INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
41  template class ProductResolverWrapper<record_, type_, initializer_>;
42 
43 #define ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_) \
44  typedef ProductResolverWrapper<record_, type_, initializer_> EDM_PLUGIN_SYM(ProductResolver, __LINE__); \
45  DEFINE_EDM_PLUGIN(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, __LINE__), #record_ "@NewProxy")
46 
47 #define REGISTER_PLUGIN_INIT(record_, type_, initializer_) \
48  INSTANTIATE_RESOLVER_INIT(record_, type_, initializer_) \
49  ONLY_REGISTER_PLUGIN_INIT(record_, type_, initializer_)
50 
51 // source_ is the record name of the keyed objects
52 #define REGISTER_KEYLIST_PLUGIN(record_, type_, source_) \
53  template class ProductResolverWrapper<record_, type_>; \
54  struct EDM_PLUGIN_SYM(ProductResolver, record_) : public ProductResolverWrapper<record_, type_> { \
55  EDM_PLUGIN_SYM(ProductResolver, record_)() : ProductResolverWrapper<record_, type_>(#source_){}; \
56  }; \
57  DEFINE_EDM_PLUGIN(cond::ProductResolverFactory, EDM_PLUGIN_SYM(ProductResolver, record_), #record_ "@NewProxy")
58 
59 #endif /* CONDCORE_ESSOURCES_REGISTRATION_MACROS_H */