LibreOffice Module comphelper (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
comphelper::OSequenceOutputStream Class Referencefinal

#include <seqstream.hxx>

Inheritance diagram for comphelper::OSequenceOutputStream:
[legend]
Collaboration diagram for comphelper::OSequenceOutputStream:
[legend]

Public Member Functions

 OSequenceOutputStream (css::uno::Sequence< sal_Int8 > &_rSeq, double _nResizeFactor=1.3, sal_Int32 _nMinimumResize=128)
 constructs the object. More...
 
virtual void SAL_CALL writeBytes (const css::uno::Sequence< sal_Int8 > &aData) override
 same as XOutputStream::writeBytes (as expected :) More...
 
virtual void SAL_CALL flush () override
 this is a dummy in this implementation, no buffering is used More...
 
virtual void SAL_CALL closeOutput () override
 closes the output stream. More...
 

Private Member Functions

void finalizeOutput ()
 
virtual ~OSequenceOutputStream () override
 

Private Attributes

css::uno::Sequence< sal_Int8 > & m_rSequence
 
double m_nResizeFactor
 
sal_Int32 const m_nMinimumResize
 
sal_Int32 m_nSize
 
bool m_bConnected
 
::osl::Mutex m_aMutex
 

Detailed Description

Definition at line 72 of file seqstream.hxx.

Constructor & Destructor Documentation

virtual comphelper::OSequenceOutputStream::~OSequenceOutputStream ( )
inlineoverrideprivatevirtual

Definition at line 88 of file seqstream.hxx.

comphelper::OSequenceOutputStream::OSequenceOutputStream ( css::uno::Sequence< sal_Int8 > &  _rSeq,
double  _nResizeFactor = 1.3,
sal_Int32  _nMinimumResize = 128 
)

constructs the object.

Everything written into the stream through the XOutputStream methods will be forwarded to the sequence, reallocating it if necessary. Writing will start at offset 0 within the sequence.

Parameters
_rSeqa reference to the sequence which will be used for output. The caller is responsible for taking care of the lifetime of the stream object and the sequence. If you're in doubt about this, use closeOutput before destroying the sequence
_nResizeFactorthe factor which is used for resizing the sequence when necessary. In every resize step, the new sequence size will be calculated by multiplying the current size with this factor, rounded off to the next multiple of 4.
_nMinimumResizethe minimal number of bytes which is additionally allocated on resizing
See also
closeOutput

Definition at line 136 of file seqstream.cxx.

References m_nResizeFactor.

Member Function Documentation

void SAL_CALL comphelper::OSequenceOutputStream::closeOutput ( )
overridevirtual

closes the output stream.

In the case of this class, this means that the sequence used for writing is resized to the really used size and not used any further, every subsequent call to one of the XOutputStream methods will throw a NotConnectedException.

Definition at line 210 of file seqstream.cxx.

References finalizeOutput(), m_aMutex, and m_bConnected.

void comphelper::OSequenceOutputStream::finalizeOutput ( )
private

Definition at line 200 of file seqstream.cxx.

References m_aMutex, m_bConnected, m_nSize, and m_rSequence.

Referenced by closeOutput().

void SAL_CALL comphelper::OSequenceOutputStream::flush ( )
overridevirtual

this is a dummy in this implementation, no buffering is used

Definition at line 190 of file seqstream.cxx.

References m_aMutex, m_bConnected, m_nSize, and m_rSequence.

void SAL_CALL comphelper::OSequenceOutputStream::writeBytes ( const css::uno::Sequence< sal_Int8 > &  aData)
overridevirtual

same as XOutputStream::writeBytes (as expected :)

Definition at line 150 of file seqstream.cxx.

References m_aMutex, m_bConnected, m_nMinimumResize, m_nResizeFactor, m_nSize, and m_rSequence.

Member Data Documentation

::osl::Mutex comphelper::OSequenceOutputStream::m_aMutex
private

Definition at line 86 of file seqstream.hxx.

Referenced by closeOutput(), finalizeOutput(), flush(), and writeBytes().

bool comphelper::OSequenceOutputStream::m_bConnected
private

Definition at line 83 of file seqstream.hxx.

Referenced by closeOutput(), finalizeOutput(), flush(), and writeBytes().

sal_Int32 const comphelper::OSequenceOutputStream::m_nMinimumResize
private

Definition at line 78 of file seqstream.hxx.

Referenced by writeBytes().

double comphelper::OSequenceOutputStream::m_nResizeFactor
private

Definition at line 77 of file seqstream.hxx.

Referenced by OSequenceOutputStream(), and writeBytes().

sal_Int32 comphelper::OSequenceOutputStream::m_nSize
private

Definition at line 79 of file seqstream.hxx.

Referenced by finalizeOutput(), flush(), and writeBytes().

css::uno::Sequence< sal_Int8 >& comphelper::OSequenceOutputStream::m_rSequence
private

Definition at line 76 of file seqstream.hxx.

Referenced by finalizeOutput(), flush(), and writeBytes().


The documentation for this class was generated from the following files: