Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:33

0001 #ifndef CondFormats_SerializationHelper_SerializationHelperBase_h
0002 #define CondFormats_SerializationHelper_SerializationHelperBase_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     CondFormats/SerializationHelper
0006 // Class  :     SerializationHelperBase
0007 //
0008 /**\class SerializationHelperBase SerializationHelperBase.h "CondFormats/SerializationHelper/interface/SerializationHelperBase.h"
0009 
0010  Description: abstract base class for helper that can serialize/deserialize conditions data products in a type hidden way.
0011 
0012  Usage:
0013     This is used in conjunction with the SerializationHelperFactory.
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Wed, 31 May 2023 14:45:56 GMT
0019 //
0020 
0021 // system include files
0022 #include <string_view>
0023 
0024 // user include files
0025 #include "CondFormats/SerializationHelper/interface/unique_void_ptr.h"
0026 
0027 // forward declarations
0028 
0029 namespace cond::serialization {
0030   class SerializationHelperBase {
0031   public:
0032     SerializationHelperBase() = default;
0033     virtual ~SerializationHelperBase() = default;
0034 
0035     SerializationHelperBase(const SerializationHelperBase&) = delete;                   // stop default
0036     const SerializationHelperBase& operator=(const SerializationHelperBase&) = delete;  // stop default
0037 
0038     // ---------- const member functions ---------------------
0039     virtual unique_void_ptr deserialize(std::streambuf&, const std::string_view iClassName) const = 0;
0040 
0041     //returns name of type serialized. This is needed for polymorphism storage
0042     virtual std::string_view serialize(std::streambuf&, void const*) const = 0;
0043     virtual const std::type_info& type() const = 0;
0044   };
0045 }  // namespace cond::serialization
0046 #endif