rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWSynchronizedByteInputStreamImp Class Reference
[Streams]

Implementation of a simple lock stream that is used with a binary input stream. More...

#include <rw/stream/RWSynchronizedByteInputStreamImp.h>

Inheritance diagram for RWSynchronizedByteInputStreamImp:
RWTInputStreamLockImp< RWByteInputStream, RWFilteredByteInputStreamImp > RWFilteredByteInputStreamImp RWByteInputStreamImp RWInputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

List of all members.

Public Member Functions

virtual RWSize readUntil (RWByte *byteArray, RWSize maxSize, RWByte delim)

Static Public Member Functions

static RWByteInputStream make (const RWByteInputStream &sourceStream)

Protected Member Functions

 RWSynchronizedByteInputStreamImp (const RWByteInputStream &sourceStream)

Detailed Description

Class RWSynchronizedByteInputStreamImp implements a simple lock stream that is used with binary 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

RWSynchronizedByteInputStreamImp::RWSynchronizedByteInputStreamImp ( const RWByteInputStream sourceStream  )  [protected]

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

Parameters:
sourceStream The input stream that will serve as the source of bytes.

Member Function Documentation

static RWByteInputStream RWSynchronizedByteInputStreamImp::make ( const RWByteInputStream sourceStream  )  [inline, static]

Constructs an RWSynchronizedByteInputStreamImp instance that uses sourceStream as the source of bytes, and returns a handle to it. Throws no exceptions.

Parameters:
sourceStream The output stream that will serve as the source of bytes.

Reimplemented from RWTInputStreamLockImp< RWByteInputStream, RWFilteredByteInputStreamImp >.

virtual RWSize RWSynchronizedByteInputStreamImp::readUntil ( RWByte byteArray,
RWSize  maxSize,
RWByte  delim 
) [virtual]

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

Parameters:
byteArray A pointer to the array receiving the byte(s) extracted from the stream.
maxSize The maximum number of byte(s) to be read.
delim The byte value used as a delimeter.

Reimplemented from RWFilteredByteInputStreamImp.

 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.