SourcePro® API Reference Guide

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

Implementation of a simple lock stream that can be used with a UTF-16 character input stream. More...

#include <rw/stream/RWSynchronizedUCharInputStreamImp.h>

Inheritance diagram for RWSynchronizedUCharInputStreamImp:
RWTInputStreamLockImp< RWUCharInputStream, RWFilteredUCharInputStreamImp > RWFilteredUCharInputStreamImp RWUCharInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Member Functions

virtual RWSize readUntil (RWUChar *unicodeArray, RWSize maxSize, RWUChar delim)
 
- Public Member Functions inherited from RWTInputStreamLockImp< RWUCharInputStream, RWFilteredUCharInputStreamImp >
virtual ~RWTInputStreamLockImp ()
 
virtual RWUCharInputStream 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 RWFilteredUCharInputStreamImp
virtual ~RWFilteredUCharInputStreamImp ()
 
- Public Member Functions inherited from RWUCharInputStreamImp
virtual ~RWUCharInputStreamImp ()
 
- Public Member Functions inherited from RWInputStreamImp
virtual ~RWInputStreamImp ()
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 

Static Public Member Functions

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

Protected Member Functions

 RWSynchronizedUCharInputStreamImp (const RWUCharInputStream &sourceStream)
 
- Protected Member Functions inherited from RWTInputStreamLockImp< RWUCharInputStream, RWFilteredUCharInputStreamImp >
 RWTInputStreamLockImp (const RWUCharInputStream &sourceStream)
 
RWMutexLockgetStreamMutex ()
 
RWMutexLockgetStreamMutex () const
 
- Protected Member Functions inherited from RWFilteredUCharInputStreamImp
 RWFilteredUCharInputStreamImp (const RWUCharInputStream &sourceStream)
 
RWUCharInputStreamgetSourceStream ()
 
const RWUCharInputStreamgetSourceStream () const
 
- Protected Member Functions inherited from RWUCharInputStreamImp
 RWUCharInputStreamImp ()
 
- 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< RWUCharInputStream, RWFilteredUCharInputStreamImp >
typedef RWUCharInputStream::element_type element_type
 
typedef RWUCharInputStream 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 RWSynchronizedUCharInputStreamImp implements a simple lock stream that is used with UTF-16 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

RWSynchronizedUCharInputStreamImp::RWSynchronizedUCharInputStreamImp ( const RWUCharInputStream sourceStream)
protected

Initializes the reference to the input stream that will be used as the source of UTF-16 characters.

Parameters
sourceStreamThe input stream that will serve as the source of UTF-16 characters.

Member Function Documentation

static RWUCharInputStream RWSynchronizedUCharInputStreamImp::make ( const RWUCharInputStream sourceStream)
inlinestatic

Constructs an RWSynchronizedUCharInputStreamImp instance that uses sourceStream as its source of UTF-16 characters, and returns a handle to it. Throws no exceptions.

Parameters
sourceStreamThe output stream that will serve as the source of UTF-16 characters.
virtual RWSize RWSynchronizedUCharInputStreamImp::readUntil ( RWUChar unicodeArray,
RWSize  maxSize,
RWUChar  delim 
)
virtual

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

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

Reimplemented from RWFilteredUCharInputStreamImp.

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