Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization of a complex data structure
From: Marco Meoni - Sbaush (sbaush_at_[hidden])
Date: 2010-05-10 10:10:44


Yes, ok, but i can't access or write in OpenCV source code.
How can i serialize however?

On Mon, May 10, 2010 at 4:02 PM, Jeff Flinn
<TriumphSprint2000_at_[hidden]>wrote:

> Marco Meoni - Sbaush wrote:
>
>> Hi all. I understood how to serialize correctly nested structures,
>> defining serialize method inside all.
>> I've a problem with an attribute of a struct. The attribute is border of
>> OpenCV CvSeq type.
>>
>> Here is my code... what can i do to solve this?
>>
>>
>> struct Element{
>> unsigned int id;
>> double area; double perimeter;
>> CvRect bounding_box; CvSeq* border;
>> ...
>> ...
>> };
>>
>> namespace boost {
>> namespace serialization {
>>
>> template<class Archive>
>> void serialize(Archive & ar, Element & g, const unsigned int version)
>> {
>> ar & g.id <http://g.id>;
>>
>> ar & g.area ;
>> ar & g.perimeter ;
>> ar & g.bounding_box.width ;
>> ar & g.bounding_box.height ;
>> ar & g.bounding_box.x ;
>> ar & g.bounding_box.y ;
>> // ar & g.border; I CAN'T DO THIS...
>>
>
> You need to do the same for CvSeq that you did for Element:
>
>
> template<class Archive>
> void serialize(Archive& ar, CvSeq& aCvSeq , const unsigned int)
> {
> ...
>
> Jeff
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
Marco Meoni - Sbaush
www.marcomeoni.net


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net