SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
A simple guard stream that can be used with any kind of input/output stream. More...
#include <rw/stream/RWTStreamGuardImp.h>
Public Member Functions | |
virtual | ~RWTStreamGuardImp () |
Static Public Member Functions | |
static StreamHandle | make (StreamHandle &stream) |
Protected Member Functions | |
RWTStreamGuardImp (StreamHandle &stream) | |
StreamHandle & | getNextStream () |
const StreamHandle & | getNextStream () const |
Friends | |
RWCharOutputStream | rwGuard (RWCharOutputStream &stream) |
RWByteOutputStream | rwGuard (RWByteOutputStream &stream) |
RWDataOutputStream | rwGuard (RWDataOutputStream &stream) |
RWUCharOutputStream | rwGuard (RWUCharOutputStream &stream) |
RWWCharOutputStream | rwGuard (RWWCharOutputStream &stream) |
RWCharInputStream | rwGuard (RWCharInputStream &stream) |
RWByteInputStream | rwGuard (RWByteInputStream &stream) |
RWDataInputStream | rwGuard (RWDataInputStream &stream) |
RWUCharInputStream | rwGuard (RWUCharInputStream &stream) |
RWWCharInputStream | rwGuard (RWWCharInputStream &stream) |
The class RWTStreamGuardImp implements a simple guard stream that can be used with any kind of input/output stream. The stream guard acquires the synchronization mechanism provided by its source/sink stream at construction time, and releases it upon destruction. The guard stream doesn't maintain its own synchronization mechanism, but rather uses the one provided by the next processing stream. If the next processing stream doesn't implement any synchronization mechanism, then the stream guard class has no effect. The guard class is generally used in combination with one of the synchronization classes RWSynchronizedByteInputStreamImp, RWSynchronizedByteOutputStreamImp, RWSynchronizedCharInputStreamImp, RWSynchronizedCharOutputStreamImp, RWSynchronizedDataInputStreamImp, RWSynchronizedDataOutputStreamImp, RWSynchronizedUCharInputStreamImp, RWSynchronizedUCharOutputStreamImp, RWSynchronizedWCharInputStreamImp, or RWSynchronizedWCharOutputStreamImp.
virtual RWTStreamGuardImp< StreamHandle, FilteredStreamImp >::~RWTStreamGuardImp | ( | ) | [virtual] |
Destructor. Releases the lock acquired in the guard stream constructor. If the next processing stream doesn't provide a synchronization mechanism, then the destructor has no effect. Throws no exceptions.
RWTStreamGuardImp< StreamHandle, FilteredStreamImp >::RWTStreamGuardImp | ( | StreamHandle & | stream | ) | [protected] |
Initializes the reference to the stream that will be used as source/sink of elements. Acquires the synchronization mechanism provided by stream if any.
stream | The stream that will serve as the source/sink of elements. |
const StreamHandle & RWTStreamGuardImp< StreamHandle, FilteredStreamImp >::getNextStream | ( | ) | const [inline, protected] |
Returns a handle to the next processing stream. Throw no exceptions.
StreamHandle & RWTStreamGuardImp< StreamHandle, FilteredStreamImp >::getNextStream | ( | ) | [inline, protected] |
Returns a handle to the next processing stream. Throw no exceptions.
static StreamHandle RWTStreamGuardImp< StreamHandle, FilteredStreamImp >::make | ( | StreamHandle & | stream | ) | [inline, static] |
Constructs an RWTStreamGuardImp instance that uses stream as its source/sink of elements, and returns a handle to it. Throws no exceptions.
stream | The stream that will serve as the source/sink of elements. |
RWWCharInputStream rwGuard | ( | RWWCharInputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of extraction operations.
stream | A wide character input stream. |
#include <rw/stream/RWGuardedWCharInputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: instr >> rwGuard >> data1 >> data2 >> data3;
RWUCharInputStream rwGuard | ( | RWUCharInputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of extraction operations.
stream | A UTF-16 character input stream. |
#include <rw/stream/RWGuardedUCharInputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: instr >> rwGuard >> data1 >> data2 >> data3;
RWDataInputStream rwGuard | ( | RWDataInputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of extraction operations.
stream | A data input stream. |
#include <rw/stream/RWGuardedDataInputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: instr >> rwGuard >> data1 >> data2 >> data3;
RWByteInputStream rwGuard | ( | RWByteInputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of extraction operations.
stream | A binary input stream. |
#include <rw/stream/RWGuardedByteInputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three extractions: instr >> rwGuard >> data1 >> data2 >> data3;
RWCharInputStream rwGuard | ( | RWCharInputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of extraction operations.
stream | A narrow character input stream. |
#include <rw/stream/RWGuardedCharInputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any extractions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: instr >> rwGuard >> data1 >> data2 >> data3;
RWWCharOutputStream rwGuard | ( | RWWCharOutputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of insertion operations.
stream | A wide character output stream. |
#include <rw/stream/RWGuardedWCharOutputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any insertions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: ostr << rwGuard << data1 << data2 << data3;
RWUCharOutputStream rwGuard | ( | RWUCharOutputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of insertion operations.
stream | A UTF-16 character output stream. |
#include <rw/stream/RWGuardedUCharOutputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any insertions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: ostr << rwGuard << data1 << data2 << data3;
RWDataOutputStream rwGuard | ( | RWDataOutputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of insertion operations.
stream | A binary output stream. |
#include <rw/stream/RWGuardedDataOutputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any insertions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: ostr << rwGuard << data1 << data2 << data3;
RWByteOutputStream rwGuard | ( | RWByteOutputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of insertion operations.
stream | A binary output stream |
#include <rw/stream/RWGuardedByteOutputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any insertions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: ostr << rwGuard << data1 << data2 << data3;
RWCharOutputStream rwGuard | ( | RWCharOutputStream & | stream | ) | [friend] |
Manipulator that is used to guard a series of insertion operations.
stream | A narrow character output stream |
#include <rw/stream/RWGuardedCharOutputStreamImp.h>
A rwGuard() manipulator creates a temporary guarded stream that locks the internal mutex of the preceding synchronized stream. In this way, any insertions following the manipulator within the statement will be atomic, that is, uninterrupted by any other threads. Note that if the preceding stream is not a synchronized stream, the rwGuard() manipulator has no effect.
// Lock the stream for the duration of all three insertions: ostr << rwGuard << data1 << data2 << data3;
© 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.