SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
RWSynchronizedWCharInputStreamImp Class Reference

Implementation of a simple lock stream that can be used with a wide character input stream. More...

#include <rw/stream/RWSynchronizedWCharInputStreamImp.h>

Inheritance diagram for RWSynchronizedWCharInputStreamImp:
RWTInputStreamLockImp< RWWCharInputStream, RWFilteredWCharInputStreamImp > RWFilteredWCharInputStreamImp RWWCharInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Member Functions

virtual RWSize readUntil (wchar_t *wcharArray, RWSize maxSize, wchar_t delim)
 
- Public Member Functions inherited from RWTInputStreamLockImp< RWWCharInputStream, RWFilteredWCharInputStreamImp >
virtual ~RWTInputStreamLockImp ()
 
virtual RWWCharInputStream acquire ()
 
virtual RWSize available () const
 
virtual void close ()
 
virtual bool isBad () const
 
virtual bool isEof () const
 
virtual bool isFail () const
 
virtual bool isGood () const
 
virtual element_type read ()
 
virtual RWSize read (element_type *array, RWSize num)
 
virtual void release ()
 
virtual RWSize skip (RWSize numUnits)
 
- Public Member Functions inherited from RWFilteredWCharInputStreamImp
virtual ~RWFilteredWCharInputStreamImp ()
 
- Public Member Functions inherited from RWWCharInputStreamImp
virtual ~RWWCharInputStreamImp ()
 
- Public Member Functions inherited from RWInputStreamImp
virtual ~RWInputStreamImp ()
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 

Static Public Member Functions

static RWWCharInputStream make (const RWWCharInputStream &sourceStream)
 
- Static Public Member Functions inherited from RWTInputStreamLockImp< RWWCharInputStream, RWFilteredWCharInputStreamImp >
static RWWCharInputStream make (const RWWCharInputStream &sourceStream)
 

Protected Member Functions

 RWSynchronizedWCharInputStreamImp (const RWWCharInputStream &sourceStream)
 
- Protected Member Functions inherited from RWTInputStreamLockImp< RWWCharInputStream, RWFilteredWCharInputStreamImp >
 RWTInputStreamLockImp (const RWWCharInputStream &sourceStream)
 
RWMutexLockgetStreamMutex ()
 
RWMutexLockgetStreamMutex () const
 
- Protected Member Functions inherited from RWFilteredWCharInputStreamImp
 RWFilteredWCharInputStreamImp (const RWWCharInputStream &sourceStream)
 
RWWCharInputStreamgetSourceStream ()
 
const RWWCharInputStreamgetSourceStream () const
 
- Protected Member Functions inherited from RWWCharInputStreamImp
 RWWCharInputStreamImp ()
 
- Protected Member Functions inherited from RWInputStreamImp
 RWInputStreamImp ()
 
- 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

- Public Types inherited from RWTInputStreamLockImp< RWWCharInputStream, RWFilteredWCharInputStreamImp >
typedef RWWCharInputStream::element_type element_type
 
typedef RWWCharInputStream RWInputStream_type
 
- 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

Class RWSynchronizedWCharInputStreamImp implements a simple lock stream that is used with wide character input stream. The stream locks its internal synchronization mechanism before forwarding input requests to its associated source stream, and then unlocks the internal synchronization mechanism upon completion. The stream's internal synchronization mechanism is locked using a guard object, ensuring its proper release in the event that an exception is thrown.

Constructor & Destructor Documentation

RWSynchronizedWCharInputStreamImp::RWSynchronizedWCharInputStreamImp ( const RWWCharInputStream sourceStream)
protected

Initializes the reference to the input stream that will be used as the source of wide characters.

Parameters
sourceStreamThe input stream that will serve as the source of wide characters.

Member Function Documentation

static RWWCharInputStream RWSynchronizedWCharInputStreamImp::make ( const RWWCharInputStream sourceStream)
inlinestatic

Constructs an RWSynchronizedWCharInputStreamImp instance that uses sourceStream as its source of wide characters, and returns a handle to it. Throws no exceptions.

Parameters
sourceStreamThe output stream that will serve as the source of wide characters.
virtual RWSize RWSynchronizedWCharInputStreamImp::readUntil ( wchar_t *  wcharArray,
RWSize  maxSize,
wchar_t  delim 
)
virtual

Reads wide characters from the attached source stream until the last wide character read is equal to delim, or maxSize wide characters have been read, or the end of the input sequence is reached. The wide characters read are stored in wcharArray. The function returns the actual number of wide characters read from the stream.

Parameters
wcharArrayA pointer to the array receiving the wide character(s) extracted from the stream.
maxSizeThe maximum number of wide character(s) to be read.
delimThe wide character used as a delimiter.

Reimplemented from RWFilteredWCharInputStreamImp.

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