1 #ifndef BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
2 #define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // common_oarchive.hpp
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>
21 #include <boost/archive/detail/basic_oarchive.hpp>
22 #include <boost/archive/detail/interface_oarchive.hpp>
25 # pragma warning(push)
26 # pragma warning(disable : 4511 4512)
33 // note: referred to as Curiously Recurring Template Patter (CRTP)
34 template<class Archive>
36 class BOOST_SYMBOL_VISIBLE common_oarchive :
37 public basic_oarchive,
38 public interface_oarchive<Archive>
40 friend class interface_oarchive<Archive>;
42 virtual void vsave(const version_type t){
45 virtual void vsave(const object_id_type t){
48 virtual void vsave(const object_reference_type t){
51 virtual void vsave(const class_id_type t){
54 virtual void vsave(const class_id_reference_type t){
57 virtual void vsave(const class_id_optional_type t){
60 virtual void vsave(const class_name_type & t){
63 virtual void vsave(const tracking_type t){
67 // default processing - invoke serialization library
69 void save_override(T & t){
70 archive::save(* this->This(), t);
72 void save_start(const char * /*name*/){}
73 void save_end(const char * /*name*/){}
74 common_oarchive(unsigned int flags = 0) :
75 basic_oarchive(flags),
76 interface_oarchive<Archive>()
81 } // namespace archive
88 #endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP