I want to do the following in C ++:
Two cases:
I found a tutorial to search: http://www.functionx.com/cpp/articles/serialization.htm . Is that the way? In python, I could do:
def setAndPackCommand(self, object): outFile = StringIO.StringIO() pickledC = pickle.dump(object, outFile) # this packs object to outFile stringToSend = outFile.getvalue() # decoding to string def unpackAndExecute(self, stringToReceive): inFile = StringIO.StringIO() inFile.write(stringToReceive) inFile.seek(0, 0) receivedC = pickle.load(inFile) receivedC.execute()
This code focuses on pickle.dump and pickle.load. What is C ++ copy? Wikipedia says C ++ doesn't support serialization? What is the connection above?
What does binary serialization mean? memory is flushed to disk, and deserialization requires exactly the same computer (without cross-platform transfers)?
br, juha
, boost.serialization .
boost.serialization
, , , . , POD ( ). , (endianness). , , . , ( , )
.
, - ++ . , , , .
. (), XML, XML: , () int 4 . int name, , <int name="myInt">12345</int>.
int
name
<int name="myInt">12345</int>
( ), / . , , , . , , , , , , , . , , , .
( , XML ..) , , , - , , , , .
, , ( ) . , ( ) , - .
, ++ , . Boost.Serialization Google . - () , .
( , , , . , ++.)