Boost logo

Boost Users :

From: Mathieu Peyréga (mathieu.peyrega_at_[hidden])
Date: 2008-07-30 10:09:25


Hello,

I have a template class as a base class I wish to serialize...

In that case, the BOOST_SERIALIZATION_BASE_OBJECT_NVP does not work as
it introduce < > caracters wich i guess are forbidden in the xml tag...

Is there a nice way to solve this issue ? For now, I am only facing the
1 parameter case and thus defined a macro :

#define
BOOST_SERIALIZATION_BASE_OBJECT_TEMPLATE_NVP(classname,templateparameter)
\
    boost::serialization::make_nvp( \
        
BOOST_PP_STRINGIZE(classname)BOOST_PP_STRINGIZE(templateparameter),
\
        boost::serialization::base_object<classname<templateparameter>
>(*this) \
    )

which gives me somme acceptable behaviour...

if I have ClassA<ParameterClass> as a base class

I write BOOST_SERIALIZATION_BASE_OBJECT_TEMPLATE_NVP(ClassA,ParameterClass)
instead of "usual" BOOST_SERIALIZATION_BASE_OBJECT_NVP(BaseClassName)

Regards,

Mathieu

--
http://www.incub.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