SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions
RWChainedByteArrayOutputStreamImp Class Reference

Concrete class implementing the byte array output stream interface. More...

#include <rw/stream/RWChainedByteArrayOutputStreamImp.h>

Inheritance diagram for RWChainedByteArrayOutputStreamImp:
RWByteArrayOutputStreamImp RWByteOutputStreamImp RWOutputStreamImp RWStreamImp RWBodyBase RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock >

Public Member Functions

virtual ~RWChainedByteArrayOutputStreamImp ()
 
virtual void clear ()
 
virtual void close ()
 
virtual void flush ()
 
virtual RWBytegetByteArray ()
 
virtual RWSize getByteArraySize () const
 
virtual bool isBad () const
 
virtual bool isFail () const
 
virtual bool isGood () const
 
virtual void write (RWByte byteValue)
 
virtual void write (const RWByte *byteArray, RWSize numBytes)
 
- Public Member Functions inherited from RWByteArrayOutputStreamImp
virtual ~RWByteArrayOutputStreamImp ()
 
- Public Member Functions inherited from RWByteOutputStreamImp
virtual ~RWByteOutputStreamImp ()
 
virtual RWByteOutputStream acquire ()
 
virtual void release ()
 
- Public Member Functions inherited from RWOutputStreamImp
virtual ~RWOutputStreamImp ()
 
- Public Member Functions inherited from RWStreamImp
virtual ~RWStreamImp ()
 

Static Public Member Functions

static RWByteArrayOutputStream make ()
 

Protected Member Functions

 RWChainedByteArrayOutputStreamImp ()
 
RWChainedMemoryStreambufgetSinkBuff ()
 
const RWChainedMemoryStreambufgetSinkBuff () const
 
- Protected Member Functions inherited from RWByteArrayOutputStreamImp
 RWByteArrayOutputStreamImp ()
 
- Protected Member Functions inherited from RWByteOutputStreamImp
 RWByteOutputStreamImp ()
 
- Protected Member Functions inherited from RWOutputStreamImp
 RWOutputStreamImp ()
 
- Protected Member Functions inherited from RWStreamImp
 RWStreamImp ()
 
- Protected Member Functions inherited from RWBodyBase
 RWBodyBase (void)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (const RWBodyBase &second)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (unsigned initCount=0)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
RWTCountingBody< RWMutexLock > & operator= (const RWTCountingBody< RWMutexLock > &second)
 
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 
- Protected Member Functions inherited from RWTMonitor< RWMutexLock >
 RWTMonitor ()
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 ~RWTMonitor ()
 
void acquire ()
 
bool isAcquired () const
 
RWTMonitor< RWMutexLock > & monitor () const
 
RWMutexLockmutex ()
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release ()
 
bool tryAcquire ()
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 

Detailed Description

Concrete class implementing the byte array output stream interface. Bytes inserted into an instance of class RWChainedByteArrayOutputStreamImp are stored in memory using an instance of class RWChainedMemoryStreambuf. Implements the body idiom from the handle-body pattern.

Constructor & Destructor Documentation

virtual RWChainedByteArrayOutputStreamImp::~RWChainedByteArrayOutputStreamImp ( )
virtual

Destructor.

RWChainedByteArrayOutputStreamImp::RWChainedByteArrayOutputStreamImp ( )
inlineprotected

Constructor.

Member Function Documentation

virtual void RWChainedByteArrayOutputStreamImp::clear ( )
virtual

Resets the underlying buffer.

Implements RWByteArrayOutputStreamImp.

virtual void RWChainedByteArrayOutputStreamImp::close ( )
virtual

This function calls flush().

Reimplemented from RWOutputStreamImp.

virtual void RWChainedByteArrayOutputStreamImp::flush ( )
virtual

Forward the flush() request to the internal RWChainedMemoryStreambuf object.

Implements RWOutputStreamImp.

virtual RWByte* RWChainedByteArrayOutputStreamImp::getByteArray ( )
virtual

Returns a pointer to an array of bytes containing the bytes inserted into the stream since its creation, or since the last invocation of function getByteArray(), or function clear(). Users are responsible for freeing the memory associated with the array returned by this function, by using operator delete[].

Implements RWByteArrayOutputStreamImp.

virtual RWSize RWChainedByteArrayOutputStreamImp::getByteArraySize ( ) const
virtual

Returns the size of the byte array that would be returned by a call to function getByteArray().

Implements RWByteArrayOutputStreamImp.

RWChainedMemoryStreambuf& RWChainedByteArrayOutputStreamImp::getSinkBuff ( )
inlineprotected

Returns a reference to the RWChainedMemoryStreambuf, used as the sink of bytes.

const RWChainedMemoryStreambuf& RWChainedByteArrayOutputStreamImp::getSinkBuff ( ) const
inlineprotected

Returns a reference to the RWChainedMemoryStreambuf, used as the sink of bytes.

virtual bool RWChainedByteArrayOutputStreamImp::isBad ( ) const
virtual

Returns true if the last operation performed on the internal RWChainedMemoryStreambuf object failed.

Implements RWStreamImp.

virtual bool RWChainedByteArrayOutputStreamImp::isFail ( ) const
virtual

Returns true if the last operation performed on the internal RWChainedMemoryStreambuf object failed.

Implements RWStreamImp.

virtual bool RWChainedByteArrayOutputStreamImp::isGood ( ) const
virtual

Returns true if the last operation performed on the internal RWChainedMemoryStreambuf object succeeded.

Implements RWStreamImp.

static RWByteArrayOutputStream RWChainedByteArrayOutputStreamImp::make ( void  )
inlinestatic

Constructs an RWChainedByteArrayOutputStreamImp instance that uses an instance of class RWChainedMemoryStreambuf to store bytes. The function returns a handle to the implementation class.

virtual void RWChainedByteArrayOutputStreamImp::write ( RWByte  byteValue)
virtual

Writes a single byte to the iostreams std::streambuf. Throws exception RWExternalStreamException.

Parameters
byteValueThe byte to be written.

Implements RWByteOutputStreamImp.

virtual void RWChainedByteArrayOutputStreamImp::write ( const RWByte byteArray,
RWSize  numBytes 
)
virtual

Writes an array of bytes to the iostreams std::streambuf. Throws exception RWIncompleteStreamOperation.

Parameters
byteArrayA pointer to the first element of the array.
numBytesThe number of bytes to be written.

Implements RWByteOutputStreamImp.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.