Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57713 - sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization
From: erwann.rogard_at_[hidden]
Date: 2009-11-16 16:33:40


Author: e_r
Date: 2009-11-16 16:33:39 EST (Mon, 16 Nov 2009)
New Revision: 57713
URL: http://svn.boost.org/trac/boost/changeset/57713

Log:
a
Added:
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/load.hpp (contents, props changed)
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/map.hpp (contents, props changed)
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/save.hpp (contents, props changed)
   sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/vector.hpp (contents, props changed)

Added: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/load.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/load.hpp 2009-11-16 16:33:39 EST (Mon, 16 Nov 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// detail::fusion::serialization::load.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_LOAD_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_LOAD_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/statistics/detail/fusion/serialization/loader.hpp>
+
+namespace boost{ namespace serialization{
+
+
+ template<typename Archive,typename S>
+ inline typename boost::enable_if<
+ boost::fusion::traits::is_sequence<S>,
+ void
+ >::type
+ load(
+ Archive & ar,
+ S & t,
+ const unsigned int file_version
+ )
+ {
+ boost::statistics::detail::fusion::serialization::make_loader(ar)(t);
+ }
+
+}// serialization
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/map.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/map.hpp 2009-11-16 16:33:39 EST (Mon, 16 Nov 2009)
@@ -0,0 +1,63 @@
+//////////////////////////////////////////////////////////////////////////////
+// detail::fusion::serialization::map.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_MAP_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_MAP_HPP_ER_2009
+#include <boost/fusion/include/make_map.hpp>
+#include <boost/statistics/detail/fusion/serialization/save.hpp>
+#include <boost/statistics/detail/fusion/serialization/load.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost{ namespace serialization{
+
+ // A generic function restricted by enable_if<is_sequence<S>,void>
+ // causes ambiguous compile error. So, apparently, each type of sequence and
+ // each length within requires an overoad.
+
+ // n = 1
+
+ template<class Archive,typename K1,typename D1>
+ void serialize(
+ Archive & ar,
+ typename boost::fusion::result_of::make_map<K1,D1>::type& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ // n = 2
+
+ template<class Archive,typename K1,typename K2,typename D1,typename D2>
+ void serialize(
+ Archive & ar,
+ typename boost::fusion::result_of::make_map<K1,K2,D1,D2>::type& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ // n = 3
+
+ template<class Archive,
+ typename K1,typename K2,typename K3,
+ typename D1,typename D2,typename D3
+ >
+ void serialize(
+ Archive & ar,
+ typename boost::fusion::result_of::make_map<K1,K2,K3,D1,D2,D3>::type& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+}}
+
+#endif

Added: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/save.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/save.hpp 2009-11-16 16:33:39 EST (Mon, 16 Nov 2009)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// detail::fusion::serialization::save.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_SAVE_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_SAVE_HPP_ER_2009
+#include <boost/utility/enable_if.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/statistics/detail/fusion/serialization/saver.hpp>
+
+namespace boost{ namespace serialization{
+
+
+ template<typename Archive,typename S>
+ inline typename boost::enable_if<
+ boost::fusion::traits::is_sequence<S>,
+ void
+ >::type
+ save(
+ Archive & ar,
+ const S & t,
+ const unsigned int file_version
+ )
+ {
+ boost::statistics::detail::fusion::serialization::make_saver(ar)(t);
+ }
+
+}// serialization
+}// boost
+
+#endif
\ No newline at end of file

Added: sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/vector.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/fusion/boost/statistics/detail/fusion/serialization/vector.hpp 2009-11-16 16:33:39 EST (Mon, 16 Nov 2009)
@@ -0,0 +1,94 @@
+//////////////////////////////////////////////////////////////////////////////
+// detail::fusion::serialization::vector.hpp //
+// //
+// (C) Copyright 2009 Erwann Rogard //
+// Use, modification and distribution are subject to the //
+// Boost Software License, Version 1.0. (See accompanying file //
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_VECTOR_HPP_ER_2009
+#define BOOST_STATISTICS_DETAIL_FUSION_SERIALIZATION_VECTOR_HPP_ER_2009
+#include <boost/fusion/include/make_vector.hpp>
+#include <boost/statistics/detail/fusion/serialization/save.hpp>
+#include <boost/statistics/detail/fusion/serialization/load.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost{ namespace serialization{
+
+
+ // A generic function restricted by enable_if<is_sequence<S>,void>
+ // causes ambiguous compile error. So, apparently, each type of sequence and
+ // each length within requires an overoad.
+
+ // TODO use a macro
+
+ // n = 1
+
+ template<class Archive,typename T1>
+ void serialize(
+ Archive & ar,
+ boost::fusion::vector<T1>& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ template<class Archive,typename T1>
+ void serialize(
+ Archive & ar,
+ boost::fusion::vector1<T1>& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ // n = 2
+
+ template<class Archive,typename T1,typename T2>
+ void serialize(
+ Archive & ar,
+ boost::fusion::vector<T1,T2>& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ template<class Archive,typename T1,typename T2>
+ void serialize(
+ Archive & ar,
+ boost::fusion::vector2<T1,T2>& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ // n = 3
+
+ template<class Archive,typename T1,typename T2,typename T3>
+ void serialize(
+ Archive & ar,
+ boost::fusion::vector<T1,T2,T3>& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+ template<class Archive,typename T1,typename T2,typename T3>
+ void serialize(
+ Archive & ar,
+ boost::fusion::vector3<T1,T2,T3>& t,
+ const unsigned int file_version
+ )
+ {
+ split_free(ar, t, file_version);
+ }
+
+
+}}
+
+#endif
\ No newline at end of file


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