Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

RWXDRistream (Unix only)

Module:  Essential Tools Module   Group:  Virtual Stream


RWvistreamRWvios RWXDRistream RWios

Local Index

Members

Synopsis

#include <rw/xdrstrea.h>
XDR xdr;
xdrstdio_create(&xdr, stdin, XDR_DECODE);
RWXDRistream rw_xdr(&xdr);

Description

Class RWXDRistream is a portable input stream based on XDR routines. Class RWXDRistream 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 RWXDRistream enables one to decode an XDR structure to a machine representation. Class RWXDRistream provides the capability to decode all 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 iostreams and 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 the argument to the constructor for a RWXDRistream object.

RWXDRistream can be interrogated as to the status of the stream using member functions bad(), clear(), eof(), fail(), good(), and rdstate().

Persistence

None

Example

The example that follows is a "reader" program that decodes an XDR structure from a file stream. The example for class RWXDRostream is the "writer" program that encodes the XDR structures onto the file stream.

The library that supports XDR routines must be linked in. The name of this library is not standard.

Public Constructor

RWXDRistream(XDR* xp);
RWXDristream(streambuf*);
RWXDRistream(istream&);

Public Destructor

~virtual RWXDRistream();

Public Member Functions

virtual int
get();
virtual RWvistream&
get(char& c);
virtual RWvistream&
get(wchar_t& wc); 
virtual RWvistream&
get(unsigned char& c);
virtual RWvistream&
get(char* v, size_t N);
virtual RWvistream&
get(unsigned char* v, size_t N);
virtual RWvistream&
get(double* v, size_t N);
virtual RWvistream&
get(float* v, size_t N);
virtual RWvistream&
get(int* v, size_t N);
virtual RWvistream&
get(unsigned int* v, size_t N);
virtual RWvistream&
get(long* v, size_t N);
virtual RWvistream&
get(unsigned long* v, size_t N);
virtual RWvistream&
get(short* v, size_t N);
virtual RWvistream&
get(unsigned short* v, size_t N);
virtual RWvistream&
get(wchar_t* v, size_t N);
virtual RWvistream&
getString(char* s, size_t maxlen); 
virtual RWvistream&
operator>>(char& c ); 
virtual RWvistream&
operator>>(double& d);
virtual RWvistream&
operator>>(float& f);
virtual RWvistream&
operator>>(int&  i);
virtual RWvistream&
operator>>(long& l);
virtual RWvistream&
operator>>(short& s);
virtual RWvistream&
operator>>(wchar_t& wc);
virtual RWvistream&
operator>>(unsigned char& c);
virtual RWvistream&
operator>>(unsigned int& i); 
virtual RWvistream&
operator>>(unsigned long& l);
virtual RWvistream&
operator>>(unsigned short& s);


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.