Hi, I am having trouble serializing a class. Actually, I am having
trouble compiling the class as below. The actual archiving is behind an
interface (hence the Save and Load methods) which may work (once I get
this sorted, I'm going to look at the export traits), but the error
points to me not declaring the is_wrapper properly.
My class:
BOOST_CLASS_IS_WRAPPER(Frame);
class Frame
{
...
// Serialize interface
uint32 Save( uint8* pStream )
{
ostrstream os( (char*)pStream, STREAM_SIZE );
boost::archive::text_oarchive oa(os);
oa << this;
return os.pcount();
}
void Load( uint8* pStream )
{
istrstream is( (char*)pStream, STREAM_SIZE );
boost::archive::text_iarchive ia(is);
ia >> this;
}
friend class boost::serialization::access;
template< class Archive >
void serialize( Archive& ar, const unsigned int version )
{
string strObjectType = "IFrame";
ar << strObjectType.length() << strObjectType;
ar << m_lMaxFrameLength << m_lDataLength << m_uiTimeStamp;
ar << boost::serialization::make_binary_object( (void*)(this + 1),
m_lMaxFrameLength );
}
My error:
W:\NewFramework\Boost\boost/archive/detail/iserializer.hpp(541) : error
C2664: 'boost::archive::load_wrapper' : cannot convert parameter 3 from
'boost::serialization::is_wrapper<T>' to 'boost::mpl::true_'
1> with
1> [
1> T= Frame *
1> ]
1> No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
1>
W:\NewFramework\Boost\boost/archive/detail/common_iarchive.hpp(59) : see
reference to function template instantiation 'void
boost::archive::load