Boost ASIO Serialization

Hey Guys, I have problems with serialising Objects of NET.
Serialising works fine but when deserialising i get the error "Datastream error".
Everything works also fine whe NET has no members in mNeurons and mConnections.
The class CONNECTION can have Instances of mNeurons, mConnections and mConnections2 may contain duplicate Objects. Below the simplified Version of my Code. (Headers included but not shown)

Any Idea what i am doing wrong?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class NET
{
 friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version){ar & mNeurons; ar &mConnections; ar & mConnections2;}

private:


std::list<NEURON*> mNeurons;
std::list<CONNECTION*> mConnections;
std::list<CONNECTION*> mConnections2;

};
BOOST_CLASS_EXPORT(NET)



1
2
3
4
5
6
7
8
9
10
11
class NEURON 
{
 friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version){ar & Faktor;}

private:

	float Faktor;
};
BOOST_CLASS_EXPORT(NEURON)


1
2
3
4
5
6
7
8
9
10
11
12
class CONNECTION
{
 friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version){ar & Neuron_A; ar & Neuron_B;}

private:

	NEURON *Neuron_A;
	NEURON *Neuron_B;
};
BOOST_CLASS_EXPORT(CONNECTION)
Last edited on
Topic archived. No new replies allowed.