source: NonGTP/Boost/boost/archive/detail/basic_oserializer.hpp @ 857

Revision 857, 2.6 KB checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
2#define BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
3
4// MS compatible compilers support #pragma once
5#if defined(_MSC_VER) && (_MSC_VER >= 1020)
6# pragma once
7#endif
8
9/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10// basic_oserializer.hpp: extenstion of type_info required for serialization.
11
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)
16
17//  See http://www.boost.org for updates, documentation, and revision history.
18
19#include <cstdlib> // NULL
20#include <boost/config.hpp>
21
22#include <boost/archive/detail/auto_link_archive.hpp>
23#include <boost/archive/detail/basic_serializer.hpp>
24
25#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
26
27namespace boost {
28
29namespace serialization {
30    class extended_type_info;
31} // namespace serialization
32
33// forward declarations
34namespace archive {
35namespace detail {
36
37class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive;
38class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer;
39
40class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer :
41    public basic_serializer
42{
43private:
44    basic_pointer_oserializer *bpos;
45protected:
46    explicit basic_oserializer(
47        const boost::serialization::extended_type_info & type_
48    );
49    // account for bogus gcc warning
50    #if defined(__GNUC__)
51    virtual
52    #endif
53    ~basic_oserializer();
54public:
55    bool serialized_as_pointer() const {
56        return bpos != NULL;
57    }
58    void set_bpos(basic_pointer_oserializer *bpos_){
59        bpos = bpos_;
60    }
61    const basic_pointer_oserializer * get_bpos() const {
62        return bpos;
63    }
64    virtual void save_object_data(
65        basic_oarchive & ar, const void * x
66    ) const = 0;
67    // returns true if class_info should be saved
68    virtual bool class_info() const = 0;
69    // returns true if objects should be tracked
70    virtual bool tracking(const unsigned int flags) const = 0;
71    // returns class version
72    virtual unsigned int version() const = 0;
73    // returns true if this class is polymorphic
74    virtual bool is_polymorphic() const = 0;
75};
76
77} // namespace detail
78} // namespace serialization
79} // namespace boost
80
81#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
82
83#endif // BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP
Note: See TracBrowser for help on using the repository browser.