1 #ifndef BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
2 #define BOOST_ARCHIVE_BASIC_ARCHIVE_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
20 #include <boost/serialization/strong_typedef.hpp>
21 #include <boost/noncopyable.hpp>
23 #include <boost/archive/detail/auto_link_archive.hpp>
24 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
29 BOOST_STRONG_TYPEDEF(unsigned int, version_type
)
30 BOOST_STRONG_TYPEDEF(int, class_id_type
)
31 BOOST_STRONG_TYPEDEF(int, class_id_optional_type
)
32 BOOST_STRONG_TYPEDEF(int, class_id_reference_type
)
33 BOOST_STRONG_TYPEDEF(unsigned int, object_id_type
)
34 BOOST_STRONG_TYPEDEF(unsigned int, object_reference_type
)
36 struct tracking_type
{
37 typedef bool value_type
;
39 explicit tracking_type(const bool t_
= false)
42 tracking_type(const tracking_type
& t_
)
45 operator bool () const {
51 tracking_type
& operator=(const bool t_
){
55 bool operator==(const tracking_type
& rhs
) const {
58 bool operator==(const bool & rhs
) const {
61 tracking_type
& operator=(const tracking_type
& rhs
){
67 struct class_name_type
: private boost::noncopyable
{
69 operator const char * & () const {
70 return const_cast<const char * &>(t
);
75 explicit class_name_type(const char *key_
)
76 : t(const_cast<char *>(key_
)){}
77 explicit class_name_type(char *key_
)
79 class_name_type
& operator=(const class_name_type
& rhs
){
86 no_header
= 1, // suppress archive header info
87 no_codecvt
= 2, // suppress alteration of codecvt facet
88 no_xml_tag_checking
= 4, // suppress checking of xml tags
89 no_tracking
= 8, // suppress ALL tracking
93 #define NULL_POINTER_TAG class_id_type(-1)
95 BOOST_ARCHIVE_DECL(const char *)
96 BOOST_ARCHIVE_SIGNATURE();
98 BOOST_ARCHIVE_DECL(unsigned char)
99 BOOST_ARCHIVE_VERSION();
101 }// namespace archive
104 #include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
106 #include <boost/serialization/level.hpp>
108 // set implementation level to primitive for all types
109 // used internally by the serialization library
111 BOOST_CLASS_IMPLEMENTATION(boost::archive::version_type
, primitive_type
)
112 BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_type
, primitive_type
)
113 BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_reference_type
, primitive_type
)
114 BOOST_CLASS_IMPLEMENTATION(boost::archive::class_id_optional_type
, primitive_type
)
115 BOOST_CLASS_IMPLEMENTATION(boost::archive::class_name_type
, primitive_type
)
116 BOOST_CLASS_IMPLEMENTATION(boost::archive::object_id_type
, primitive_type
)
117 BOOST_CLASS_IMPLEMENTATION(boost::archive::object_reference_type
, primitive_type
)
118 BOOST_CLASS_IMPLEMENTATION(boost::archive::tracking_type
, primitive_type
)
120 #endif //BOOST_ARCHIVE_BASIC_ARCHIVE_HPP