Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TStreamable Class Reference

Gives the streamable property to a class. More...

#include <tobjstrm.h>

Inheritance diagram for TStreamable::

TCollection THelpIndex THelpTopic TStringList TStrListMaker TValidator TView TDirCollection TSortedCollection TFilterValidator TLookupValidator TPXPictureValidator TBackground TButton TCluster TColorDisplay TColorSelector TEditor TFileInfoPane TFrame TGroup THistory TIndicator TInputLine TListViewer TMenuView TScrollBar TScroller TStaticText TStatusLine List of all members.

Protected Methods

virtual void* read (ipstream &is)=0
virtual void write (opstream &os)=0

Detailed Description

Gives the streamable property to a class.

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.


Member Function Documentation

void * TStreamable::read ( ipstream & is ) [protected, pure virtual]
 

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.

void TStreamable::write ( opstream & os ) [protected, pure virtual]
 

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.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:35 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001