SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (const RWByte *byteArray, RWSize numBytes)
 
virtual void write (RWByte byteValue)
 
- 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 (const RWBodyBase &second)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (void)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (unsigned initCount=0)
 
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 (const RWTMonitor< RWMutexLock > &second)
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (void)
 
 ~RWTMonitor (void)
 
void acquire (void)
 
bool isAcquired (void) const
 
RWTMonitor< RWMutexLock > & monitor (void) const
 
RWMutexLockmutex (void)
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release (void)
 
bool tryAcquire (void)
 

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

◆ ~RWChainedByteArrayOutputStreamImp()

virtual RWChainedByteArrayOutputStreamImp::~RWChainedByteArrayOutputStreamImp ( )
virtual

Destructor.

◆ RWChainedByteArrayOutputStreamImp()

RWChainedByteArrayOutputStreamImp::RWChainedByteArrayOutputStreamImp ( )
inlineprotected

Constructor.

Member Function Documentation

◆ clear()

virtual void RWChainedByteArrayOutputStreamImp::clear ( )
virtual

Resets the underlying buffer.

Implements RWByteArrayOutputStreamImp.

◆ close()

virtual void RWChainedByteArrayOutputStreamImp::close ( )
virtual

This function calls flush().

Reimplemented from RWOutputStreamImp.

◆ flush()

virtual void RWChainedByteArrayOutputStreamImp::flush ( )
virtual

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

Implements RWOutputStreamImp.

◆ getByteArray()

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.

◆ getByteArraySize()

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.

◆ getSinkBuff() [1/2]

RWChainedMemoryStreambuf & RWChainedByteArrayOutputStreamImp::getSinkBuff ( )
inlineprotected

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

◆ getSinkBuff() [2/2]

const RWChainedMemoryStreambuf & RWChainedByteArrayOutputStreamImp::getSinkBuff ( ) const
inlineprotected

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

◆ isBad()

virtual bool RWChainedByteArrayOutputStreamImp::isBad ( ) const
virtual

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

Implements RWStreamImp.

◆ isFail()

virtual bool RWChainedByteArrayOutputStreamImp::isFail ( ) const
virtual

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

Implements RWStreamImp.

◆ isGood()

virtual bool RWChainedByteArrayOutputStreamImp::isGood ( ) const
virtual

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

Implements RWStreamImp.

◆ make()

static RWByteArrayOutputStream RWChainedByteArrayOutputStreamImp::make ( )
inlinestatic

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

◆ write() [1/2]

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.

◆ write() [2/2]

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.

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