MemoryStream Class Reference

Reads data from or writes data to a MemoryStreamStorage This allows a completely volatile storage of data. More...

#include <basestrm.h>

Inheritance diagram for MemoryStream:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MemoryStream (MemoryStreamStorage *lbuf, IOMode mode)
virtual void writedata (const void *nbuf, int size)
 writes data to the stream
virtual int readdata (void *nbuf, int size, bool excpt=true)
 Reads data from the stream.
int dataavail (void)

Protected Attributes

int blocksize
char * pointer
IOMode _mode
int actmempos
MemoryStreamStoragebuf

Detailed Description

Reads data from or writes data to a MemoryStreamStorage This allows a completely volatile storage of data.

Definition at line 204 of file basestrm.h.


Constructor & Destructor Documentation

MemoryStream::MemoryStream ( MemoryStreamStorage lbuf,
IOMode  mode 
)

Definition at line 2324 of file basestrm.cpp.

References _mode, actmempos, MemoryStreamStorage::allocated, tnstream::appending, blocksize, MemoryStreamStorage::buf, buf, pointer, tnstream::reading, MemoryStreamStorage::used, and tnstream::writing.


Member Function Documentation

void MemoryStream::writedata ( const void *  nbuf,
int  size 
) [virtual]

writes data to the stream

Parameters:
buf pointer to the buffer
size the number of bytes which are going to be written

Implements tnstream.

Definition at line 2357 of file basestrm.cpp.

References _mode, MemoryStreamStorage::allocated, blocksize, MemoryStreamStorage::buf, buf, MemoryStreamStorage::used, and tnstream::writing.

int MemoryStream::readdata ( void *  nbuf,
int  size,
bool  excpt = true 
) [virtual]

Reads data from the stream.

Parameters:
buf the buffer which the data is written to
size the number of bytes which should be read
excpt If true the operation will throw an exception if the desired number of bytes cannot be read.
Returns:
the number of bytes which were read.

Implements tnstream.

Definition at line 2377 of file basestrm.cpp.

References _mode, actmempos, MemoryStreamStorage::buf, buf, tnstream::reading, and MemoryStreamStorage::used.

int MemoryStream::dataavail ( void   ) 

Definition at line 2394 of file basestrm.cpp.

References _mode, actmempos, buf, MemoryStreamStorage::used, and tnstream::writing.

Referenced by trunreplay::readnextaction(), and trunreplay::run().


Member Data Documentation

int MemoryStream::blocksize [protected]

Definition at line 206 of file basestrm.h.

Referenced by MemoryStream(), and writedata().

char* MemoryStream::pointer [protected]

Definition at line 207 of file basestrm.h.

Referenced by MemoryStream().

IOMode MemoryStream::_mode [protected]

Definition at line 208 of file basestrm.h.

Referenced by dataavail(), MemoryStream(), readdata(), and writedata().

int MemoryStream::actmempos [protected]

Definition at line 209 of file basestrm.h.

Referenced by dataavail(), MemoryStream(), and readdata().

MemoryStreamStorage* MemoryStream::buf [protected]

Definition at line 210 of file basestrm.h.

Referenced by dataavail(), MemoryStreamStorage::getBuffer(), MemoryStream(), readdata(), and writedata().


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:47:03 2012 for Advanced Strategic Command by  doxygen 1.5.1