Home Help Center

Dynamic Ice and Classes

cyrille_favreaucyrille_favreau Member Cyrille FavreauOrganization: ...Project: ...
Hi, I have a class defined in my slice file and I would like to serialize it in C++ using Dynamic Ice.

The class is called Order and has the following definition:
class Address
{
  string StreetName;
};

class Order 
{
  Address BillTo;
  Address ShipTo;
};

Is there a code sample that I can refer to?

Regards,
Cyrille

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Cyrille,

    The example in demo/Ice/invoke shows how to serialize a variety of Slice types, including classes. Let us know if you have any questions about the code.

    Regards,
    Mark
  • cyrille_favreaucyrille_favreau Member Cyrille FavreauOrganization: ...Project: ...
    Hi Mark,

    Thanks for the demo. It now works. I was missing the read/writePendingObjects.

    Cheers,
    Cyrille
Sign In or Register to comment.