CMS 3D CMS Logo

Serializable.h
Go to the documentation of this file.
1 #pragma once
2 
3 #if defined(__GCCXML__)
4 
5 #define COND_SERIALIZABLE
6 #define COND_TRANSIENT
7 
8 #else
9 
10 // The archives must be listed before any boost/serialization header.
11 // Otherwise, in some cases the export macros trigger compilation errors.
12 // #include "CondFormats/Serialization/interface/Archive.h"
13 
14 #include <boost/serialization/access.hpp>
15 
16 #include <boost/serialization/string.hpp>
17 #include <boost/serialization/vector.hpp>
18 #include <boost/serialization/list.hpp>
19 #include <boost/serialization/set.hpp>
20 #include <boost/serialization/map.hpp>
21 #include <boost/serialization/bitset.hpp>
22 #include <boost/serialization/unordered_map.hpp>
23 #include <boost/serialization/utility.hpp>
24 
25 // We cannot include Equal.h here since it is C++11
26 namespace cond {
27  namespace serialization {
28  template <typename CondSerializationT, typename Enabled = void>
29  struct access;
30  }
31 } // namespace cond
32 
33 // Marks a class/struct as serializable Conditions.
34 // It must be used in the end of the class/struct, to avoid
35 // changing the default access specifier.
36 // Note: the serialization code generator script depends on
37 // the implementation of the macro.
38 #define COND_SERIALIZABLE \
39 private: \
40  template <class Archive> \
41  void serialize(Archive& ar, const unsigned int version); \
42  template <typename CondSerializationT, typename Enabled> \
43  friend struct cond::serialization::access; \
44  friend class boost::serialization::access;
45 
46 // Same, but does *not* automatically generate the serialization code.
47 // This is useful when special features are required, e.g. versioning
48 // or using non-deducible contexts.
49 #define COND_SERIALIZABLE_MANUAL \
50  COND_SERIALIZABLE; \
51  void cond_serialization_manual();
52 
53 // Polymorphic classes must be tagged as such
54 #define COND_SERIALIZABLE_POLYMORPHIC(T) BOOST_CLASS_EXPORT(T);
55 
56 // Marks a member as transient, i.e. not included in the automatically
57 // generated serialization code. All variables in the same 'statement'
58 // (up to the ';') will be marked as transient, so please avoid declaring
59 // more than one transient member per 'statement'/line. In order to
60 // avoid that, in the future we may be able to use custom C++11 attributes
61 // like [[cond::serialization::transient]]
62 #define COND_TRANSIENT
63 
64 #endif /* !defined(__GCCXML__) */
Definition: plugin.cc:23