SourcePro® API Reference Guide

Product Documentation:
   SourcePro
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
RWDataToVirtualOutputStreamImp Class Reference

Adapter class that allows virtual output stream class RWvostream to be used where data output stream class RWDataOutputStream is required. More...

#include <rw/serial/RWDataToVirtualOutputStreamImp.h>

Inheritance diagram for RWDataToVirtualOutputStreamImp:
RWDataOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Member Functions

virtual void flush ()
 
virtual bool isBad () const
 
virtual bool isFail () const
 
virtual bool isGood () const
 
virtual void putBool (bool value)
 
virtual void putBools (const bool *arrayPt, RWSize count)
 
virtual void putChar (char value)
 
virtual void putCharacter (char value)
 
virtual void putChars (const char *arrayPt, RWSize count)
 
virtual void putDouble (double value)
 
virtual void putDoubles (const double *arrayPt, RWSize count)
 
virtual void putFloat (float value)
 
virtual void putFloats (const float *arrayPt, RWSize count)
 
virtual void putInt (int value)
 
virtual void putInts (const int *arrayPt, RWSize count)
 
virtual void putLong (long value)
 
virtual void putLongDouble (long double value)
 
virtual void putLongDoubles (const long double *arrayPt, RWSize count)
 
virtual void putLongLong (long long value)
 
virtual void putLongLongs (const long long *arrayPt, RWSize count)
 
virtual void putLongs (const long *arrayPt, RWSize count)
 
virtual void putShort (short value)
 
virtual void putShorts (const short *arrayPt, RWSize count)
 
virtual void putSignedChar (signed char value)
 
virtual void putSignedChars (const signed char *arrayPt, RWSize count)
 
virtual void putString (const char *arrayPt, RWSize count)
 
virtual void putUCharacter (RWUChar value)
 
virtual void putUnsignedChar (unsigned char value)
 
virtual void putUnsignedChars (const unsigned char *arrayPt, RWSize count)
 
virtual void putUnsignedInt (unsigned int value)
 
virtual void putUnsignedInts (const unsigned int *arrayPt, RWSize count)
 
virtual void putUnsignedLong (unsigned long value)
 
virtual void putUnsignedLongs (const unsigned long *arrayPt, RWSize count)
 
virtual void putUnsignedShort (unsigned short value)
 
virtual void putUnsignedShorts (const unsigned short *arrayPt, RWSize count)
 
virtual void putUString (const unsigned short *arrayPt, RWSize count)
 
virtual void putWchar_t (wchar_t value)
 
virtual void putWchar_ts (const wchar_t *arrayPt, RWSize count)
 
virtual void putWCharacter (wchar_t value)
 
virtual void putWString (const wchar_t *arrayPt, RWSize count)
 
- Public Member Functions inherited from RWDataOutputStreamImp
virtual ~RWDataOutputStreamImp ()
 
virtual RWDataOutputStream acquire ()
 
virtual void release ()
 
- Public Member Functions inherited from RWOutputStreamImp
virtual ~RWOutputStreamImp ()
 
virtual void close ()
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 

Static Public Member Functions

static RWDataOutputStream make (RWvostream &vstrm)
 

Protected Member Functions

 RWDataToVirtualOutputStreamImp (RWvostream &vstrm)
 
- Protected Member Functions inherited from RWDataOutputStreamImp
 RWDataOutputStreamImp ()
 
- Protected Member Functions inherited from RWOutputStreamImp
 RWOutputStreamImp ()
 
- Protected Member Functions inherited from RWStreamImp
 RWStreamImp ()
 
- Protected Member Functions inherited from RWBodyBase
 RWBodyBase (void)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (const RWBodyBase &second)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (unsigned initCount=0)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
RWTCountingBody< RWMutexLock > & operator= (const RWTCountingBody< RWMutexLock > &second)
 
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 
- Protected Member Functions inherited from RWTMonitor< RWMutexLock >
 RWTMonitor ()
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 ~RWTMonitor ()
 
void acquire ()
 
bool isAcquired () const
 
RWTMonitor< RWMutexLock > & monitor () const
 
RWMutexLockmutex ()
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release ()
 
bool tryAcquire ()
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 

Detailed Description

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

Example
// Write data to a virtual stream.
#include <rw/serial/RWDataToVirtualOutputStreamImp.h>
#include <rw/pstream.h>
#include <iostream.h>
#include <fstream.h>
int main() {
ofstream of;
of.open("RWDataToVirtualOutputStreamImp.out", ios::out);
RWpostream pstrm(of);
int i = 5;
out << i;
return 0;
}

Constructor & Destructor Documentation

