Module: Advanced Tools Package: Streams
RWTOutputStreamLockImp FilteredOutputStreamImp
acquire() close() element_type flush() |
getStreamMutex() isBad() isFail() isGood() |
make() release() RWOutputStream_type RWTOutputStreamLockImp() |
write() ~RWTOutputStreamLockImp() |
#include <rw/stream/RWTOutputStreamLockImp.h>
The class RWTOutputStreamLockImp implements a simple lock stream that can be used with any kind of output stream. The stream locks its internal synchronization mechanism before forwarding output requests to its associated sink stream, and then unlock 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.
typedef OutputStream RWOutputStream_type RWOutputStream_type typedef OutputStream::element_type element_type
RWTOutputStreamLockImp(OutputStream& sinkStream);
Initializes the reference to the output stream that will be used as the sink of elements.
Parameter List
sinkStream |
The output stream that will serve as the sink of elements. |
virtual ~RWTOutputStreamLockImp();
Destructor.
static OutputStream make(OutputStream& sinkStream);
Constructs an RWTOutputStreamLockImp instance that uses sinkStream as its sink of elements, and returns a handle to it. Throws no exceptions.
Parameter List
sinkStream |
The output stream that will serve as the sink of elements. |
virtual OutputStream acquire();
Acquires the stream's internal synchronization mechanism. The acquire() member function returns a handle to the next processing stream.
virtual void close();
Calls close() on the next processing stream.
virtual void flush();
Calls flush() on the next processing stream.
virtual bool isBad() const;
Returns true to indicate a loss of integrity resulting from an output operation. Throws no exceptions.
virtual bool isFail() const;
Returns true to indicate that an output operation failed to generate the desired data. Throws no exceptions.
virtual bool isGood() const;
Returns true to indicate a stream in a valid state. Throws no exceptions.
virtual void release();
Releases the stream's internal synchronization mechanism.
virtual void write(const element_type* array, RWSize numElements);
Writes an array of elements to the stream.
Parameter List
array |
A pointer to the first element of the array. |
numElements |
The number of elements to be written to the stream. |
virtual void write(element_type value);
Writes a single element to the stream.
Parameter List
value |
The element to be written to the stream. |
RWMutexLock& getStreamMutex() const; RWMutexLock& getStreamMutex();
These functions return the stream's internal synchronization mechanism. They throw no exceptions.
© 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.