Inherits FilteredOutputStreamImp.
template<class OutputStream, class FilteredOutputStreamImp, class Transform>
class RWTTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, 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
template <class OutputStream, class FilteredOutputStreamImp,
class Transform>
}
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.
template<class OutputStream , class FilteredOutputStreamImp , class Transform >
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:
template<class OutputStream , class FilteredOutputStreamImp , class Transform >
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.
template<class OutputStream , class FilteredOutputStreamImp , class Transform >
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.
template<class OutputStream , class FilteredOutputStreamImp , class Transform >
static OutputStream RWTTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform >::make |
( |
const OutputStream & | sinkStream, |
|
|
Transform | transform ) |
|
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:
template<class OutputStream , class FilteredOutputStreamImp , class Transform >
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.
template<class OutputStream , class FilteredOutputStreamImp , class Transform >
static OutputStream RWTTransformOutputStreamImp< OutputStream, FilteredOutputStreamImp, Transform >::make |
( |
const OutputStream & | sinkStream, |
|
|
Transform | transform, |
|
|
RWSize | bufSize ) |
|
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.