Module: Advanced Tools Package: Streams
RWSynchronizedDataOutputStreamImp RWFilteredDataOutputStreamImp RWDataOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase
#include <rw/stream/RWSynchronizedDataOutputStreamImp.h>
The class RWSynchronizedDataOutputStreamImp implements a simple lock stream that can be used with data output stream. The stream locks its internal synchronization mechanism before forwarding output requests to its associated sink stream, and then unlocks 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 an exception is thrown.
RWSynchronizedDataOutputStreamImp(RWDataOutputStream&
sinkStream);
Initializes the reference to the data output stream that will be used as the sink of data.
Parameter List
sinkStream |
The data output stream that will serve as the sink of elements. |
virtual ~RWSynchronizedDataOutputStreamImp();
Destructor.
static RWDataOutputStream make(RWDataOutputStream& sinkStream);
Constructs an RWSynchronizedDataOutputStreamImp instance that uses sinkStream as its sink of data, and returns a handle to it. Throws no exceptions.
Parameter List
sinkStream |
The output stream that will serve as the sink of data. |
virtual RWDataOutputStream 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 putBool(bool value); virtual void putChar(char value); virtual void putDouble(double value); virtual void putFloat(float value); virtual void putInt(int value); virtual void putLong(long value); virtual void putLongDouble(long double value); virtual void putLongLong(long long value); virtual void putShort(short value); virtual void putSignedChar(signed char value); virtual void putUnsignedChar(unsigned char value); virtual void putUnsignedInt(unsigned int value); virtual void putUnsignedLong(unsigned long value); virtual void putUnsignedShort(unsigned short value); virtual void putWchar_t(wchar_t value);
These functions forward the writing of a single value to the next processing stream.
Parameter List
value |
The value to be written. |
virtual void putBools(const bool* arrayPt, RWSize count); virtual void putChars(const char* arrayPt, RWSize count); virtual void putDoubles(const double* arrayPt, RWSize count); virtual void putFloats(const float* arrayPt, RWSize count); virtual void putInts(const int* arrayPt, RWSize count); virtual void putLongs(const long* arrayPt, RWSize count); virtual void putLongDoubles(const long double* arrayPt, RWSize count); virtual void putLongLongs(const long long* arrayPt, RWSize count); virtual void putShorts(const short* arrayPt, RWSize count); virtual void putSignedChars(const signed char* arrayPt, RWSize count); virtual void putUnsignedChars(const unsigned char* arrayPt, RWSize count); virtual void putUnsignedInts(const unsigned int* arrayPt, RWSize count); virtual void putUnsignedLongs(const unsigned long* arrayPt, RWSize count); virtual void putUnsignedShorts(const unsigned short* arrayPt,
RWSize count); virtual void putWchar_ts(const wchar_t* arrayPt, RWSize count);
These functions forward the writing of an array of values to the next processing stream.
Parameter List
arrayPt |
A pointer to the first element of the array. |
count |
The number of elements to be written to the stream. |
virtual void putCharacter(char value);
Forwards the writing a single narrow character to the next processing stream.
Parameter List
value |
The narrow character to be written. |
virtual void putString(const char* string, RWSize count);
Forwards the writing of a narrow character string, including embedded nulls, starting at string to the next processing stream.
Parameter List
string |
A pointer to the narrow string's first character. |
count |
The number of narrow characters to be written to the stream. |
virtual void putUCharacter(RWUChar value);
Forwards the writing of a single UTF-16 character to the next processing stream.
Parameter List
value |
The UTF-16 character to be written. |
virtual void putUString(const RWUChar* ustring, RWSize count);
Forwards the writing of a UTF-16 character string, including embedded nulls, starting at ustring to the next processing stream.
Parameter List
ustring |
A pointer to the string's first UTF-16 character. |
count |
The number of UTF-16 characters to be written to the stream. |
virtual void putWCharacter(wchar_t value);
Forwards the writing of a single wide character to the next processing stream.
Parameter List
value |
The wide character to be written. |
virtual void putWString(const wchar_t* wstring, RWSize count);
Forwards the writing of a wide character string, including embedded nulls, starting at wstring to the next processing stream.
Parameter List
wstring |
A pointer to the string's first wide character. |
count |
The number of wide characters to be written to the stream. |
virtual void release();
Releases the stream's internal synchronization mechanism.
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.