Implements a simple lock stream that can be used with any kind of output stream. More...
#include <rw/stream/RWTOutputStreamLockImp.h>
Inherits FilteredOutputStreamImp.
Public Types | |
typedef OutputStream::element_type | element_type |
typedef OutputStream | RWOutputStream_type |
Public Member Functions | |
virtual | ~RWTOutputStreamLockImp () |
virtual OutputStream | acquire () |
virtual void | close () |
virtual void | flush () |
virtual bool | isBad () const |
virtual bool | isFail () const |
virtual bool | isGood () const |
virtual void | release () |
virtual void | write (element_type value) |
virtual void | write (const element_type *array, RWSize numElements) |
Static Public Member Functions | |
static OutputStream | make (const OutputStream &sinkStream) |
Protected Member Functions | |
RWTOutputStreamLockImp (const OutputStream &sinkStream) | |
RWMutexLock & | getStreamMutex () |
RWMutexLock & | getStreamMutex () const |
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::element_type RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::element_type |
A typedef for the type of element to be written to RWOutputStream_type.
typedef OutputStream RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::RWOutputStream_type |
A typedef for the template parameter OutputStream
which will be used as the sink for elements.
|
virtual |
Destructor.
|
protected |
Initializes the reference to the output stream that will be used as the sink of elements.
sinkStream | The output stream that will serve as the sink of elements. |
|
virtual |
Acquires the stream's internal synchronization mechanism. The acquire() member function returns a handle to the next processing stream.
|
virtual |
Calls close() on the next processing stream.
|
virtual |
Calls flush() on the next processing stream.
|
inlineprotected |
These functions return the stream's internal synchronization mechanism. They throw no exceptions.
|
inlineprotected |
These functions return the stream's internal synchronization mechanism. They throw no exceptions.
|
virtual |
Returns true
to indicate a loss of integrity resulting from an output operation. Throws no exceptions.
|
virtual |
Returns true
to indicate that an output operation failed to generate the desired data. Throws no exceptions.
|
virtual |
Returns true
to indicate a stream in a valid state. Throws no exceptions.
|
inlinestatic |
Constructs an RWTOutputStreamLockImp instance that uses sinkStream as its sink of elements, and returns a handle to it. Throws no exceptions.
sinkStream | The output stream that will serve as the sink of elements. |
|
virtual |
Releases the stream's internal synchronization mechanism.
|
virtual |
Writes a single element to the stream.
value | The element to be written to the stream. |
|
virtual |
Writes an array of elements to the stream.
array | A pointer to the first element of the array. |
numElements | The number of elements to be written to the stream. |
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |