SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWByteOutputStream Class Reference

Handle class for all binary output stream implementation classes. More...

#include <rw/stream/RWByteOutputStream.h>

Inheritance diagram for RWByteOutputStream:
RWHandleBase RWByteArrayOutputStream

Public Member Functions

 RWByteOutputStream (const RWByteOutputStream &handle)
 
 RWByteOutputStream (RWByteOutputStreamImp *ptr)
 
void close ()
 
void flush ()
 
bool isBad () const
 
bool isFail () const
 
bool isGood () const
 
RWByteOutputStreamoperator<< (RWByte byteValue)
 
RWByteOutputStreamoperator<< (RWByteOutputStream &(*pf)(RWByteOutputStream &))
 
RWByteOutputStream operator<< (RWByteOutputStream(*pf)(RWByteOutputStream &))
 
RWByteOutputStreamoperator= (const RWByteOutputStream &handle)
 
void write (const RWByte *byteArray, RWSize numBytes)
 
void write (RWByte byteValue)
 
- Public Member Functions inherited from RWHandleBase
bool isValid (void) const
 
bool operator!= (const RWHandleBase &second) const
 
bool operator== (const RWHandleBase &second) const
 

Friends

class RWTStreamGuardImp< RWByteOutputStream, RWFilteredByteOutputStreamImp >
 

Related Symbols

(Note that these are not member symbols.)

RWByteOutputStreamrwFlush (RWByteOutputStream &stream)
 
RWByteOutputStream rwGuard (RWByteOutputStream &stream)
 

Additional Inherited Members

- Protected Member Functions inherited from RWHandleBase
 RWHandleBase (const RWHandleBase &second)
 
 RWHandleBase (RWBodyBase *body)
 
 RWHandleBase (RWStaticCtor)
 
 RWHandleBase (void)
 
 ~RWHandleBase (void)
 
RWBodyBasebody (void) const
 
RWHandleBaseoperator= (const RWHandleBase &second)
 

Detailed Description

Handle class for all the binary output stream implementation classes. Implements the handle idiom from the handle-body pattern.

Constructor & Destructor Documentation

◆ RWByteOutputStream() [1/2]

RWByteOutputStream::RWByteOutputStream ( RWByteOutputStreamImp * ptr)
inlineexplicit

Constructor.

◆ RWByteOutputStream() [2/2]

RWByteOutputStream::RWByteOutputStream ( const RWByteOutputStream & handle)
inline

Copy constructor.

Parameters
handleA binary stream handle used to initialize the newly created handle.

Exception none.

Member Function Documentation

◆ close()

void RWByteOutputStream::close ( )
inline

Closes the stream.

◆ flush()

void RWByteOutputStream::flush ( )
inline

Flushes the stream.

◆ isBad()

bool RWByteOutputStream::isBad ( ) const
inline

Returns true to indicate a loss of integrity resulting from an output operation.

◆ isFail()

bool RWByteOutputStream::isFail ( ) const
inline

Returns true to indicate that an output operation failed to generate the desired data.

◆ isGood()

bool RWByteOutputStream::isGood ( ) const
inline

Returns true to indicate a stream in a valid state.

◆ operator<<() [1/3]

RWByteOutputStream & RWByteOutputStream::operator<< ( RWByte byteValue)
inline

Writes a single byte to the stream.

Parameters
byteValueThe byte to be written to the stream.

◆ operator<<() [2/3]

RWByteOutputStream & RWByteOutputStream::operator<< ( RWByteOutputStream &(* pf )(RWByteOutputStream &))
inline

Inserter executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator<<() [3/3]

RWByteOutputStream RWByteOutputStream::operator<< ( RWByteOutputStream(* pf )(RWByteOutputStream &))
inline

Inserter executing a manipulator function.

Parameters
pfThe manipulator's function pointer.

◆ operator=()

RWByteOutputStream & RWByteOutputStream::operator= ( const RWByteOutputStream & handle)
inline

Assignment operator.

Parameters
handleA binary stream handle used to initialize this handle.

Exception none.

◆ write() [1/2]

void RWByteOutputStream::write ( const RWByte * byteArray,
RWSize numBytes )
inline

Writes an array of bytes to the stream.

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

◆ write() [2/2]

void RWByteOutputStream::write ( RWByte byteValue)
inline

Writes a single byte to the stream.

Parameters
byteValueThe byte to be written to the stream.

Friends And Related Symbol Documentation

◆ rwFlush()

RWByteOutputStream & rwFlush ( RWByteOutputStream & stream)
related

Manipulator that flushes a binary output stream.

Parameters
streamThe binary stream to be flushed.

◆ rwGuard()

RWByteOutputStream rwGuard ( RWByteOutputStream & stream)
related
Header File
#include <rw/stream/RWGuardedByteOutputStreamImp.h>

Manipulator that is used to guard a series of insertion operations.

Parameters
streamA binary output stream

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.

Example
// Lock the stream for the duration of all three insertions:
ostr << rwGuard << data1 << data2 << data3;
RWByteOutputStream rwGuard(RWByteOutputStream &stream)

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