SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWBodyBase &second)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (void)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (unsigned initCount=0)
 
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 (const RWTMonitor< RWMutexLock > &second)
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (void)
 
 ~RWTMonitor (void)
 
void acquire (void)
 
bool isAcquired (void) const
 
RWTMonitor< RWMutexLock > & monitor (void) const
 
RWMutexLockmutex (void)
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release (void)
 
bool tryAcquire (void)
 

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 <fstream.h>
#include <iostream.h>
int main() {
ofstream of;
of.open("RWDataToVirtualOutputStreamImp.out", ios::out);
RWpostream pstrm(of);
int i = 5;
out << i;
return 0;
}
Handle class for all the data output stream implementation classes.
Definition RWDataOutputStream.h:32
static RWDataOutputStream make(RWvostream &vstrm)
Definition RWDataToVirtualOutputStreamImp.h:89
Specializes the abstract base class RWvostream to store variables in a portable (printable) US-ASCII ...
Definition pstream.h:398

Constructor & Destructor Documentation

◆ RWDataToVirtualOutputStreamImp()

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

◆ flush()

virtual void RWDataToVirtualOutputStreamImp::flush ( )
inlinevirtual

Flushes the stream.

Implements RWOutputStreamImp.

◆ isBad()

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.

◆ isFail()

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.

◆ isGood()

virtual bool RWDataToVirtualOutputStreamImp::isGood ( ) const
inlinevirtual

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

Implements RWStreamImp.

◆ make()

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.

◆ putBool()

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.

◆ putBools()

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.

◆ putChar()

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.

◆ putCharacter()

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.

◆ putChars()

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.

◆ putDouble()

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.

◆ putDoubles()

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.

◆ putFloat()

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.

◆ putFloats()

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.

◆ putInt()

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.

◆ putInts()

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.

◆ putLong()

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.

◆ putLongDouble()

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.

◆ putLongDoubles()

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.

◆ putLongLong()

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.

◆ putLongLongs()

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.

◆ putLongs()

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.

◆ putShort()

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.

◆ putShorts()

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.

◆ putSignedChar()

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.

◆ putSignedChars()

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.

◆ putString()

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.

◆ putUCharacter()

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.

◆ putUnsignedChar()

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.

◆ putUnsignedChars()

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.

◆ putUnsignedInt()

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.

◆ putUnsignedInts()

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.

◆ putUnsignedLong()

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.

◆ putUnsignedLongs()

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.

◆ putUnsignedShort()

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.

◆ putUnsignedShorts()

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.

◆ putUString()

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.

◆ putWchar_t()

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.

◆ putWchar_ts()

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.

◆ putWCharacter()

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.

◆ putWString()

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.