|
Boost Users : |
From: Javier Gonzalez (javierggt_at_[hidden])
Date: 2004-10-05 15:14:02
Hi all,
I'm trying to use the serialization library to
serialize some classes. The least intrusive case is a
headache because some of them don't even give me
constructors I can access.
The best would be to declare the serialize function as
a friend of my class. For some reason it doesn't work.
This is what I do in the class definition (inside
namespace evt):
friend class boost::serialization::access;
template<class Archive>
friend void ::boost::serialization::serialize(
Archive & ar, Event & t, const unsigned int
file_version);
and this is what I do when I define the function:
template<class Archive>
void serialize( Archive & ar, evt::Event & t, const
unsigned int file_version)
{
ar & BOOST_SERIALIZATION_NVP(t.fSEvent);
};
Then I include both headers where I need to use them
and allways get something like this:
/home/JGonzalez/private/serialization/Event.h:24:
`float evt::Event::fSEvent'
is private
/home/JGonzalez/private/serialization/SEventStreamers.h:32:
within this context
I don't know what I'm missing! I'm including both
files. Does any one have an idea that could help me?
thanks.
Javier
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now.
http://messenger.yahoo.com
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