Tools.h++ Manual

21-54 104011 Tandem Computers Incorporated
21
virtual void saveGuts(RWvostream&) const;
Write an object's state to an output stream.
RWspace recursiveStoreSize() const;
Returns the number of bytes required to store the object using the global
operator
RWFile& operator<<(RWFile&,
const RWCollectables&);
Recursively calls
binaryStoreSize()
, taking duplicate objects into account.
Related global operators
RWvostream& operator<<(RWvostream&, const
RWCollectable& obj);
RWFile& operator<<(RWFile&, const
RWCollectable& obj);
Saves the object
obj
to a virtual stream or
RWFile
, respectively. Recursively
calls the virtual function
saveGuts()
, taking duplicate objects into account.
See Chapter 16, “Persistence,” and “Multiple inheritance” on page 7 in
Chapter 19, “Implementation Notes.”
RWvistream& operator>>(RWvistream&,
RWCollectable& obj);
RWFile& operator>>(RWFile&,
RWCollectable& obj);
Restores an object inheriting from RWCollectable into
obj
from a virtual
stream or
RWFile
, respectively, replacing the previous contents of
obj
.
Recursively calls the virtual function
restoreGuts()
, taking duplicate objects
into account. See Chapter 16, “Persistence” and “Multiple inheritance” on
page 7 in Chapter 19, “Implementation Notes,” for a complete description.
Various exceptions that could be thrown are
RWInternalErr
(if the
RWFactory
does not know how to make the object), and
RWExternalErr
(corrupted stream or file).
RWvistream& operator>>(RWvistream&,
RWCollectable*& obj);
RWFile& operator>>(RWFile&,
RWCollectable*& obj);
Looks at the next object on the input stream or
RWFile
, respectively, and either
creates a new object of the proper type off the heap and returns a pointer to it,
or else returns a pointer to a previously read instance. Recursively calls the
virtual function
restoreGuts()
, taking duplicate objects into account. If an
object is created off the heap, then you are responsible for deleting it. See
Chapter 16, “Persistence” and “Multiple inheritance” on page 7 in Chapter 19,