Serialization/pickle

I understand that it is technically unrelated. I am asking for information about about patterns of actual usage.
OK: "common," "popular," "preferred," "regarded-as-best-practice," "effective."
My extensions refer to one another, i.e., they form a significant object hierarchy in and of themselves. E.g., on the C++ side I might have an instance x of class X, which contains a vector of shared_ptrs p1,...,pn to instances y1,...,yn of another C++ class Y. At pickle-time there may be Python object z with a member u bound to to x and members w1,...,wm bound to a subset of the y1,...,yn. Is it even feasible to expect to be able to simple pickle.dump z and have it all work? Please keep in mind: I am just getting started wading into serializing a pretty complicated set of strongly interdependent Python and C++ objects and I am just trying to get my bearings. If this is the wrong forum to be asking these questions, please tell me. MD

"Drumheller, Michael"
I'm afraid I don't know that.
Ditto.
Yes. Of course you have to do some work in your wrapping code to say how X gets pickled.
Well, the C++-sig _might_ be more appropriate: http://www.boost.org/more/mailing_lists.htm#cplussig (cross-posted there) We (Boost Consulting) are actually planning to do something like this with one of our clients, but we haven't gotten started with it yet. I think everything should "just work" as long as you take care not to try to serialize the same object both from the C++ side (using Boost.Serialization) and from the Python side (using pickle). Because each system implements its own object tracking, you could end up representing the same object twice. HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
David Abrahams
-
Drumheller, Michael