Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:57

0001 // (C) Copyright 2005 Matthias Troyer
0002 
0003 // Use, modification and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  Authors: Matthias Troyer
0008 
0009 #ifndef BOOST_MPI_DETAIL_IGNORE_OPRIMITIVE_HPP
0010 #define BOOST_MPI_DETAIL_IGNORE_OPRIMITIVE_HPP
0011 
0012 #include <boost/config.hpp>
0013 #include <boost/mpi/datatype.hpp>
0014 #include <boost/serialization/array.hpp>
0015 
0016 namespace boost { namespace mpi { namespace detail {
0017 
0018 /// @brief a minimal output archive, which ignores any save
0019 ///
0020 /// This class implements a minimal output archive, probably an output archive
0021 /// archetype, doing nothing at any save. It's use, besides acting as an
0022 /// archetype is as a base class to implement special archives that ignore
0023 /// saving of most types
0024 
0025 class ignore_oprimitive
0026 {
0027 public:
0028     /// a trivial default constructor
0029     ignore_oprimitive()
0030     {}
0031 
0032         /// don't do anything when saving binary data
0033     void save_binary(const void *, std::size_t )
0034     {
0035     }
0036 
0037         /// don't do anything when saving arrays
0038     template<class T>
0039     void save_array(serialization::array_wrapper<T> const&, unsigned int )
0040     {
0041     }
0042 
0043     typedef is_mpi_datatype<mpl::_1> use_array_optimization;
0044 
0045 
0046 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
0047     friend class archive::save_access;
0048 protected:
0049 #else
0050 public:
0051 #endif
0052 
0053         /// don't do anything when saving primitive types
0054     template<class T>
0055     void save(const T &)
0056     {
0057     }
0058 };
0059 
0060 } } } // end namespace boost::mpi::detail
0061 
0062 #endif // BOOST_MPI_DETAIL_IGNORE_OPRIMITIVE_HPP