Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
XML Streams Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

3.3 Serialization Requirements

The first step is to identify the classes that need to support serialization. These are:

If you are using any of the collection classes in the Essential Tools Module, most of these already support serialization. Check the class description in the SourcePro C++ API Reference Guide to be sure, looking for global insertion and extraction operators that save the collection to an output stream and restore it from an input stream.

For the real estate application, you'll need to add serialization support to real_property, the base class, and to its derived classes residential and rural_land. You do not need to modify the vector collection class, RWTPtrOrderedVector, because it already supports serialization.

To add serialization support to classes:

  1. Add an explicitly declared default constructor to any class that does not already have one.

  2. Declare the streamContents() function by putting a macro in the header file for each class. If serializing pointers to objects rather than objects by value, add an additional macro to declare global operators for serializing pointers.

  3. Define the streamContents() function by putting macros in the source file for each class. If serializing pointers to objects rather than objects by value, add additional macros to define the global operators for serializing pointers.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.