Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/serialization/test/test_pimpl.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 1.3 KB
Line 
1/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2// test_pimpl.cpp
3
4// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5// Use, modification and distribution is subject to the Boost Software
6// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8
9// should pass compilation and execution
10
11#include <boost/compatibility/cpp_c_headers/cstdio> // for tmpnam
12
13#include <fstream>
14#include <boost/serialization/nvp.hpp>
15
16#include "test_tools.hpp"
17#include <boost/preprocessor/stringize.hpp>
18#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST)
19
20class B;
21
22class A {
23^    friend boost::serialization::access;
24^    B *pimpl;
25^    template<class Archive>
26^    void serialize(Archive & ar, const unsigned int file_version);
27};
28
29int test_main( int argc, char* argv[] )
30{
31    char testfile[TMP_MAX];
32    std::tmpnam(testfile);
33//    BOOST_REQUIRE(NULL != testfile);
34
35    A a, a1;
36    {   
37        test_ostream os(testfile, TEST_STREAM_FLAGS);
38        test_oarchive oa(os);
39        oa << BOOST_SERIALIZATION_NVP(a);
40    }
41    {
42        test_istream is(testfile, TEST_STREAM_FLAGS);
43        test_iarchive ia(is);
44        BOOST_SERIALIZATION_NVP(a1);
45    }
46//    BOOST_CHECK(a != a1);
47    return 0;
48}
49
50// EOF
Note: See TracBrowser for help on using the repository browser.