Module: Advanced Tools Package: Streams
RWTStreamGuardImp FilteredStreamImp
#include <rw/stream/RWTStreamGuardImp.h>
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 RWSynchronizedChar/Byte/RWUChar/Wchar/DataInput/OutputStreamImp.
RWTStreamGuardImp(StreamHandle& stream);
Initializes the reference to the stream that will be used as source/sink of elements. Acquires the synchronization mechanism provided by stream if any.
Parameter List
stream |
The stream that will serve as source/sink of elements. |
virtual ~RWTStreamGuardImp();
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.
static StreamHandle make(StreamHandle& stream);
Constructs an RWTStreamGuardImp instance that uses stream as its source/sink of elements, and returns a handle to it. Throws no exceptions.
Parameter List
stream |
The stream that will serve as source/sink of elements. |
StreamHandle& getNextStream(); const StreamHandle& getNextStream() const;
These functions return a handle to the next processing stream. 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.