Reputation: 194
I am reading the documentation of the Boost.MPI and I reach a point where it describes how to make Classes serializable, but I actually don't understand what that means and why we want to do it.
this is the Class from the Boost.MPI tutorioal:
class gps_position
{
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & degrees;
ar & minutes;
ar & seconds;
}
int degrees;
int minutes;
float seconds;
public:
gps_position(){};
gps_position(int d, int m, float s) :
degrees(d), minutes(m), seconds(s)
{}
};
Upvotes: 0
Views: 65