Newbie question: Serialization of an Array2D --> Cell** m_cells
Hello !
I am trying to serialize a a complex structure. One of the "variable" is a
2D Array (Cell** m_cells ) declared with pointers. I need to keep this data
structure as it is.
I have read some stuff about multi array with boost but found nothing to
serialize my Cell** m_cells.
Maybe one of you has the solution ....
Note1: using boost 1.41.0, g++ and ubuntu 9.04 ....
Note2: As you may understand while reading the code, I have in fact an
Array2D of PointAccumulator .... (Cell = PointAccumulator)
The part of code that is not correct .....
* template <class Archive> void serialize(Archive& ar, const unsigned int
version){
*ar & m_xsize & m_ysize &* m_cells;
}*
And raising this error:
wheelchair@wheelchair-laptop:~/playerstage/boostTest$ g++
-I/usr/local/include/ -L/usr/local/lib/ simple2.cpp -o simple
-lboost_serialization
/usr/local/include/boost/serialization/access.hpp: In static member function
‘static void boost::serialization::access::serialize(Archive&, T&, unsigned
int) [with Archive = boost::archive::text_iarchive, T = PointAccumulator*]’:
/usr/local/include/boost/serialization/serialization.hpp:74: instantiated
from ‘void boost::serialization::serialize(Archive&, T&, unsigned int) [with
Archive = boost::archive::text_iarchive, T = PointAccumulator*]’
/usr/local/include/boost/serialization/serialization.hpp:133: instantiated
from ‘void boost::serialization::serialize_adl(Archive&, T&, unsigned int)
[with Archive = boost::archive::text_iarchive, T = PointAccumulator*]’
/usr/local/include/boost/archive/detail/iserializer.hpp:173: instantiated
from ‘void boost::archive::detail::iserializer
Simon Ruffieux wrote:
I have read some stuff about multi array with boost but found nothing to serialize my Cell** m_cells.
I have not looked in much detail at your question but based on the above alone perhaps this could help: https://svn.boost.org/svn/boost/sandbox/statistics/detail/multi_array/
Thanks for your answer
I had a look at it,
But it seems to me I would have to convert my Cell** into a
boost::multi_array in order to use what you shown me ... Ideally I would
keep my Cell** structure as it. And only be able to serialize it to save the
array in a file and be able to reload it.
Instead of converting it to a multi_array, I could also "flatten" it into a
1D array ... and serialize this 1D array but ideally I don't want to convert
it ...
If anyone has a simple example, it would be greatly appreciated ...
Sorry I am new to Boost and I try to understand how to use it correctly ...
cannot find simple tutorials that show what I need ...
"er"
Simon Ruffieux wrote:
I have read some stuff about multi array with boost but found nothing to serialize my Cell** m_cells.
I have not looked in much detail at your question but based on the above alone perhaps this could help:
https://svn.boost.org/svn/boost/sandbox/statistics/detail/multi_array/ ----- Original Message ----- From: "er"
Newsgroups: gmane.comp.lib.boost.user To: Sent: Tuesday, January 12, 2010 11:12 PM Subject: Re: Newbie question: Serialization of an Array2D -->Cell** m_cells
Simon Ruffieux wrote:
I have read some stuff about multi array with boost but found nothing to serialize my Cell** m_cells.
I have not looked in much detail at your question but based on the above alone perhaps this could help:
https://svn.boost.org/svn/boost/sandbox/statistics/detail/multi_array/
participants (2)
-
er
-
Simon Ruffieux