First Change
Insert the RW_DECLARE_VIRTUAL_STREAM_FNS() macro into the class declaration. The name of the class must be provided as a parameter. Any declarations that appear below this macro are private. The following example shows the header file for real_property with the macro inserted.
 
// examples\serial\simple\real_property.h
 
class real_property
{
RW_DECLARE_VIRTUAL_STREAM_FNS(real_property) // 1
 
public: // 2
real_property() { } // 3
 
real_property (const RWCString& address, const RWCString& size)
: address_(address), size_(size) {
}
 
virtual ~real_property() { }
 
bool
operator== (const real_property&prop) const {
return address_ == prop.address_;
}
private:
RWCString address_;
RWCString size_;
};
//1 This macro declares streaming operators for the real_property class.
//2 Place the macro before anything else in the class. The macro assumes it is in a private scope, so it reinstates private as its last statement. If this public statement were ahead of the macro, the following constructors would be declared private.
//3 Object streaming requires a public default constructor.