OFFIS DCMTK  Version 3.6.0
dcistrmb.h
1 /*
2  *
3  * Copyright (C) 1994-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose: DcmInputBufferStream and related classes,
19  * implements input to blocks of memory as needed in the dcmnet module.
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:15:41 $
23  * CVS/RCS Revision: $Revision: 1.6 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DCISTRMB_H
31 #define DCISTRMB_H
32 
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/dcmdata/dcistrma.h"
35 
36 
41 {
42 public:
46 
48  virtual ~DcmBufferProducer();
49 
54  virtual OFBool good() const;
55 
60  virtual OFCondition status() const;
61 
65  virtual OFBool eos();
66 
74  virtual offile_off_t avail();
75 
81  virtual offile_off_t read(void *buf, offile_off_t buflen);
82 
87  virtual offile_off_t skip(offile_off_t skiplen);
88 
93  virtual void putback(offile_off_t num);
94 
100  virtual void setBuffer(const void *buf, offile_off_t buflen);
101 
108  virtual void releaseBuffer();
109 
113  virtual void setEos();
114 
115 private:
116 
119 
122 
124  unsigned char *buffer_;
125 
127  unsigned char *backup_;
128 
130  offile_off_t bufSize_;
131 
133  offile_off_t bufIndex_;
134 
136  offile_off_t backupIndex_;
137 
139  offile_off_t backupStart_;
140 
143 
145  OFBool eosflag_;
146 
147 };
148 
149 
154 {
155 public:
159 
161  virtual ~DcmInputBufferStream();
162 
172  virtual DcmInputStreamFactory *newFactory() const;
173 
179  virtual void setBuffer(const void *buf, offile_off_t buflen);
180 
187  virtual void releaseBuffer();
188 
192  virtual void setEos();
193 
194 private:
195 
198 
201 
204 
205 };
206 
207 
208 #endif
209 
210 /*
211  * CVS/RCS Log:
212  * $Log: dcistrmb.h,v $
213  * Revision 1.6 2010-10-14 13:15:41 joergr
214  * Updated copyright header. Added reference to COPYRIGHT file.
215  *
216  * Revision 1.5 2008-06-23 12:09:13 joergr
217  * Fixed inconsistencies in Doxygen API documentation.
218  *
219  * Revision 1.4 2007/02/19 15:45:41 meichel
220  * Class DcmInputStream and related classes are now safe for use with
221  * large files (2 GBytes or more) if supported by compiler and operating system.
222  *
223  * Revision 1.3 2005/12/08 16:28:16 meichel
224  * Changed include path schema for all DCMTK header files
225  *
226  * Revision 1.2 2003/06/12 13:34:36 joergr
227  * Fixed inconsistent API documentation reported by Doxygen.
228  *
229  * Revision 1.1 2002/08/27 16:55:33 meichel
230  * Initial release of new DICOM I/O stream classes that add support for stream
231  * compression (deflated little endian explicit VR transfer syntax)
232  *
233  *
234  */
virtual offile_off_t skip(offile_off_t skiplen)
skips over the given number of bytes (or less)
OFCondition status_
status
Definition: dcistrmb.h:142
virtual void setEos()
marks the end of stream, i.e.
input stream that reads from a buffer of fixed length which must be provided by the caller...
Definition: dcistrmb.h:153
DcmInputBufferStream()
constructor
DcmBufferProducer producer_
the final producer of the filter chain
Definition: dcistrmb.h:203
DcmBufferProducer & operator=(const DcmBufferProducer &)
private unimplemented copy assignment operator
virtual DcmInputStreamFactory * newFactory() const
creates a new factory object for the current stream and stream position.
offile_off_t bufSize_
size of the user buffer, in bytes
Definition: dcistrmb.h:130
unsigned char * buffer_
the user buffer we're actually reading from
Definition: dcistrmb.h:124
unsigned char * backup_
the backup buffer
Definition: dcistrmb.h:127
virtual void putback(offile_off_t num)
resets the stream to the position by the given number of bytes.
virtual offile_off_t avail()
returns the minimum number of bytes that can be read with the next call to read().
virtual void setBuffer(const void *buf, offile_off_t buflen)
adds the content of the given buffer to the input stream.
virtual void releaseBuffer()
releases the current buffer.
DcmBufferProducer()
constructor
producer class that reads data from a buffer provided by the caller.
Definition: dcistrmb.h:40
virtual ~DcmBufferProducer()
destructor
virtual ~DcmInputBufferStream()
destructor
offile_off_t backupStart_
index of first valid byte in backup buffer, for putback
Definition: dcistrmb.h:139
virtual OFBool eos()
returns true if the producer is at the end of stream.
virtual void releaseBuffer()
releases the current buffer.
virtual void setBuffer(const void *buf, offile_off_t buflen)
adds the content of the given buffer to the input stream.
virtual OFCondition status() const
returns the status of the producer as an OFCondition object.
OFBool eosflag_
true if setEos has been called before
Definition: dcistrmb.h:145
pure virtual abstract base class for input stream factories, i.e.
Definition: dcistrma.h:125
virtual OFBool good() const
returns the status of the producer.
offile_off_t backupIndex_
number of bytes read from the backup buffer
Definition: dcistrmb.h:136
abstract base class for input streams.
Definition: dcistrma.h:147
pure virtual abstract base class for producers, i.e.
Definition: dcistrma.h:43
DcmInputBufferStream & operator=(const DcmInputBufferStream &)
private unimplemented copy assignment operator
virtual void setEos()
marks the end of stream, i.e.
offile_off_t bufIndex_
number of bytes read from the user buffer
Definition: dcistrmb.h:133
virtual offile_off_t read(void *buf, offile_off_t buflen)
reads as many bytes as possible into the given block.
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Sun Aug 23 2015 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.9.1