#include <tobjstrm.h>
Inheritance diagram for TStreamable::
Protected Methods | |
virtual void* | read (ipstream &is)=0 |
virtual void | write (opstream &os)=0 |
TView has two base classes, TObject and the abstract class TStreamable. All the viewable classes, derived ultimately from TView, therefore also inherit from TStreamable.
Several non-view classes, such as TCollection, TStrListMaker and TStringList, also have TStreamable as a base class. Such classes are known as streamable, meaning that their objects can be written to and read from streams using the TVision stream manager.
If you want to develop your own streamable classes, make sure that TStreamable is somewhere in their ancestry. Using an existing streamable class as a base class, of course, is an obvious way of achieving this.
Since TStreamable is an abstract class, no objects of this class can be instantiated. Before a streamable class can be used with streams, the class must override the three pure virtual functions streamableName(), read(), and write().
Definition at line 80 of file tobjstrm.h.
|
This pure virtual function must be overridden (or redeclared as pure virtual) in every derived class. The overriding read() function for each streamable class must read the necessary data members from the ipstream object `is'. read() is usually implemented by calling the base class's read() (if any), then extracting any additional data members for the derived class. Reimplemented in TBackground, TColorSelector, TColorDisplay, TColorGroupList, TColorDialog, TInputLine, TButton, TCluster, TMultiCheckBoxes, TListBox, TStaticText, TParamText, TLabel, THistory, TEditor, TMemo, TFileEditor, TEditWindow, THelpTopic, THelpIndex, TMenuView, TStatusLine, TCollection, TSortedCollection, TOutlineViewer, TOutline, TStringList, TStrListMaker, TSortedListBox, TFileDialog, TChDirDialog, TValidator, TPXPictureValidator, TFilterValidator, TRangeValidator, TStringLookupValidator, TView, TScrollBar, TScroller, TListViewer, TGroup, and TWindow. |
|
This pure virtual function must be overridden (or redeclared as pure virtual) in every derived class. The overriding write() function for each streamable class must write the necessary data members to the opstream object `os'. write() is usually implemented by calling the base class's write() (if any), then inserting any additional data members for the derived class. Reimplemented in TBackground, TColorSelector, TColorDisplay, TColorGroupList, TColorDialog, TInputLine, TButton, TCluster, TMultiCheckBoxes, TListBox, TStaticText, TParamText, TLabel, THistory, TEditor, TMemo, TFileEditor, TEditWindow, THelpTopic, THelpIndex, TMenuView, TStatusLine, TCollection, TSortedCollection, TOutlineViewer, TOutline, TStringList, TStrListMaker, TFileDialog, TChDirDialog, TValidator, TPXPictureValidator, TFilterValidator, TRangeValidator, TStringLookupValidator, TView, TScrollBar, TScroller, TListViewer, TGroup, and TWindow. |