| 1 |
|
|---|
| 2 | #include <boost/archive/binary_oarchive.hpp>
|
|---|
| 3 | #include <boost/archive/binary_iarchive.hpp>
|
|---|
| 4 |
|
|---|
| 5 | #include <boost/serialization/export.hpp>
|
|---|
| 6 |
|
|---|
| 7 | typedef boost::archive::binary_oarchive boostOArchive;
|
|---|
| 8 | typedef boost::archive::binary_iarchive boostIArchive;
|
|---|
| 9 |
|
|---|
| 10 | #define TEMPLATE_INSTANTIATION_FOR_BOOST_ARCHIVE( T ) \
|
|---|
| 11 | template void T ::serialize<boostIArchive>(boostIArchive&, unsigned int);\
|
|---|
| 12 | template void T ::serialize<boostOArchive>(boostOArchive&, unsigned int);\
|
|---|
| 13 |
|
|---|
| 14 | class AccessTestBase
|
|---|
| 15 | {
|
|---|
| 16 | protected:
|
|---|
| 17 | virtual ~AccessTestBase()
|
|---|
| 18 | {};
|
|---|
| 19 | private:
|
|---|
| 20 | friend class boost::serialization::access;
|
|---|
| 21 |
|
|---|
| 22 | template<class Archive>
|
|---|
| 23 | void serialize( Archive&, const unsigned int )
|
|---|
| 24 | {};
|
|---|
| 25 | };
|
|---|
| 26 |
|
|---|
| 27 | BOOST_CLASS_EXPORT_KEY( AccessTestBase );
|
|---|
| 28 | BOOST_CLASS_EXPORT_IMPLEMENT( AccessTestBase );
|
|---|
| 29 | TEMPLATE_INSTANTIATION_FOR_BOOST_ARCHIVE( AccessTestBase )
|
|---|
| 30 |
|
|---|
| 31 | class AccessTestDerB: public AccessTestBase
|
|---|
| 32 | {
|
|---|
| 33 | private:
|
|---|
| 34 | friend class boost::serialization::access;
|
|---|
| 35 |
|
|---|
| 36 | // template<class Archive>
|
|---|
| 37 | // void serialize( Archive&, const unsigned int )
|
|---|
| 38 | // {};
|
|---|
| 39 | public:
|
|---|
| 40 | AccessTestDerB(){}
|
|---|
| 41 | };
|
|---|
| 42 |
|
|---|
| 43 | BOOST_CLASS_EXPORT_KEY( AccessTestDerB );
|
|---|
| 44 | BOOST_CLASS_EXPORT_IMPLEMENT( AccessTestDerB );
|
|---|
| 45 | TEMPLATE_INSTANTIATION_FOR_BOOST_ARCHIVE(AccessTestDerB)
|
|---|
| 46 |
|
|---|
| 47 | int main()
|
|---|
| 48 | {
|
|---|
| 49 | return 0;
|
|---|
| 50 | }
|
|---|