Serialization of a command template in C ++

I want to do the following in C ++:

  • create team object
  • serialize it
  • (send it to another computer)
  • Deserialize
  • execute

Two cases:

  • sender and receiver win 7 computers
  • sender is * nix and the recipient won 7

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

+3
source
3

, boost.serialization .

, , , . , POD ( ). , (endianness). , , . , ( , )

.

+1

, - ++ . , , , .

. (), XML, XML: , () int 4 . int name, , <int name="myInt">12345</int>.

( ), / . , , , . , , , , , , , . , , , .

( , XML ..) , , , - , , , , .

, , ( ) . , ( ) , - .

+1

, ++ , . Boost.Serialization Google . - () , .

( , , , . , ++.)

0

All Articles