PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/mpi/detail/ignore_skeleton_oarchive.hpp

http://hadesmem.googlecode.com/
C++ Header | 79 lines | 55 code | 16 blank | 8 comment | 1 complexity | cdd98cd09ecf7aabf5180370c40450b4 MD5 | raw file
 1// (C) Copyright 2005 Matthias Troyer 
 2
 3// Use, modification and distribution is subject to the Boost Software
 4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 5// http://www.boost.org/LICENSE_1_0.txt)
 6
 7//  Authors: Matthias Troyer
 8
 9#ifndef BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP
10#define BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP
11
12#include <boost/serialization/pfto.hpp>
13
14#include <boost/archive/detail/auto_link_archive.hpp>
15#include <boost/archive/detail/common_oarchive.hpp>
16#include <boost/archive/basic_archive.hpp>
17#include <boost/archive/detail/oserializer.hpp>
18#include <boost/serialization/collection_size_type.hpp>
19#include <boost/serialization/array.hpp>
20#include <boost/serialization/item_version_type.hpp>
21
22namespace boost { namespace mpi { namespace detail {
23
24template<class Archive>
25class ignore_skeleton_oarchive 
26  : public archive::detail::common_oarchive<Archive>
27{
28public:
29    ignore_skeleton_oarchive()
30      : archive::detail::common_oarchive<Archive>(archive::no_header)
31    {
32    }
33
34#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
35public:
36#else
37    friend class archive::detail::interface_oarchive<Archive>;
38    friend class archive::save_access;
39protected:
40#endif
41
42    // intermediate level to support override of operators
43    // for templates in the absence of partial function 
44    // template ordering
45    template<class T>
46    void save_override(T const& t, BOOST_PFTO int)
47    {
48        archive::save(* this->This(), t);
49    }
50
51#define BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(T) \
52    void save_override(T const & , int)        \
53    {}
54
55BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_optional_type)
56BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::version_type)
57BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::library_version_type)
58BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_type)
59BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_reference_type)
60BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::object_id_type)
61BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::object_reference_type)
62BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::tracking_type)
63BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_name_type)
64BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::collection_size_type)
65BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::item_version_type)
66
67    void save_override(std::string const & s, int)       
68    {
69      if (s.size())
70        save_override(serialization::make_array(s.data(),s.size()),0);
71    }
72
73#undef BOOST_ARCHIVE_IGNORE_IMPLEMENTATION
74};
75
76
77} } } // end namespace boost::mpi::detail
78
79#endif // BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP