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

MPS::OutputStream Class Reference

Used to stream data to a Connection. More...

#include <stream.h>

Inheritance diagram for MPS::OutputStream:

Inheritance graph
[legend]
List of all members.

Public Methods

 OutputStream ()
virtual ~OutputStream ()
int getLength () const
char const* getBody () const
void writeint (int what)
void writestring (string const &what)
void writebool (bool what)
void writelong (long long what)
void writechar (char what)
void writeReference (ref< Interface > const &what)
void writefloat (float what)
virtual void flush ()

Protected Methods

void write (int b)
virtual string referenceTransport () const

Protected Attributes

string buffer

Detailed Description

Used to stream data to a Connection.

Definition at line 70 of file stream.h.


Constructor & Destructor Documentation

MPS::OutputStream::OutputStream ( ) [inline]
 

Definition at line 94 of file stream.h.

MPS::OutputStream::~OutputStream ( ) [inline, virtual]
 

Definition at line 98 of file stream.h.


Member Function Documentation

void MPS::OutputStream::flush ( ) [inline, virtual]
 

Reimplemented in FastmsgOutputStream, MPS::InetTransport::InetIOStream, and MPS::SimplTransport::SimplIOStream.

Definition at line 112 of file stream.h.

Referenced by MPS::InetTransport::InetDispatcher::dispatchRequest(), MPS::SimplTransport::SimplIOStream::flush(), MPS::InetTransport::InetIOStream::flush(), and FastmsgOutputStream::flush().

char const * MPS::OutputStream::getBody ( ) const [inline]
 

Returns the buffer content.

Definition at line 101 of file stream.h.

Referenced by FastmsgOutputStream::flush().

int MPS::OutputStream::getLength ( ) const [inline]
 

Returns the buffer length.

Definition at line 100 of file stream.h.

Referenced by MPS::InetTransport::InetDispatcher::dispatchRequest(), and FastmsgOutputStream::flush().

string MPS::OutputStream::referenceTransport ( ) const [inline, protected, virtual]
 

Returns the name of the transport we should look for addresses within when writing out Interface references in writeReference.

Override this in subclasses to set the preferred transport-address-type for references we pickle for transmission.

Returns:
the name of a transport for use in writeReference()
See also:
writeReference()

Reimplemented in FastmsgOutputStream, MPS::InetTransport::InetIOStream, and MPS::SimplTransport::SimplIOStream.

Definition at line 91 of file stream.h.

void MPS::OutputStream::write ( int b ) [inline, protected]
 

Appends a single byte to the message body.

Parameters:
b   the byte to append

Definition at line 78 of file stream.h.

void MPS::OutputStream::writeReference ( ref< Interface > const & what )
 

Serialises a reference to another MPS object.

void MPS::OutputStream::writebool ( bool what )
 

Serialises a boolean.

void MPS::OutputStream::writechar ( char what )
 

Serialises a char.

void MPS::OutputStream::writefloat ( float what )
 

Serialises a 32-bit float.

void MPS::OutputStream::writeint ( int what )
 

Serialises a 32-bit signed int.

Referenced by MPS::SimplTransport::SimplConnection::getOutputStream(), and MPS::InetTransport::InetConnection::getOutputStream().

void MPS::OutputStream::writelong ( long long what )
 

Serialises a 64-bit signed long.

void MPS::OutputStream::writestring ( string const & what )
 

Serialises an ASCIZ byte string.


Member Data Documentation

string MPS::OutputStream::buffer [protected]
 

The message's body.

Definition at line 72 of file stream.h.


The documentation for this class was generated from the following file:
Generated at Wed Aug 15 01:05:31 2001 for mps-cpp by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001