Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2007-02-06 15:26:46


I don't know the serialization lib in such details. All I know is that
the code works. But you need the virtual foo() function in the class
declaration and you need to have the BOOST_CLASS_EXPORT macros.

Christian

On 2/6/07, Aljaz <aljaz.fajmut_at_[hidden]> wrote:
> Hello..
> I have a derived class serialization:
> for instance:
>
> class client_request_base {
> public:
> client_request_base() : _type( 0 ) {}
> private:
> friend boost::serialization::access;
> template< class ARCHIVE >
> void serialize( ARCHIVE& ar, const unsigned int version ) {
> ar & _type;
> }
> unsigned int _type;
> };
>
> class calc_skip_images_request : public client_request_base {
> public:
> calc_skip_images_request() : client_request_base( 1 ), _images_client(
> 0 ) {}
> private:
> friend boost::serialization::access;
> template< class ARCHIVE >
> void serialize( ARCHIVE& ar, const unsigned int version ) {
> ar & boost::serialization::base_object<client_request_base>( *this );
> ar & _images_client;
> }
> unsigned int _images_client;
> };
>
> Now I wonder.. If I want to use serialization do I have do EXPORT second
> class? Or set first class to abstract?
> Like:
>
> BOOST_IS_ABSTRACT( client_request_base )
> BOOST_CLASS_EXPORT(calc_skip_images_request)
>
> Im confused which of these two things is needed? When should I use export
> and when is abstract macro?
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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