Header File Macros
The simplest and most efficient way to serialize your classes is to build serialization directly into your objects (intrusive serialization) using these macros:
RW_DECLARE_VIRTUAL_STREAM_FNS(className) RW_DECLARE_STREAMABLE_POINTER(className) RW_DECLARE_STREAMABLE_AS_SELF(className) RW_DECLARE_STREAMABLE_AS_BASE(className) The RW_DECLARE_VIRTUAL_STREAM_FNS macro should be placed inside the class declaration—just inside the opening curly brace is a good place to put it. This macro declares, among other things, a streamContents() method, used to add the contents of your object to a virtual stream.
The RW_DECLARE_STREAMABLE_POINTER macro should be placed in the header file outside the class declaration. This macro declares global serialization operators.
The RW_DECLARE_STREAMABLE_AS_SELF macro should be placed in the header of the class outside the class declaration. This macro declares the factory for your class and declares its registrar.
The RW_DECLARE_STREAMABLE_AS_BASE macro should be placed after the above macro in the header of your class. It declares a registrar for your class's factory for when the class is serialized through a base pointer.
You can also enable streaming with these macros, which provide special handling for certain data types:
RW_DECLARE_STREAMABLE_VAL_SEQUENCE for streaming Rogue Wave value-based template collections
RW_DECLARE_STREAMABLE_PTR_SEQUENCE for streaming Rogue Wave pointer-based template collections
RW_DECLARE_STREAMABLE_STD_SEQUENCE for streaming Standard C++ Library sequences
RW_DECLARE_STREAMABLE_COLLECTABLE_SEQUENCE for streaming Rogue Wave
RWCollectable-based sequences
To enable streaming of maps (associations), use the corresponding macros:
RW_DECLARE_STREAMABLE_VAL_MAP RW_DECLARE_STREAMABLE_PTR_MAP RW_DECLARE_STREAMABLE_STD_MAP RW_DECLARE_STREAMABLE_COLLECTABLE_MAP