OFFIS DCMTK  Version 3.6.0
dcistrmf.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: DcmInputFileStream and related classes,
19  * implements streamed input from files.
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:15:41 $
23  * CVS/RCS Revision: $Revision: 1.9 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DCISTRMF_H
31 #define DCISTRMF_H
32 
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/dcmdata/dcistrma.h"
35 
36 
40 {
41 public:
46  DcmFileProducer(const char *filename, offile_off_t offset = 0);
47 
49  virtual ~DcmFileProducer();
50 
55  virtual OFBool good() const;
56 
61  virtual OFCondition status() const;
62 
66  virtual OFBool eos();
67 
75  virtual offile_off_t avail();
76 
82  virtual offile_off_t read(void *buf, offile_off_t buflen);
83 
88  virtual offile_off_t skip(offile_off_t skiplen);
89 
94  virtual void putback(offile_off_t num);
95 
96 private:
97 
100 
103 
106 
109 
111  offile_off_t size_;
112 };
113 
114 
118 {
119 public:
120 
125  DcmInputFileStreamFactory(const char *filename, offile_off_t offset);
126 
129 
131  virtual ~DcmInputFileStreamFactory();
132 
136  virtual DcmInputStream *create() const;
137 
140  virtual DcmInputStreamFactory *clone() const
141  {
142  return new DcmInputFileStreamFactory(*this);
143  }
144 
145 private:
146 
147 
150 
153 
155  offile_off_t offset_;
156 
157 };
158 
159 
163 {
164 public:
169  DcmInputFileStream(const char *filename, offile_off_t offset = 0);
170 
172  virtual ~DcmInputFileStream();
173 
183  virtual DcmInputStreamFactory *newFactory() const;
184 
185 private:
186 
189 
192 
195 
198 };
199 
206 {
207 public:
208 
215  static DcmTempFileHandler *newInstance(const char *fname);
216 
222  DcmInputStream *create() const;
223 
225  void increaseRefCount();
226 
230  void decreaseRefCount();
231 
232 private:
233 
238  DcmTempFileHandler(const char *fname);
239 
243  virtual ~DcmTempFileHandler();
244 
247 
250 
254  size_t refCount_;
255 
256 #ifdef WITH_THREADS
257 
258  OFMutex mutex_;
259 #endif
260 
263 
264 };
265 
269 {
270 public:
271 
277 
280 
283 
287  virtual DcmInputStream *create() const;
288 
291  virtual DcmInputStreamFactory *clone() const;
292 
293 private:
294 
297 
300 
301 };
302 
303 
304 #endif
305 
306 /*
307  * CVS/RCS Log:
308  * $Log: dcistrmf.h,v $
309  * Revision 1.9 2010-10-14 13:15:41 joergr
310  * Updated copyright header. Added reference to COPYRIGHT file.
311  *
312  * Revision 1.8 2010-10-04 14:44:39 joergr
313  * Replaced "#ifdef _REENTRANT" by "#ifdef WITH_THREADS" where appropriate (i.e.
314  * in all cases where OFMutex, OFReadWriteLock, etc. are used).
315  *
316  * Revision 1.7 2010-03-01 09:08:44 uli
317  * Removed some unnecessary include directives in the headers.
318  *
319  * Revision 1.6 2009-11-04 09:58:07 uli
320  * Switched to logging mechanism provided by the "new" oflog module
321  *
322  * Revision 1.5 2008-05-29 10:39:43 meichel
323  * Implemented new classes DcmTempFileHandler and DcmInputTempFileStreamFactory
324  * that perform thread-safe reference counted life cycle management of a
325  * temporary file and are needed for DcmElement temporary file extensions to come.
326  *
327  * Revision 1.4 2007/02/19 15:45:41 meichel
328  * Class DcmInputStream and related classes are now safe for use with
329  * large files (2 GBytes or more) if supported by compiler and operating system.
330  *
331  * Revision 1.3 2005/12/08 16:28:17 meichel
332  * Changed include path schema for all DCMTK header files
333  *
334  * Revision 1.2 2002/11/27 12:07:21 meichel
335  * Adapted module dcmdata to use of new header file ofstdinc.h
336  *
337  * Revision 1.1 2002/08/27 16:55:33 meichel
338  * Initial release of new DICOM I/O stream classes that add support for stream
339  * compression (deflated little endian explicit VR transfer syntax)
340  *
341  *
342  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2