Tools.h++ Manual

21-228 104011 Tandem Computers Incorporated
21
RWXDRostream
RWXDRostream
||
RWvostream RWios
|
RWv ios
Synopsis
#include <rw/xdrstrea.h>
XDR xdr;
xdrstdio_create(&xdr, stdout, XDR_ENCODE);
RWXDRostream rw_xdr(&xdr);
Description Class
RWXDRostream
is a portable output stream based on XDR routines.
Class
RWXDRostream
encapsulates a portion of the XDR library routines that
are used for external data representation. XDR routines allow programmers to
describe arbitrary data structures in a machine-independent fashion. Data for
remote procedure calls (RPC) are transmitted using XDR routines.
Class
RWXDRostream
enables one to output from a stream and encode an XDR
structure from a machine representation. Class
RWXDRostream
provides the
capability to encode the standard data types and vectors of those data types.
An XDR stream must first be created by calling the appropriate creation
routine. XDR streams currently exist for encoding/decoding of data to or from
standard I/O FILE streams, TCP/IP connections and Unix files, and memory.
These creation routines take arguments that are tailored to the specific
properties of the stream. After the XDR stream has been created, it can then be
used as an argument to the constructor for a
RWXDRostream
object.
RWXDRostream
can be interrogated as to the status of the stream using
member functions
bad()
,
clear()
,
eof()
,
fail()
,
good()
, and
rdstate()
.