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

pstream Class Reference

The base class for handling streamable objects. More...

#include <tobjstrm.h>

Inheritance diagram for pstream::

fpbase ipstream opstream fpstream ifpstream ofpstream ifpstream iopstream iopstream ofpstream fpstream fpstream List of all members.

Public Types

enum  StreamableError { peNotRegistered, peInvalidType }
enum  PointerTypes { ptNull, ptIndexed, ptObject }

Public Methods

 pstream (streambuf *buf)
virtual ~pstream ()
int rdstate () const
int eof () const
int fail () const
int bad () const
int good () const
void clear (int sState=0)
 operator void * () const
int operator! () const
streambuf* rdbuf () const
void error (StreamableError)
void error (StreamableError, const TStreamable &)

Static Public Methods

void initTypes ()
void registerType (TStreamableClass *ts)

Protected Methods

 pstream ()
void init (streambuf *sbp)
void setstate (int b)

Protected Attributes

streambuf* bp
int state

Static Protected Attributes

TStreamableTypestypes

Detailed Description

pstream is the base class for handling streamable objects.

Definition at line 424 of file tobjstrm.h.


Member Enumeration Documentation

enum pstream::PointerTypes
 

Undocumented.

Definition at line 435 of file tobjstrm.h.

enum pstream::StreamableError
 

Undocumented.

Definition at line 431 of file tobjstrm.h.


Constructor & Destructor Documentation

pstream::pstream ( streambuf * buf )
 

This form creates a buffered pstream with the given buffer and sets the bp data member to `buf'. The state data member is set to 0.

pstream::~pstream ( ) [virtual]
 

Destroys the pstream object.

pstream::pstream ( ) [protected]
 

This form allocates a default buffer.


Member Function Documentation

int pstream::bad ( ) const
 

Returns nonzero if an error occurs.

void pstream::clear ( int sState = 0 )
 

Set the stream state data member to the given value (defaults to 0).

int pstream::eof ( ) const
 

Returns nonzero on end of stream.

void pstream::error ( StreamableError,
const TStreamable & )
 

Sets the given error condition, where StreamableError is defined as follows:

 enum StreamableError { peNotRegistered, peInvalidType };
 

void pstream::error ( StreamableError )
 

Sets the given error condition, where StreamableError is defined as follows:

 enum StreamableError { peNotRegistered, peInvalidType };
 

int pstream::fail ( ) const
 

Returns nonzero if a stream operation fails.

int pstream::good ( ) const
 

Returns nonzero if no state bits are set (that is, no errors occurred).

void pstream::init ( streambuf * sbp ) [protected]
 

Initializes the stream: sets state to 0 and bp to `sbp'.

void pstream::initTypes ( ) [static]
 

Creates the associated TStreamableTypes object types. Called by the TStreamableClass constructor.

pstream::operator void * ( ) const
 

Overloads the pointer-to-void cast operator.

Returns 0 if operation has failed (that is, fail() returned nonzero); otherwise returns nonzero.

int pstream::operator! ( ) const
 

Overloads the NOT operator. Returns the value returned by fail().

streambuf * pstream::rdbuf ( ) const
 

Returns the bp pointer to this stream's assigned buffer.

int pstream::rdstate ( ) const
 

Returns the current state value.

void pstream::registerType ( TStreamableClass * ts ) [static]
 

Undocumented.

void pstream::setstate ( int b ) [protected]
 

Updates the state data member with state |= (b & 0 xFF).


Member Data Documentation

streambuf * pstream::bp [protected]
 

Pointer to the stream buffer.

Definition at line 520 of file tobjstrm.h.

int pstream::state [protected]
 

The format state flags, as enumerated in ios. Use rdstate() to access the current state.

Definition at line 525 of file tobjstrm.h.

TStreamableTypes * pstream::types [static, protected]
 

Pointer to the TStreamableTypes data base of all registered types in this application.

Definition at line 538 of file tobjstrm.h.


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