SourcePro® 2021.1 |
SourcePro® API Reference Guide |
Product Documentation: SourcePro Documentation Home |
Implements a buffered char
or byte
output stream that includes a transformation.
More...
#include <rw/xmlstreams/RWTTransformOutputStreamImp.h>
Inherits FilteredOutputStreamImp.
Public Types | |
typedef OutputStream::element_type | element_type |
typedef OutputStream | RWOutputStream_type |
Public Member Functions | |
virtual | ~RWTTransformOutputStreamImp () |
virtual void | close () |
virtual void | flush () |
virtual void | write (element_type value) |
virtual void | write (const element_type *array, RWSize numElements) |
Static Public Member Functions | |
static OutputStream | make (const OutputStream &sinkStream, Transform transform) |
static OutputStream | make (const OutputStream &sinkStream, Transform transform, RWSize bufSize) |
static OutputStream | make (const OutputStream &sinkStream, Transform transform, element_type *buffer, RWSize bufSize) |
Protected Member Functions | |
RWTTransformOutputStreamImp (const OutputStream &sinkStream, Transform transform) | |
RWTTransformOutputStreamImp (const OutputStream &sinkStream, Transform transform, RWSize bufSize) | |
RWTTransformOutputStreamImp (const OutputStream &sinkStream, Transform transform, element_type *buffer, RWSize bufSize) | |
element_type * | epptr () const |
void | freeBuffer () |
element_type * | pbase () const |
void | pbump (RWSize n) |
element_type * | pptr () const |
void | setBuffer (RWSize bufsize) |
void | setp (element_type *pbeg_arg, element_type *pend_arg) |
virtual void | transform () |
The class RWTTransformOutputStreamImp implements a buffered char
or byte
output stream that includes a transformation. The size of the buffer is specified as a parameter to the static make() function that is used to create it. If the buffer as initialized is not large enough to contain the entire XML document, it grows as needed to be able to do so. It is more efficient, though, to allocate a buffer of sufficient size initially.
RWTTransformOutputStreamImp is a class template that is derived from one of its own template parameters.
The class is defined as
The write() method of this class gets called until the entire output stream has been written to the buffer. Then the flush() method gets called, either directly or when the destructor is called. The flush() method calls the transform() method of the transformation object passed into the constructor. The transform() method reads the output stream flushed from the buffer, applies the transformation defined by the method, and writes the result to the sink stream.
typedef OutputStream::element_type RWTTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform >::element_type |
In keeping with the pattern for all filtered input streams, the type of character contained by the stream is referred to as the "element_type". Characters in the stream are called "elements" (not to be confused with XML "elements").
typedef OutputStream RWTTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform >::RWOutputStream_type |
A typedef for the template parameter OutputStream
which will be used as the sink for elements.
|
virtual |
Virtual destructor. Throws no exceptions.
|
protected |
Initializes the reference to the output stream used as the sink of elements, and the internal buffer, whose capacity is set to RW_STREAM_BUFFER_SIZE, defined as 512
bytes.
The parameter sinkStream represents the output stream that serves as the sink of elements.
The parameter transform represents the transformation object and must provide a public interface of:
|
protected |
Initializes the reference to the output stream used as the sink of elements, and the internal buffer capacity, which is set to bufSize.
The parameter sinkStream represents the output stream that serves as the sink of elements.
The parameter transform represents the transformation object and must provide a public interface of:
The parameter bufSize represents the buffer capacity in number of elements.
|
protected |
Initializes the reference to the output stream used as the sink of elements, and the internal buffer, which is initialized using a pre-allocated element's array of size bufSize.
The parameter sinkStream represents the output stream that serves as the sink of elements.
The parameter transform represents the transformation object and must provide a public interface of:
The parameter buffer represents a pre-allocated buffer of size bufSize to be used internally by the constructed RWTTransformOutputStreamImp object.
|
virtual |
|
inlineprotected |
Returns a pointer one position past the last element in the output sequence. Throws no exceptions.
|
virtual |
Flushes the buffer by forwarding its content to the next processing stream.
|
protected |
Frees the memory allocated to the internal buffer, if necessary.
|
inlinestatic |
Constructs an RWTTransformOutputStreamImp instance that uses sinkStream as its sink of elements, and returns a handle to it. The internal buffer is initialized to be of size RW_STREAM_BUFFER_SIZE, which is defined as 512
bytes. The buffer grows as needed to contain the entire XML document.
The parameter sinkStream represents the output stream that serves as the sink of elements.
The parameter transform represents the transformation object and must provide a public interface of:
|
inlinestatic |
Constructs an RWTTransformOutputStreamImp instance that uses sinkStream as its sink of elements, and returns a handle to it. The internal buffer is initialized to be of size bufSize. The buffer grows as needed to contain the entire XML document.
The parameter sinkStream represents the output stream that serves as the sink of elements.
The parameter transform represents the transformation object and must provide a public interface of:
The parameter bufSize represents the buffer capacity in number of elements.
|
inlinestatic |
Constructs an RWTTransformOutputStreamImp instance that uses sinkStream as its sink of elements, and returns a handle to it. The internal buffer is initialized using a pre-allocated element's array of size bufSize. The buffer grows as needed to contain the entire XML document.
The parameter sinkStream represents the output stream that serves as the sink of elements.
The parameter transform represents the transformation object and must provide a public interface of:
The parameter buffer represents a pre-allocated buffer of size bufSize to be used internally by the constructed RWTTransformOutputStreamImp object.
|
inlineprotected |
Returns a pointer to the first element in the output buffer array. Throws no exceptions.
|
inlineprotected |
Moves the output buffer array pointer n positions forward. The array position now pointed to is the one returned by pptr().
|
inlineprotected |
Returns a pointer to the current position in the buffered output sequence. Throws no exceptions.
|
protected |
Sets the buffer size to bufsize.
|
inlineprotected |
Assigns the first parameter value to pbeg_
and pnext_
, and the second parameter value to gend_
. These data members represent the beginning of the buffer array, the current position in the array, and the end of the array.
|
protectedvirtual |
Internal transform function, which gets called by flush() and which then calls the transform() function of the transform object passed in to the constructor.
|
virtual |
Writes a single element to the stream.
|
virtual |
Writes an element array of size numElements to the stream. The parameter array is a pointer to the first element in the array.
Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |