Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56138 - in trunk/boost/mpi: . detail
From: troyer_at_[hidden]
Date: 2009-09-10 11:22:22


Author: troyer
Date: 2009-09-10 11:22:21 EDT (Thu, 10 Sep 2009)
New Revision: 56138
URL: http://svn.boost.org/trac/boost/changeset/56138

Log:
Templated string serialization on the char type
Text files modified:
   trunk/boost/mpi/detail/binary_buffer_iprimitive.hpp | 3 ++-
   trunk/boost/mpi/detail/binary_buffer_oprimitive.hpp | 3 ++-
   trunk/boost/mpi/detail/packed_iprimitive.hpp | 5 +++--
   trunk/boost/mpi/detail/packed_oprimitive.hpp | 5 +++--
   trunk/boost/mpi/intercommunicator.hpp | 4 ++--
   5 files changed, 12 insertions(+), 8 deletions(-)

Modified: trunk/boost/mpi/detail/binary_buffer_iprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/binary_buffer_iprimitive.hpp (original)
+++ trunk/boost/mpi/detail/binary_buffer_iprimitive.hpp 2009-09-10 11:22:21 EDT (Thu, 10 Sep 2009)
@@ -88,7 +88,8 @@
       load_impl(&t, sizeof(T));
     }
 
- void load( std::string & s)
+ template<class CharType>
+ void load(std::basic_string<CharType> & s)
     {
       unsigned int l;
       load(l);

Modified: trunk/boost/mpi/detail/binary_buffer_oprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/binary_buffer_oprimitive.hpp (original)
+++ trunk/boost/mpi/detail/binary_buffer_oprimitive.hpp 2009-09-10 11:22:21 EDT (Thu, 10 Sep 2009)
@@ -79,7 +79,8 @@
       save_impl(&t, sizeof(T));
     }
 
- void save(const std::string &s)
+ template<class CharType>
+ void save(const std::basic_string<CharType> &s)
     {
       unsigned int l = static_cast<unsigned int>(s.size());
       save(l);

Modified: trunk/boost/mpi/detail/packed_iprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/packed_iprimitive.hpp (original)
+++ trunk/boost/mpi/detail/packed_iprimitive.hpp 2009-09-10 11:22:21 EDT (Thu, 10 Sep 2009)
@@ -86,7 +86,8 @@
         load_impl(&t, get_mpi_datatype(t), 1);
     }
 
- void load( std::string & s)
+ template<class CharType>
+ void load(std::basic_string<CharType> & s)
     {
        unsigned int l;
         load(l);
@@ -96,7 +97,7 @@
         #endif
         s.resize(l);
         // note breaking a rule here - could be a problem on some platform
- load_impl(const_cast<char *>(s.data()),MPI_CHAR,l);
+ load_impl(const_cast<char *>(s.data()),get_mpi_datatype(CharType()),l);
     }
 
 private:

Modified: trunk/boost/mpi/detail/packed_oprimitive.hpp
==============================================================================
--- trunk/boost/mpi/detail/packed_oprimitive.hpp (original)
+++ trunk/boost/mpi/detail/packed_oprimitive.hpp 2009-09-10 11:22:21 EDT (Thu, 10 Sep 2009)
@@ -77,11 +77,12 @@
         save_impl(&t, get_mpi_datatype<T>(t), 1);
     }
 
- void save(const std::string &s)
+ template<class CharType>
+ void save(const std::basic_string<CharType> &s)
     {
       unsigned int l = static_cast<unsigned int>(s.size());
       save(l);
- save_impl(s.data(),MPI_CHAR,s.size());
+ save_impl(s.data(),get_mpi_datatype(CharType()),s.size());
     }
 
 private:

Modified: trunk/boost/mpi/intercommunicator.hpp
==============================================================================
--- trunk/boost/mpi/intercommunicator.hpp (original)
+++ trunk/boost/mpi/intercommunicator.hpp 2009-09-10 11:22:21 EDT (Thu, 10 Sep 2009)
@@ -59,9 +59,9 @@
    * underlying MPI_Comm. This operation is used for "casting" from a
    * communicator to an intercommunicator.
    */
- explicit intercommunicator(const shared_ptr<MPI_Comm>& comm_ptr)
+ explicit intercommunicator(const shared_ptr<MPI_Comm>& cp)
   {
- this->comm_ptr = comm_ptr;
+ this->comm_ptr = cp;
   }
 
 public:


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk