CMS 3D CMS Logo

SerializationHelperFactory.h
Go to the documentation of this file.
1 #ifndef CondFormats_SerializationHelper_SerializationHelperFactory_h
2 #define CondFormats_SerializationHelper_SerializationHelperFactory_h
3 // -*- C++ -*-
4 //
5 // Package: CondFormats/SerializationHelper
6 // Class : SerializationHelperFactory
7 //
16 //
17 // Original Author: Christopher Jones
18 // Created: Wed, 31 May 2023 14:55:17 GMT
19 //
20 
21 // system include files
22 
23 // user include files
26 
27 // forward declarations
28 
29 namespace cond::serialization {
31 }
32 
33 #define DEFINE_COND_CLASSNAME(type_) \
34  namespace cond::serialization { \
35  template <> \
36  struct ClassName<type_> { \
37  constexpr static std::string_view kName = #type_; \
38  }; \
39  }
40 
41 #define DEFINE_COND_SERIAL_REGISTER_PLUGIN(type_) \
42  DEFINE_COND_CLASSNAME(type_) \
43  DEFINE_EDM_PLUGIN( \
44  cond::serialization::SerializationHelperFactory, cond::serialization::SerializationHelper<type_>, #type_)
45 
46 #define DEFINE_COND_SERIAL_REGISTER_PLUGIN_INIT(type_, init_) \
47  namespace cond::serialization { \
48  template <> \
49  struct ClassName<type_> { \
50  constexpr static std::string_view kName = #type_; \
51  }; \
52  } \
53  using EDM_PLUGIN_SYM(SerializationHelper, __LINE__) = cond::serialization::SerializationHelper<type_, init_>; \
54  DEFINE_EDM_PLUGIN( \
55  cond::serialization::SerializationHelperFactory, EDM_PLUGIN_SYM(SerializationHelper, __LINE__), #type_)
56 
57 #endif