DCMTK Version 3.6.8
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DcmStdoutConsumer Class Reference

consumer class that writes to standard output. More...

+ Inheritance diagram for DcmStdoutConsumer:

Public Member Functions

 DcmStdoutConsumer (const OFFilename &filename)
 constructor More...
 
 DcmStdoutConsumer (FILE *file)
 constructor More...
 
virtual ~DcmStdoutConsumer ()
 destructor
 
virtual OFBool good () const
 returns the status of the consumer. More...
 
virtual OFCondition status () const
 returns the status of the consumer as an OFCondition object. More...
 
virtual OFBool isFlushed () const
 returns true if the consumer is flushed, i.e. More...
 
virtual offile_off_t avail () const
 returns the minimum number of bytes that can be written with the next call to write(). More...
 
virtual offile_off_t write (const void *buf, offile_off_t buflen)
 processes as many bytes as possible from the given input block. More...
 
virtual void flush ()
 instructs the consumer to flush its internal content until either the consumer becomes "flushed" or I/O suspension occurs. More...
 
- Public Member Functions inherited from DcmConsumer
virtual ~DcmConsumer ()
 destructor
 
virtual OFBool good () const =0
 returns the status of the consumer. More...
 
virtual OFCondition status () const =0
 returns the status of the consumer as an OFCondition object. More...
 
virtual OFBool isFlushed () const =0
 returns true if the consumer is flushed, i.e. More...
 
virtual offile_off_t avail () const =0
 returns the minimum number of bytes that can be written with the next call to write(). More...
 
virtual offile_off_t write (const void *buf, offile_off_t buflen)=0
 processes as many bytes as possible from the given input block. More...
 
virtual void flush ()=0
 instructs the consumer to flush its internal content until either the consumer becomes "flushed" or I/O suspension occurs. More...
 

Private Member Functions

 DcmStdoutConsumer (const DcmStdoutConsumer &)
 private unimplemented copy constructor
 
DcmStdoutConsumeroperator= (const DcmStdoutConsumer &)
 private unimplemented copy assignment operator
 

Private Attributes

OFFile file_
 the file we're actually writing to
 
OFCondition status_
 status
 

Detailed Description

consumer class that writes to standard output.

Constructor & Destructor Documentation

◆ DcmStdoutConsumer() [1/2]

DcmStdoutConsumer::DcmStdoutConsumer ( const OFFilename filename)

constructor

Parameters
filenamename of file to be created (may contain wide chars if support enabled)

◆ DcmStdoutConsumer() [2/2]

DcmStdoutConsumer::DcmStdoutConsumer ( FILE *  file)

constructor

Parameters
filestructure, file must already be open for writing

Member Function Documentation

◆ avail()

virtual offile_off_t DcmStdoutConsumer::avail ( ) const
virtual

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

The DcmObject write 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 written "en bloc", i.e. all or nothing.

Returns
minimum of space available in consumer

Implements DcmConsumer.

◆ flush()

virtual void DcmStdoutConsumer::flush ( )
virtual

instructs the consumer to flush its internal content until either the consumer becomes "flushed" or I/O suspension occurs.

After a call to flush(), a call to write() will produce undefined behaviour.

Implements DcmConsumer.

◆ good()

virtual OFBool DcmStdoutConsumer::good ( ) const
virtual

returns the status of the consumer.

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

Returns
status, true if good

Implements DcmConsumer.

◆ isFlushed()

virtual OFBool DcmStdoutConsumer::isFlushed ( ) const
virtual

returns true if the consumer is flushed, i.e.

has no more data pending in it's internal state that needs to be flushed before the stream is closed.

Returns
true if consumer is flushed, false otherwise

Implements DcmConsumer.

◆ status()

virtual OFCondition DcmStdoutConsumer::status ( ) const
virtual

returns the status of the consumer as an OFCondition object.

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

Returns
status, EC_Normal if good

Implements DcmConsumer.

◆ write()

virtual offile_off_t DcmStdoutConsumer::write ( const void *  buf,
offile_off_t  buflen 
)
virtual

processes as many bytes as possible from the given input block.

Parameters
bufpointer to memory block, must not be NULL
buflenlength of memory block
Returns
number of bytes actually processed.

Implements DcmConsumer.


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


Generated on Tue Dec 19 2023 for DCMTK Version 3.6.8 by Doxygen 1.9.4