DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DcmInputStream Class Reference

abstract base class for input streams. More...

+ Inheritance diagram for DcmInputStream:

List of all members.

Public Member Functions

virtual ~DcmInputStream ()
 destructor
virtual OFBool good () const
 returns the status of the stream.
virtual OFCondition status () const
 returns the status of the stream as an OFCondition object.
virtual OFBool eos ()
 returns true if the producer is at the end of stream.
virtual offile_off_t avail ()
 returns the minimum number of bytes that can be read with the next call to read().
virtual offile_off_t read (void *buf, offile_off_t buflen)
 reads as many bytes as possible into the given block.
virtual offile_off_t skip (offile_off_t skiplen)
 skips over the given number of bytes (or less)
virtual offile_off_t tell () const
 returns the total number of bytes read from the stream so far
virtual OFCondition installCompressionFilter (E_StreamCompression filterType)
 installs a compression filter for the given stream compression type, which should be neither ESC_none nor ESC_unsupported.
virtual DcmInputStreamFactorynewFactory () const =0
 creates a new factory object for the current stream and stream position.
virtual void mark ()
 marks the current stream position for a later putback operation, overwriting a possibly existing prior putback mark.
virtual void putback ()
 resets the stream to the position previously marked with setPutbackMark().

Protected Member Functions

 DcmInputStream (DcmProducer *initial)
 protected constructor, to be called from derived class constructor
const DcmProducercurrentProducer () const
 returns pointer to current producer object

Private Member Functions

 DcmInputStream (const DcmInputStream &)
 private unimplemented copy constructor
DcmInputStreamoperator= (const DcmInputStream &)
 private unimplemented copy assignment operator

Private Attributes

DcmProducercurrent_
 pointer to first node in filter chain
DcmInputFiltercompressionFilter_
 pointer to compression filter, NULL if no compression
offile_off_t tell_
 counter for number of bytes read so far
offile_off_t mark_
 putback marker

Detailed Description

abstract base class for input streams.


Constructor & Destructor Documentation

DcmInputStream::DcmInputStream ( DcmProducer initial) [protected]

protected constructor, to be called from derived class constructor

Parameters:
initialinitial pointer to first node in filter chain The pointer is not dereferenced in the constructor, so the object pointed to may be initialized later in the subclass constructor.

Member Function Documentation

virtual offile_off_t DcmInputStream::avail ( ) [virtual]

returns the minimum number of bytes that can be read with the next call to read().

The DcmObject read methods rely on avail to return a value > 0 if there is no I/O suspension since certain data such as tag and length are only read "en bloc", i.e. all or nothing.

Returns:
minimum of data available in producer
virtual OFBool DcmInputStream::eos ( ) [virtual]

returns true if the producer is at the end of stream.

Returns:
true if end of stream, false otherwise
virtual OFBool DcmInputStream::good ( ) const [virtual]

returns the status of the stream.

Unless the status is good, the stream will not permit any operation.

Returns:
status, true if good
virtual OFCondition DcmInputStream::installCompressionFilter ( E_StreamCompression  filterType) [virtual]

installs a compression filter for the given stream compression type, which should be neither ESC_none nor ESC_unsupported.

Once a compression filter is active, it cannot be deactivated or replaced during the lifetime of the stream.

Parameters:
filterTypetype of compression filter
Returns:
EC_Normal if successful, an error code otherwise
virtual void DcmInputStream::mark ( ) [virtual]

marks the current stream position for a later putback operation, overwriting a possibly existing prior putback mark.

The DcmObject read methods rely on the possibility to putback up to 132 bytes for transfer syntax detection, parse error recovery etc. Implementations of this class should guarantee a putback capability of at least 1 kbyte.

virtual DcmInputStreamFactory* DcmInputStream::newFactory ( ) const [pure virtual]

creates a new factory object for the current stream and stream position.

When activated, the factory will be able to create new DcmInputStream delivering the same data as the current stream. Used to defer loading of value fields until accessed. If no factory object can be created (e.g. because the stream is not seekable), returns NULL.

Returns:
pointer to new factory object if successful, NULL otherwise.

Implemented in DcmInputFileStream, and DcmInputBufferStream.

virtual void DcmInputStream::putback ( ) [virtual]

resets the stream to the position previously marked with setPutbackMark().

If the putback operation fails (no putback mark set or putback buffer exceeded), status of the producer switches to bad.

virtual offile_off_t DcmInputStream::read ( void *  buf,
offile_off_t  buflen 
) [virtual]

reads as many bytes as possible into the given block.

Parameters:
bufpointer to memory block, must not be NULL
buflenlength of memory block
Returns:
number of bytes actually read.
virtual offile_off_t DcmInputStream::skip ( offile_off_t  skiplen) [virtual]

skips over the given number of bytes (or less)

Parameters:
skiplennumber of bytes to skip
Returns:
number of bytes actually skipped.
virtual OFCondition DcmInputStream::status ( ) const [virtual]

returns the status of the stream as an OFCondition object.

Unless the status is good, the stream will not permit any operation.

Returns:
status, EC_Normal if good
virtual offile_off_t DcmInputStream::tell ( ) const [virtual]

returns the total number of bytes read from the stream so far

Returns:
total number of bytes read from the stream

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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027