|
Boost : |
From: Jared McIntyre (jmcintyre_at_[hidden])
Date: 2004-12-02 15:08:50
At 11:04 AM -0800 12/2/04, Robert Ramey wrote:
>I would hope the following would do it
>
> template<class Archive>
> void save(Archive & ar, const SWHandle & handle, const unsigned int
>version)
> {
> std::string strHelper( handle.toCharString() );
> ar << make_nvp("swhandle_guid", strHelper);
> }
>
> template<class Archive>
> void load(Archive & ar, SWHandle & handle, const unsigned int version)
> {
> std::string strHelper;
> ar >> make_nvp("swhandle_guid", strHelper);
> handle = strHelper.c_str();
> }
>
>BOOST_SERIALIZATION_SPLIT_FREE(SWHandle)
Missed that macro in my reading. However, even with that
improvement, I'm still getting the same error. Maybe the problem is
how I'm invoking the deserialization?
***
std::wifstream ifs( strTemp.c_str() );
assert(ifs.good());
archive::xml_wiarchive ia(ifs);
ia >> make_nvp("PluginList", *m_pPluginList);
ifs.close();
***
m_pPluginList has a serializer defined as:
***
protected:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
using namespace boost;
using namespace boost::serialization;
ar & make_nvp("name", m_name);
ar & make_nvp("id", m_ID);
ar & make_nvp("api_version", m_APIVersion);
ar & make_nvp("version", m_version);
ar & make_nvp("description", m_description);
ar & make_nvp("change_description", m_change);
ar & make_nvp("author", m_author);
ar & make_nvp("copyright", m_copyright);
};
***
The deserialization of m_ID is the issue.
Jared
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk