[accumulators] serialization support

Hi, Have anyone considered for boost.accumulators having a serialization support? It will be helpful for example in situations where data is being accumulated/sampled on long time intervals, and persistence of boost.accumulators objects is impossible. Something like this: boost/accumulators/statistics/count.hpp: . . . template<typename Sample, typename Tag> struct immediate_mean_impl : accumulator_base { // for boost::result_of typedef typename numeric::functional::average<Sample, std::size_t>::result_type result_type; template<typename Args> immediate_mean_impl(Args const &args) : mean(numeric::average(args[sample | Sample()], numeric::one<std::size_t>::value)) { } template<typename Args> void operator ()(Args const &args) { std::size_t cnt = count(args); this->mean = numeric::average( (this->mean * (cnt - 1)) + args[parameter::keyword<Tag>::get()] , cnt ); } result_type result(dont_care) const { return this->mean; } template <typename Archive> void serialize(Archive &ar, const unsigned int version) { ar & BOOST_SERIALIZATION_NVP(mean); } private: result_type mean; }; . . . The problem is that members, storing the state are private. Thanks

On 11/19/2010 5:06 AM, Zoran Angelov wrote:
Hi, Have anyone considered for boost.accumulators having a serialization support? <snip>
If you submit a patch with tests, I'll accept it. -- Eric Niebler BoostPro Computing http://www.boostpro.com

Thanks Eric, Ok, i'm willing to contribute. I'll inform you about my progress. On Fri, Nov 19, 2010 at 2:43 PM, Eric Niebler <eric@boostpro.com> wrote:
On 11/19/2010 5:06 AM, Zoran Angelov wrote:
Hi, Have anyone considered for boost.accumulators having a serialization support? <snip>
If you submit a patch with tests, I'll accept it.
-- Eric Niebler BoostPro Computing http://www.boostpro.com _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Eric Niebler
-
Zoran Angelov