dcistrmb.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2005, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module:  dcmdata
00019  *
00020  *  Author:  Marco Eichelberg
00021  *
00022  *  Purpose: DcmInputBufferStream and related classes,
00023  *    implements input to blocks of memory as needed in the dcmnet module.
00024  *
00025  *  Last Update:      $Author: meichel $
00026  *  Update Date:      $Date: 2005/12/08 16:28:16 $
00027  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcmtk/dcmdata/dcistrmb.h,v $
00028  *  CVS/RCS Revision: $Revision: 1.3 $
00029  *  Status:           $State: Exp $
00030  *
00031  *  CVS/RCS Log at end of file
00032  *
00033  */
00034 
00035 #ifndef DCISTRMB_H
00036 #define DCISTRMB_H
00037 
00038 #include "dcmtk/config/osconfig.h"
00039 #include "dcmtk/dcmdata/dcistrma.h"
00040 
00041 
00045 class DcmBufferProducer: public DcmProducer
00046 {
00047 public:
00050   DcmBufferProducer();
00051 
00053   virtual ~DcmBufferProducer();
00054 
00059   virtual OFBool good() const;
00060 
00065   virtual OFCondition status() const;
00066 
00070   virtual OFBool eos() const;
00071 
00079   virtual Uint32 avail() const;
00080 
00086   virtual Uint32 read(void *buf, Uint32 buflen);
00087 
00092   virtual Uint32 skip(Uint32 skiplen);
00093 
00098   virtual void putback(Uint32 num);
00099 
00105   virtual void setBuffer(const void *buf, Uint32 buflen);
00106 
00113   virtual void releaseBuffer();
00114 
00118   virtual void setEos();
00119 
00120 private:
00121 
00123   DcmBufferProducer(const DcmBufferProducer&);
00124 
00126   DcmBufferProducer& operator=(const DcmBufferProducer&);
00127 
00129   unsigned char *buffer_;
00130 
00132   unsigned char *backup_;
00133 
00135   Uint32 bufSize_;
00136 
00138   Uint32 bufIndex_;
00139 
00141   Uint32 backupIndex_;
00142 
00144   Uint32 backupStart_;
00145 
00147   OFCondition status_;
00148 
00150   OFBool eosflag_;
00151 
00152 };
00153 
00154 
00158 class DcmInputBufferStream: public DcmInputStream
00159 {
00160 public:
00166   DcmInputBufferStream();
00167 
00169   virtual ~DcmInputBufferStream();
00170 
00180   virtual DcmInputStreamFactory *newFactory() const;
00181 
00187   virtual void setBuffer(const void *buf, Uint32 buflen);
00188 
00195   virtual void releaseBuffer();
00196 
00200   virtual void setEos();
00201 
00202 private:
00203 
00205   DcmInputBufferStream(const DcmInputBufferStream&);
00206 
00208   DcmInputBufferStream& operator=(const DcmInputBufferStream&);
00209 
00211   DcmBufferProducer producer_;
00212 
00213 };
00214 
00215 
00216 #endif
00217 
00218 /*
00219  * CVS/RCS Log:
00220  * $Log: dcistrmb.h,v $
00221  * Revision 1.3  2005/12/08 16:28:16  meichel
00222  * Changed include path schema for all DCMTK header files
00223  *
00224  * Revision 1.2  2003/06/12 13:34:36  joergr
00225  * Fixed inconsistent API documentation reported by Doxygen.
00226  *
00227  * Revision 1.1  2002/08/27 16:55:33  meichel
00228  * Initial release of new DICOM I/O stream classes that add support for stream
00229  *   compression (deflated little endian explicit VR transfer syntax)
00230  *
00231  *
00232  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5