Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4033762
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:53:15+00:00 2026-05-20T11:53:15+00:00

I want to do the folloing in C++: create a command object serialize it

  • 0

I want to do the folloing in C++:

  1. create a command object
  2. serialize it
  3. (send it to another computer)
  4. deserialize
  5. execute

Two cases:

  • sender and receiver are both win 7
    computers
  • sender is *nix and receiver is win
    7

I found a tutorial for searialization: http://www.functionx.com/cpp/articles/serialization.htm. Is this the way to go? 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()

In this code the main point are pickle.dump and pickle.load. What are the C++ counterparts? Wikipedia says that c++ does not support serialization? What is the link above then?

What does binary serialization mean? memory is dumped to disk and deserialization needs exactly the same computer (no cross-platform transfers)?

br,
Juha

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:53:15+00:00Added an answer on May 20, 2026 at 11:53 am

    I would also recommend using a stable library like boost.serialization for serializing data.

    If you are new to serialization, it means transforming objects into a data representation suitable for transmission or storage and rebuilding them from that data representation. The difficulty is not really big with so-called PODs (Plain Old Data objects). You can transmit the buffer as data and cast it back after the transfer by taking care of the data alignment and byte ordering (endianness). It becomes more complicated if objects reference other objects, and then it makes really sense to use a well designed library. Boost’s serialization also supports versionning so you can update your format and keep up and backward compatible readers and writers (with some effort of course)

    Here is a good introduction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I want to create a .NET object in the powershell I write something
I want to create the following element: <exercises xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd"> If I use something
I want to create an allocator which provides memory with the following attributes: cannot
I want to create an alias for a class name. The following syntax would
Here goes a command object which needs to be populated from a Spring form
I have a problem with my WPF program. I'm trying to create an object
I've written two python scripts script1.py and script2.py. I want to run script1.py from
Greetings to all! I want to create a pl/sql query by declaring variables for
I want the following layout to appear on the screen: FieldName 1 [Field input
I want to ran the following script on text files that are being committed:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.