00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DCWCACHE_H
00031 #define DCWCACHE_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034
00035 #include "dcmtk/ofstd/oftypes.h"
00036 #include "dcmtk/dcmdata/dcfcache.h"
00037
00038 class DcmElement;
00039 class DcmOutputStream;
00040
00041 #define DcmWriteCacheBufsize 65536
00042
00050 class DcmWriteCache
00051 {
00052 public:
00053
00055 DcmWriteCache()
00056 : fcache_()
00057 , buf_(NULL)
00058 , owner_(NULL)
00059 , offset_(0)
00060 , numBytes_(0)
00061 , capacity_(0)
00062 , fieldLength_(0)
00063 , fieldOffset_(0)
00064 , byteOrder_(EBO_unknown)
00065 {
00066 }
00067
00069 ~DcmWriteCache()
00070 {
00071 delete[] buf_;
00072 }
00073
00080 void init(void *owner, Uint32 fieldLength, Uint32 bytesTransferred, E_ByteOrder byteOrder);
00081
00085 OFBool bufferIsEmpty() const { return (numBytes_ == 0); }
00086
00090 Uint32 contentLength() const { return numBytes_; }
00091
00099 OFCondition fillBuffer(DcmElement& elem);
00100
00105 Uint32 writeBuffer(DcmOutputStream &outStream);
00106
00107 private:
00108
00110 DcmWriteCache(const DcmWriteCache& arg);
00111
00113 DcmWriteCache& operator=(const DcmWriteCache& arg);
00114
00116 DcmFileCache fcache_;
00117
00119 Uint8 *buf_;
00120
00122 void *owner_;
00123
00125 Uint32 offset_;
00126
00128 Uint32 numBytes_;
00129
00131 Uint32 capacity_;
00132
00134 Uint32 fieldLength_;
00135
00137 Uint32 fieldOffset_;
00138
00140 E_ByteOrder byteOrder_;
00141 };
00142
00143 #endif
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164