PageRenderTime 15ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://hadesmem.googlecode.com/
C++ Header | 54 lines | 24 code | 15 blank | 15 comment | 0 complexity | be3a3a96a0da39703a1af537d7805df4 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_IPRIMITIVE_HPP
10#define BOOST_MPI_DETAIL_IGNORE_IPRIMITIVE_HPP
11
12#include <boost/config.hpp>
13#include <boost/mpi/datatype.hpp>
14#include <boost/serialization/array.hpp>
15
16
17namespace boost { namespace mpi { namespace detail {
18
19/// @brief a minimal input archive, which ignores any load
20///
21/// This class implements a minimal input archive, probably an input archive
22/// archetype, doing nothing at any load. It's use, besides acting as an
23/// archetype is as a base class to implement special archives that ignore
24/// loading of most types
25
26class ignore_iprimitive
27{
28public:
29    /// a trivial default constructor
30    ignore_iprimitive()
31    {}
32
33
34        /// don't do anything when loading binary data
35    void load_binary(void *, std::size_t )
36        {}
37
38        /// don't do anything when loading arrays
39    template<class T>
40    void load_array(serialization::array<T> &, unsigned int )
41    {}
42
43    typedef is_mpi_datatype<mpl::_1> use_array_optimization;
44
45        /// don't do anything when loading primitive types
46    template<class T>
47    void load(T & t)
48    {
49    }
50};
51
52} } } // end namespace boost::mpi::detail
53
54#endif // BOOST_MPI_DETAIL_IGNORE_IPRIMITIVE_HPP