Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:37:26

0001 #ifndef CondFormats_SerializationHelper_SerializationHelperFactory_h
0002 #define CondFormats_SerializationHelper_SerializationHelperFactory_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     CondFormats/SerializationHelper
0006 // Class  :     SerializationHelperFactory
0007 //
0008 /**\class SerializationHelperFactory SerializationHelperFactory.h "CondFormats/SerializationHelper/interface/SerializationHelperFactory.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Wed, 31 May 2023 14:55:17 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include "FWCore/PluginManager/interface/PluginFactory.h"
0025 #include "CondFormats/SerializationHelper/interface/SerializationHelper.h"
0026 
0027 // forward declarations
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