Chapter 15: designing an rwcollectable class – HP Integrity NonStop J-Series User Manual
Page 212

Click on the banner to return to the user guide home page.
©Copyright 1996 Rogue Wave Software
Chapter 15: Designing an
RWCollectable Class
Why Design an RWCollectable Class?
An Example of RWCollectable Classes
How to Create an RWCollectable Object
Add RWDECLARE_COLLECTABLE() to your Class Declaration
Provide a Class Identifier for Your Class
Add Definitions for Virtual Functions
How to Add Polymorphic Persistence
Classes that derive from
RWCollectable
carry two major advantages: they can be used by the
Smalltalk-like collections, which also derive from RWCollectable, and they are the only set of
collection classes able to use the powerful polymorphic persistence machinery. In this section,
we will provide some examples of RWCollectable classes, then describe how to create your
own RWCollectable classes.
What we don't do in this section is describe the mechanism of polymorphic persistence itself.
Polymorphic, isomorphic, and simple persistence are all covered in detail in the previous
chapter called Persistence. To summarize, polymorphic persistence is the storage and retrieval
of objects to and from a stream or file in such a way that pointer relationships are preserved
among persisted objects, which can be restored without the restoring process knowing the
object's type.