SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Implements a simple lock stream that can be used with any kind of output stream. More...
#include <rw/stream/RWTOutputStreamLockImp.h>
Public Types | |
typedef OutputStream | RWOutputStream_type |
typedef OutputStream::element_type | element_type |
Public Member Functions | |
virtual | ~RWTOutputStreamLockImp () |
virtual void | write (element_type value) |
virtual void | write (const element_type *array, RWSize numElements) |
virtual void | close () |
virtual void | flush () |
virtual bool | isBad () const |
virtual bool | isFail () const |
virtual bool | isGood () const |
virtual OutputStream | acquire () |
virtual void | release () |
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 RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::~RWTOutputStreamLockImp | ( | ) | [virtual] |
Destructor.
RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::RWTOutputStreamLockImp | ( | const OutputStream & | sinkStream | ) | [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 OutputStream RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::acquire | ( | ) | [virtual] |
Acquires the stream's internal synchronization mechanism. The acquire() member function returns a handle to the next processing stream.
virtual void RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::close | ( | ) | [virtual] |
Calls close() on the next processing stream.
virtual void RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::flush | ( | ) | [virtual] |
Calls flush() on the next processing stream.
RWMutexLock & RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::getStreamMutex | ( | ) | const [inline, protected] |
These functions return the stream's internal synchronization mechanism. They throw no exceptions.
RWMutexLock & RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::getStreamMutex | ( | ) | [inline, protected] |
These functions return the stream's internal synchronization mechanism. They throw no exceptions.
virtual bool RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::isBad | ( | ) | const [virtual] |
Returns true
to indicate a loss of integrity resulting from an output operation. Throws no exceptions.
virtual bool RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::isFail | ( | ) | const [virtual] |
Returns true
to indicate that an output operation failed to generate the desired data. Throws no exceptions.
virtual bool RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::isGood | ( | ) | const [virtual] |
Returns true
to indicate a stream in a valid state. Throws no exceptions.
static OutputStream RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::make | ( | const OutputStream & | sinkStream | ) | [inline, static] |
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 void RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::release | ( | ) | [virtual] |
Releases the stream's internal synchronization mechanism.
virtual void RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::write | ( | const element_type * | array, | |
RWSize | numElements | |||
) | [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. |
virtual void RWTOutputStreamLockImp< OutputStream, FilteredOutputStreamImp >::write | ( | element_type | value | ) | [virtual] |
Writes a single element to the stream.
value | The element to be written to the stream. |
© 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.