Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CondFormats_External_PIXELFEDCHANNEL_H
0002 #define CondFormats_External_PIXELFEDCHANNEL_H
0003 
0004 #include <boost/serialization/base_object.hpp>
0005 #include <boost/serialization/nvp.hpp>
0006 #include <boost/serialization/split_free.hpp>
0007 
0008 #include <boost/serialization/vector.hpp>
0009 #include <boost/serialization/string.hpp>
0010 #include <boost/serialization/map.hpp>
0011 
0012 #include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"
0013 
0014 // struct PixelFEDChannel {
0015 //   unsigned int fed, link, roc_first, roc_last;
0016 // };
0017 
0018 namespace boost {
0019   namespace serialization {
0020 
0021     /*
0022      * Note regarding object tracking: all autos used here
0023      * must resolve to untracked types, since we use local
0024      * variables in the stack which could end up with the same
0025      * address. For the moment, all types resolved by auto here
0026      * are primitive types, which are untracked by default
0027      * by Boost Serialization.
0028      */
0029 
0030     template <class Archive>
0031     void save(Archive& ar, const PixelFEDChannel& obj, const unsigned int) {
0032       auto fed = obj.fed;
0033       auto link = obj.link;
0034       auto roc_first = obj.roc_first;
0035       auto roc_last = obj.roc_last;
0036       ar& boost::serialization::make_nvp("fed_", fed);
0037       ar& boost::serialization::make_nvp("link_", link);
0038       ar& boost::serialization::make_nvp("roc_first_", roc_first);
0039       ar& boost::serialization::make_nvp("roc_last_", roc_last);
0040     }
0041 
0042     template <class Archive>
0043     void load(Archive& ar, PixelFEDChannel& obj, const unsigned int) {
0044       unsigned int fed_;
0045       unsigned int link_;
0046       unsigned int roc_first_;
0047       unsigned int roc_last_;
0048 
0049       ar& boost::serialization::make_nvp("fed_", fed_);
0050       ar& boost::serialization::make_nvp("link_", link_);
0051       ar& boost::serialization::make_nvp("roc_first_", roc_first_);
0052       ar& boost::serialization::make_nvp("roc_last_", roc_last_);
0053       PixelFEDChannel tmp{fed_, link_, roc_first_, roc_last_};
0054       obj = tmp;
0055     }
0056 
0057     template <class Archive>
0058     void serialize(Archive& ar, PixelFEDChannel& obj, const unsigned int v) {
0059       split_free(ar, obj, v);
0060     }
0061 
0062   }  // namespace serialization
0063 }  // namespace boost
0064 
0065 #endif