문제

I have a class which has a member graph which is a boost adjacency_list boost::adjacency_list<setS, setS, undirectedS, AINGNodeData, AINGEdgeData> graph;, would it be directly serializable ? How can I serialize it ? I use boost:serialization.

도움이 되었습니까?

해결책

It should not be an issue. The class boost::adjacency_list<....> is serializable. See the file

#include <boost/graph/adj_list_serialize.hpp>

Simply make sure your properties AINGNodeData, AINGEdgeData are serializable, the library should take care of the rest. If properties are simple types or containers (e.g. std::string), it would be enough to make sure the proper serialization header is included, e.g.

#include <boost/serialization/string.hpp>
#include <boost/serialization/vector.hpp>

Good luck.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top