2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-02-25 04:22:17 +00:00

Propagated some changes made in serilization related with archive version and pfto removal.

This commit is contained in:
Alain Miniussi
2015-04-14 17:10:39 +02:00
parent b4e86408c2
commit 40c3f3ec2e
6 changed files with 39 additions and 52 deletions

View File

@@ -41,17 +41,14 @@ public:
protected:
#endif
// intermediate level to support override of operators
// for templates in the absence of partial function
// template ordering
template<class T>
void load_override(T & t, BOOST_PFTO int)
{
archive::load(* this->This(), t);
}
template<class T>
void load_override(T & t)
{
archive::load(* this->This(), t);
}
#define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \
void load_override(T & t , int) \
void load_override(T & t) \
{ \
implementation_archive >> t; \
}

View File

@@ -41,17 +41,14 @@ public:
protected:
#endif
// intermediate level to support override of operators
// for templates in the absence of partial function
// template ordering
template<class T>
void save_override(T const& t, BOOST_PFTO int)
{
archive::save(* this->This(), t);
}
template<class T>
void save_override(T const& t)
{
archive::save(* this->This(), t);
}
#define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \
void save_override(T const & t , int) \
void save_override(T const & t) \
{ \
implementation_archive << t; \
}

View File

@@ -38,18 +38,14 @@ public:
friend class archive::save_access;
protected:
#endif
// intermediate level to support override of operators
// for templates in the absence of partial function
// template ordering
template<class T>
void save_override(T const& t, BOOST_PFTO int)
{
archive::save(* this->This(), t);
}
template<class T>
void save_override(T const& t)
{
archive::save(* this->This(), t);
}
#define BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(T) \
void save_override(T const & , int) \
void save_override(T const &) \
{}
BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_optional_type)

View File

@@ -41,12 +41,9 @@ public:
BOOST_MPL_ASSERT((is_mpi_datatype<T>));
*this << x; // serialize the object
}
// intermediate level to support override of operators
// for templates in the absence of partial function
// template ordering
template<class T>
void save_override(T const& t, BOOST_PFTO int)
void save_override(T const& t)
{
save_enum(t,boost::is_enum<T>());
}
@@ -54,7 +51,7 @@ public:
template<class T>
void save_enum(T const& t, mpl::false_)
{
ignore_skeleton_oarchive<mpi_datatype_oarchive>::save_override(t, 0);
ignore_skeleton_oarchive<mpi_datatype_oarchive>::save_override(t);
}
template<class T>

View File

@@ -94,45 +94,45 @@ public:
// Load everything else in the usual way, forwarding on to the Base class
template<class T>
void load_override(T& x, int version, mpl::false_)
void load_override(T& x, mpl::false_)
{
archive::detail::common_iarchive<packed_iarchive>::load_override(x,version);
archive::detail::common_iarchive<packed_iarchive>::load_override(x);
}
// Load it directly using the primnivites
template<class T>
void load_override(T& x, int /*version*/, mpl::true_)
void load_override(T& x, mpl::true_)
{
iprimitive::load(x);
}
// Load all supported datatypes directly
template<class T>
void load_override(T& x, int version)
void load_override(T& x)
{
typedef typename mpl::apply1<use_array_optimization
, BOOST_DEDUCED_TYPENAME remove_const<T>::type
>::type use_optimized;
load_override(x, version, use_optimized());
load_override(x, use_optimized());
}
// input archives need to ignore the optional information
void load_override(archive::class_id_optional_type & /*t*/, int){}
void load_override(archive::class_id_optional_type & /*t*/){}
void load_override(archive::class_id_type & t, int version){
void load_override(archive::class_id_type & t){
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
void load_override(archive::version_type & t, int version){
void load_override(archive::version_type & t){
int_least8_t x=0;
* this->This() >> x;
t = boost::archive::version_type(x);
}
void load_override(archive::class_id_reference_type & t, int version){
load_override(static_cast<archive::class_id_type &>(t), version);
void load_override(archive::class_id_reference_type & t){
load_override(static_cast<archive::class_id_type &>(t));
}
void load_override(archive::class_name_type & t, int)

View File

@@ -92,41 +92,41 @@ public:
// Save everything else in the usual way, forwarding on to the Base class
template<class T>
void save_override(T const& x, int version, mpl::false_)
void save_override(T const& x, mpl::false_)
{
archive::detail::common_oarchive<packed_oarchive>::save_override(x,version);
archive::detail::common_oarchive<packed_oarchive>::save_override(x);
}
// Save it directly using the primitives
template<class T>
void save_override(T const& x, int /*version*/, mpl::true_)
void save_override(T const& x, mpl::true_)
{
oprimitive::save(x);
}
// Save all supported datatypes directly
template<class T>
void save_override(T const& x, int version)
void save_override(T const& x)
{
typedef typename mpl::apply1<use_array_optimization,T>::type use_optimized;
save_override(x, version, use_optimized());
save_override(x, use_optimized());
}
// input archives need to ignore the optional information
void save_override(const archive::class_id_optional_type & /*t*/, int){}
// explicitly convert to char * to avoid compile ambiguities
void save_override(const archive::class_name_type & t, int){
void save_override(const archive::class_name_type & t){
const std::string s(t);
* this->This() << s;
}
void save_override(const archive::class_id_type & t, int version){
void save_override(const archive::class_id_type & t){
const boost::int_least16_t x = t;
* this->This() << x;
}
void save_override(const archive::version_type & t, int version){
void save_override(const archive::version_type & t){
const boost::int_least8_t x = t;
* this->This() << x;
}