RWDataToVirtualOutputStreamImp::RWDataToVirtualOutputStreamImp ( RWvostream vstrm)
inlineprotected

Constructs an RWDataToVirtualOutputStreamImp instance that adapts the RW virtual output stream instance vstrm to the RWDataOutputStreamImp interface. Throws no exceptions.

Parameters
vstrmThe virtual output stream being adapted.

Member Function Documentation

virtual void RWDataToVirtualOutputStreamImp::flush ( )
inlinevirtual

Flushes the stream.

Implements RWOutputStreamImp.

virtual bool RWDataToVirtualOutputStreamImp::isBad ( ) const
inlinevirtual

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 RWDataToVirtualOutputStreamImp::isFail ( ) const
inlinevirtual

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 RWDataToVirtualOutputStreamImp::isGood ( ) const
inlinevirtual

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

Implements RWStreamImp.

static RWDataOutputStream RWDataToVirtualOutputStreamImp::make ( RWvostream vstrm)
inlinestatic

Returns an RWDataToVirtualOutputStreamImp instance that adapts the RW virtual output stream instance vstrm to the RWDataOutputStreamImp interface. Throws no exceptions.

Parameters
vstrmThe virtual output stream being adapted.
virtual void RWDataToVirtualOutputStreamImp::putBool ( bool  value)
inlinevirtual

Writes a bool value to the stream.

Parameters
valueThe bool value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putBools ( const bool *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of bool values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putChar ( char  value)
inlinevirtual

Writes a char value to the stream.

Parameters
valueThe char value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putCharacter ( char  value)
inlinevirtual

Writes a TinyCharacter value to the stream.

Parameters
valueThe TinyCharacter value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putChars ( const char *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of char values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putDouble ( double  value)
inlinevirtual

Writes a double value to the stream.

Parameters
valueThe double value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putDoubles ( const double *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of double values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putFloat ( float  value)
inlinevirtual

Writes a float value to the stream.

Parameters
valueThe float value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putFloats ( const float *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of float values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putInt ( int  value)
inlinevirtual

Writes an int value to the stream.

Parameters
valueThe int value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putInts ( const int *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of int values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putLong ( long  value)
inlinevirtual

Writes a long value to the stream.

Parameters
valueThe long value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putLongDouble ( long double  value)
inlinevirtual

Writes a long double value to the stream.

Parameters
valueThe long double value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putLongDoubles ( const long double *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of long double values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putLongLong ( long long  value)
inlinevirtual

Writes a long long value to the stream.

Parameters
valueThe long long value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putLongLongs ( const long long *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of long long values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putLongs ( const long *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of long values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putShort ( short  value)
inlinevirtual

Writes a short value to the stream.

Parameters
valueThe short value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putShorts ( const short *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of short values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putSignedChar ( signed char  value)
inlinevirtual

Writes a signed char value to the stream.

Parameters
valueThe signed char value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putSignedChars ( const signed char *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of signed char values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putString ( const char *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of char values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUCharacter ( RWUChar  value)
inlinevirtual

Writes a UnicodeCharacter value to the stream.

Parameters
valueThe UnicodeCharacter value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedChar ( unsigned char  value)
inlinevirtual

Writes an unsigned char value to the stream.

Parameters
valueThe unsigned char value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedChars ( const unsigned char *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of unsigned char values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedInt ( unsigned int  value)
inlinevirtual

Writes an unsigned int value to the stream.

Parameters
valueThe unsigned int value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedInts ( const unsigned int *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of unsigned int values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedLong ( unsigned long  value)
inlinevirtual

Writes an unsigned long value to the stream.

Parameters
valueThe unsigned long value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedLongs ( const unsigned long *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of unsigned long values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedShort ( unsigned short  value)
inlinevirtual

Writes an unsigned short value to the stream.

Parameters
valueThe unsigned short value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUnsignedShorts ( const unsigned short *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of unsigned short values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putUString ( const unsigned short *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of char values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putWchar_t ( wchar_t  value)
inlinevirtual

Writes a wchar_t value to the stream.

Parameters
valueThe wchar_t value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putWchar_ts ( const wchar_t *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of wchar_t values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putWCharacter ( wchar_t  value)
inlinevirtual

Writes a WideCharacter value to the stream.

Parameters
valueThe WideCharacter value to be written to the stream.

Implements RWDataOutputStreamImp.

virtual void RWDataToVirtualOutputStreamImp::putWString ( const wchar_t *  arrayPt,
RWSize  count 
)
inlinevirtual

Writes an array of char values to the stream.

Parameters
arrayPtA pointer to the array's first element.
countThe number of element(s) to be written to the stream.

Implements RWDataOutputStreamImp.

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.