Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GRawIStream Class Reference

A source of data. More...

#include <gauge3d/files/istream.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Types

enum  tSeekType { BEGINNING, CURRENT, END }
 Position to seek relative to. More...


Public Methods

virtual ~GRawIStream ()
virtual void Seek (int pos,int seekType)
 Seek the stream position. More...

virtual int TellPos ()
 Get the distance in bytes between the beginning of the stream and the current position.

virtual int Read (void *buffer,int size)=0
 Attempts to fill the buffer and returns the amount actually read.

virtual bool WaitForInput (tTime timeout=0.0)
 Wait for input to become available. More...

virtual bool InputAvailable ()
 Returns true if input is currently available.


Detailed Description

A source of data.

\ingoup files

GRawIStream is the actual source of data read using a GIStream. GIStream itself provides buffering and other services for reading the data more easily. Often, however, it is desireable to read the raw data directory, especially when layering streams (you don't want double buffering).

GRawIStream is the class that should be inherited when creating new sources for stream data. When inheriting from GRawIStream, you do not have to write implementations of all of the functions. For example, if your stream does not support seeking, you do not have to write Seek() or TellPos(). If input is always available for your class, you need not define WaitForInput() or InputAvailable().


Member Enumeration Documentation

enum GAUGE3D::GRawIStream::tSeekType
 

Position to seek relative to.

Enumeration values:
BEGINNING   Seek relative to the start of the stream.
CURRENT   Seek relative to the current position.
END   Seek relative to the end of the stream.


Member Function Documentation

void GAUGE3D::GRawIStream::Seek ( int pos,
int seekType ) [virtual]
 

Seek the stream position.

Parameters:
pos   Position to seek to, in bytes.
seekType   Point in the stream that pos is relative to.

bool GAUGE3D::GRawIStream::WaitForInput ( tTime timeout = 0.0 ) [virtual]
 

Wait for input to become available.

Parameters:
timout   Maximum amount of time to wait for input, or 0 to wait indefinately.
Returns:
True if input became available, false otherwise.
Note:
This function may return false immediately if it knows that input will not be available in the future. For example, if the stream is a file and it is at the end of the file.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000