Boost logo

Boost Users :

Subject: [Boost-users] boost mpi + pointer to polymorphic class
From: Michael Levenhagen (mjleven_at_[hidden])
Date: 2009-05-08 10:43:08


Hello,

I'm having a problem using boost::mpi::communicator::isend().
The problem is that it appears isend can't serialize via a pointer to
the base of a polymorphic class.
I'm using boost::serialization extensively to archive and I believe
serializing via a pointer to a base class works
when archiving.

This is what I'm trying:

class Event {
    public:
       virtual ~Event();
};

class Der1Event : Event {
};

class Der2Event: Der1Event {
};

Der2Event* d2 = new Der2Event;
Der1Event* d1 = static_cast<Der1Event*>(d2)

boost::mpi::communicator world;

world.isend( 0, 0, d1 );

My program faults when calling isend().

I know my example is missing details such as serialization code but in
principle should this work?

BTW the following works.

world.isend( 0, 0, d2 )

thanks
Mike


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