CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Timestamp.h
Go to the documentation of this file.
1 #ifndef CondFormats_External_Timestamp_H
2 #define CondFormats_External_Timestamp_H
3 
4 #include <boost/serialization/base_object.hpp>
5 #include <boost/serialization/nvp.hpp>
6 #include <boost/serialization/split_free.hpp>
7 
8 // std::vector used in DataFormats/EcalDetId/interface/EcalContainer.h
9 #include <boost/serialization/vector.hpp>
10 #include <boost/serialization/string.hpp>
11 #include <boost/serialization/map.hpp>
12 
14 
15 namespace boost {
16 namespace serialization {
17 
18 /*
19  * Note regarding object tracking: all autos used here
20  * must resolve to untracked types, since we use local
21  * variables in the stack which could end up with the same
22  * address. For the moment, all types resolved by auto here
23  * are primitive types, which are untracked by default
24  * by Boost Serialization.
25  */
26 
27 // DataFormats/Provenance/interface/Timestamp.h
28 template<class Archive>
29 void save(Archive & ar, const edm::Timestamp & obj, const unsigned int)
30 {
31  auto time_ = obj.value();
32  ar & BOOST_SERIALIZATION_NVP(time_);
33 }
34 
35 template<class Archive>
36 void load(Archive & ar, edm::Timestamp & obj, const unsigned int)
37 {
38  decltype(obj.value()) time_;
39  ar & BOOST_SERIALIZATION_NVP(time_);
40  obj = edm::Timestamp(time_);
41 }
42 
43 template<class Archive>
44 void serialize(Archive & ar, edm::Timestamp & obj, const unsigned int v)
45 {
46  split_free(ar, obj, v);
47 }
48 
49 } // namespace serialization
50 } // namespace boost
51 
52 #endif
void serialize(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int v)
Definition: CLHEP.h:53
void load(Archive &ar, CLHEP::Hep3Vector &obj, const unsigned int)
Definition: CLHEP.h:41
void save(Archive &ar, const CLHEP::Hep3Vector &obj, const unsigned int)
Definition: CLHEP.h:30
TimeValue_t value() const
Definition: Timestamp.h:56