rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDataFromVirtualInputStreamImp Class Reference
[Serialization]

Adapter class that allows virtual input stream class RWvistream to be used where data input stream class RWDataInputStream is required. More...

#include <rw/serial/RWDataFromVirtualInputStreamImp.h>

Inheritance diagram for RWDataFromVirtualInputStreamImp:
RWDataInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

List of all members.

Public Member Functions

virtual bool isFail () const
virtual bool isBad () const
virtual bool isGood () const
virtual void close ()
virtual bool isEof () const
virtual RWSize available () const
virtual RWSize skip (RWSize numUnits)
virtual void getBool (bool &value)
virtual void getChar (char &value)
virtual void getUnsignedChar (unsigned char &value)
virtual void getSignedChar (signed char &value)
virtual void getShort (short &value)
virtual void getUnsignedShort (unsigned short &value)
virtual void getInt (int &value)
virtual void getUnsignedInt (unsigned int &value)
virtual void getLong (long &value)
virtual void getUnsignedLong (unsigned long &value)
virtual void getFloat (float &value)
virtual void getDouble (double &value)
virtual void getWchar_t (wchar_t &value)
virtual void getCharacter (char &value)
virtual void getWCharacter (wchar_t &value)
virtual void getUCharacter (RWUChar &value)
virtual void getSizeT (size_t &value)
virtual void getLongLong (long long &value)
virtual void getUnsignedLongLong (unsigned long long &value)
virtual void getLongDouble (long double &value)
virtual RWSize getBools (bool *arrayPt, RWSize count)
virtual RWSize getChars (char *arrayPt, RWSize count)
virtual RWSize getUnsignedChars (unsigned char *arrayPt, RWSize count)
virtual RWSize getSignedChars (signed char *arrayPt, RWSize count)
virtual RWSize getShorts (short *arrayPt, RWSize count)
virtual RWSize getUnsignedShorts (unsigned short *arrayPt, RWSize count)
virtual RWSize getInts (int *arrayPt, RWSize count)
virtual RWSize getUnsignedInts (unsigned int *arrayPt, RWSize count)
virtual RWSize getLongs (long *arrayPt, RWSize count)
virtual RWSize getUnsignedLongs (unsigned long *arrayPt, RWSize count)
virtual RWSize getFloats (float *arrayPt, RWSize count)
virtual RWSize getDoubles (double *arrayPt, RWSize count)
virtual RWSize getWchar_ts (wchar_t *arrayPt, RWSize count)
virtual RWSize getString (char *arrayPt, RWSize count)
virtual RWSize getWString (wchar_t *arrayPt, RWSize count)
virtual RWSize getUString (RWUChar *arrayPt, RWSize count)
virtual RWSize getDelimitedString (char *arrayPt, RWSize count, char delim= '\0')
virtual RWSize getDelimitedWString (wchar_t *arrayPt, RWSize count, wchar_t delim=L'\0')
virtual RWSize getDelimitedUString (RWUChar *arrayPt, RWSize count, unsigned short delim)
virtual RWSize getLongLongs (long long *arrayPt, RWSize count)
virtual RWSize getUnsignedLongLongs (unsigned long long *arrayPt, RWSize count)
virtual RWSize getLongDoubles (long double *arrayPt, RWSize count)

Static Public Member Functions

static RWDataInputStream make (RWvistream &vstrm)

Protected Member Functions

 RWDataFromVirtualInputStreamImp (RWvistream &vstrm)

Detailed Description

An adapter class that allows an Essential Tools Module virtual input stream (RWvistream) to be used where a RWDataInputStream is required. Implements the body idiom from the handle-body pattern.

Examples

 // Read data in using virtual streams.
 
 #include <rw/serial/RWDataFromVirtualInputStreamImp.h>
 #include <rw/pstream.h>
 #include <iostream.h>
 #include <fstream.h>
 
 int main() {
   ifstream ifstrm;
   ifstrm.open("RWDataToVirtualOutputStreamImp.out",
     ios::in | ios::nocreate);
 
   if (!ifstrm) {
     cout << "The input file does not exist."<< endl;
   }
 
   else {
     RWpistream pstrm(ifstrm);
 
     RWDataInputStream in =
       RWDataFromVirtualInputStreamImp::make(pstrm);
 
     int j;
     in >> j;
     cout << j;
   }
   return 0;
 }

