Defining the streamContents() Function
Next, the streamContents() function is defined for this class by putting macros in the source file for the class.
 
// real_property.cpp
 
RW_BEGIN_STREAM_CONTENTS(real_property) // 1
{
RW_STREAM_ATTR_MEMBER(address, address_) // 2
RW_STREAM_ATTR_MEMBER(size, size_)
}
RW_END_STREAM_CONTENTS // 3
 
//1 This macro begins the definition of the streamContents() function.
//2 This macro defines the code for inserting and extracting data to and from the address_ and size_ data members of the real_property class.
//3 The streamContents() function is closed out with this macro.