Constructor & Destructor Documentation

RWDataFromVirtualInputStreamImp::RWDataFromVirtualInputStreamImp ( RWvistream vstrm  )  [inline, protected]

Constructs an RWDataFromVirtualInputStreamImp instance that adapts the RW virtual output stream instance, vstrm to the RWDataInputStreamImp interface. Throws no exceptions.

Parameters:
vstrm The virtual Input stream being adapted.

Member Function Documentation

virtual RWSize RWDataFromVirtualInputStreamImp::available (  )  const [inline, virtual]

Returns the number of available elements that can be read from the stream without blocking. The type of the elements read is specified by derived classes and can be one of the following: RWByte, char, RWUChar, or wchar_t. Throws no exceptions.

Implements RWInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::close ( void   )  [inline, virtual]

Close the stream.

Implements RWStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getBool ( bool &  value  )  [inline, virtual]

Reads a bool value from the stream.

Parameters:
value is the bool value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getBools ( bool *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of bool values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getChar ( char &  value  )  [inline, virtual]

Reads a char value from the stream.

Parameters:
value is the char value to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getCharacter ( char &  value  )  [inline, virtual]

Reads a TinyCharacter value from the stream.

Parameters:
value is the TinyCharacter value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getChars ( char *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of char values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getDelimitedString ( char *  arrayPt,
RWSize  count,
char  delim = '\0' 
) [inline, virtual]

Reads a String value from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt A pointer to the array's first element.
count The number of element(s) to be read from the stream.
delim The narrow character used as a delimiter.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getDelimitedUString ( RWUChar arrayPt,
RWSize  count,
unsigned short  delim 
) [inline, virtual]

Reads a UTF-16 string value from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.
delim The UTF-16 character used as a delimiter.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getDelimitedWString ( wchar_t *  arrayPt,
RWSize  count,
wchar_t  delim = L'\0' 
) [inline, virtual]

Reads a wide string value from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.
delim The wide character used as a delimiter.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getDouble ( double &  value  )  [inline, virtual]

Reads a double value from the stream.

Parameters:
value is the double value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getDoubles ( double *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of double values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getFloat ( float &  value  )  [inline, virtual]

Reads a float value from the stream.

Parameters:
value is the float value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getFloats ( float *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of float values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getInt ( int &  value  )  [inline, virtual]

Reads an int value from the stream.

Parameters:
value is the int value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getInts ( int *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of int values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getLong ( long &  value  )  [inline, virtual]

Reads a long value from the stream.

Parameters:
value is the long value to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getLongDouble ( long double &  value  )  [inline, virtual]

Reads a long double value from the stream.

Parameters:
value The long double value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getLongDoubles ( long double *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of long double values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getLongLong ( long long &  value  )  [inline, virtual]

Reads a long long value from the stream.

Parameters:
value The long long value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getLongLongs ( long long *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of long long values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getLongs ( long *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of long values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getShort ( short &  value  )  [inline, virtual]

Reads a short value from the stream.

Parameters:
value is the short value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getShorts ( short *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of short values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getSignedChar ( signed char &  value  )  [inline, virtual]

Reads a signed char value from the stream.

Parameters:
value is the signed char value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getSignedChars ( signed char *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of signed char values from the stream. The array must have been pre-allocated to contain at least count elements. The function returns the number of elements read.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getSizeT ( size_t &  value  )  [inline, virtual]

Reads a size_t value from the stream.

Parameters:
value The size_t value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getString ( char *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads a String value from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getUCharacter ( RWUChar value  )  [inline, virtual]

Reads a UTF-16 Character value from the stream.

Parameters:
value is the UnicodeCharacter value to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getUnsignedChar ( unsigned char &  value  )  [inline, virtual]

Reads an unsigned char value from the stream.

Parameters:
value is the unsigned char value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getUnsignedChars ( unsigned char *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of unsigned char values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getUnsignedInt ( unsigned int &  value  )  [inline, virtual]

Reads an unsigned int value from the stream.

Parameters:
value is the unsigned int value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getUnsignedInts ( unsigned int *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of unsigned int values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getUnsignedLong ( unsigned long &  value  )  [inline, virtual]

Reads an unsigned long value from the stream.

Parameters:
value is the unsigned long value to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getUnsignedLongLong ( unsigned long long &  value  )  [inline, virtual]

Reads a unsigned long long value from the stream.

Parameters:
value The unsigned long long value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getUnsignedLongLongs ( unsigned long long *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of unsigned long long value(s) from the stream. The array must have been pre-allocated to contain at least count elements. The functions return the number of elements read.

Parameters:
arrayPt A pointer to the array's first element.
count The number of elements to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getUnsignedLongs ( unsigned long *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of unsigned long values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getUnsignedShort ( unsigned short &  value  )  [inline, virtual]

Reads an unsigned short value from the stream.

Parameters:
value is the unsigned short value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getUnsignedShorts ( unsigned short *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of unsigned short values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getUString ( RWUChar arrayPt,
RWSize  count 
) [inline, virtual]

Reads a UTF-16 string value from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getWchar_t ( wchar_t &  value  )  [inline, virtual]

Reads a wchar_t value from the stream.

Parameters:
value is the wchar_t value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getWchar_ts ( wchar_t *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads an array of wchar_t values from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual void RWDataFromVirtualInputStreamImp::getWCharacter ( wchar_t &  value  )  [inline, virtual]

Reads a WideCharacter value from the stream.

Parameters:
value is the WideCharacter value to be read from the stream.

Implements RWDataInputStreamImp.

virtual RWSize RWDataFromVirtualInputStreamImp::getWString ( wchar_t *  arrayPt,
RWSize  count 
) [inline, virtual]

Reads a wide string value from the stream. The array must have been pre-allocated to contain at least count elements.

Parameters:
arrayPt is a pointer to the array's first element.
count is the number of element(s) to be read from the stream.

Implements RWDataInputStreamImp.

virtual bool RWDataFromVirtualInputStreamImp::isBad (  )  const [inline, virtual]

Returns true to indicate a loss of integrity resulting from an input or output operation, such as an irrecoverable read error from a file. Throws no exceptions.

Implements RWStreamImp.

virtual bool RWDataFromVirtualInputStreamImp::isEof (  )  const [inline, virtual]

Returns true to indicate that an input operation reached the end of an input sequence. Throws no exceptions.

Implements RWInputStreamImp.

virtual bool RWDataFromVirtualInputStreamImp::isFail (  )  const [inline, virtual]

Returns true to indicate that an input operation failed to read the expected data, or that an output operation failed to generate the desired data. Throws no exceptions.

Implements RWStreamImp.

virtual bool RWDataFromVirtualInputStreamImp::isGood (  )  const [inline, virtual]

Returns true to indicate a stream in a valid state. Throws no exceptions.

Implements RWStreamImp.

static RWDataInputStream RWDataFromVirtualInputStreamImp::make ( RWvistream vstrm  )  [inline, static]

Returns an RWDataFromVirtualInputStreamImp instance that adapts the RW virtual output stream instance, vstrm to the RWDataInputStreamImp interface. Throws no exceptions.

Parameters:
vstrm The virtual Input stream being adapted.
virtual RWSize RWDataFromVirtualInputStreamImp::skip ( RWSize  numUnits  )  [inline, virtual]

Skips numUnits elements from the input sequence, if possible. The function returns the actual number of elements skipped, which can be any value between 0 and numUnits. The type of the elements skipped is specified by derived classes and can be one of the following: RWByte, char, RWUChar, or wchar_t.

Parameters:
numUnits The number of elements to be skipped.

Implements RWInputStreamImp.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, 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.