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 #ifndef __ZStream_PageBuffered__
00026 #define __ZStream_PageBuffered__ 1
00027 #include "zconfig.h"
00028
00029 #include "ZStreamer.h"
00030
00031
00032 #pragma mark -
00033 #pragma mark * ZStreamRPos_PageBuffered
00034
00039 class ZStreamRPos_PageBuffered : public ZStreamRPos
00040 {
00041 public:
00042 ZStreamRPos_PageBuffered(
00043 size_t iBufferCount, size_t iBufferSize, const ZStreamRPos& iStreamReal);
00044
00045 ~ZStreamRPos_PageBuffered();
00046
00047
00048 virtual void Imp_Read(void* iDest, size_t iCount, size_t* oCountRead);
00049 virtual size_t Imp_CountReadable();
00050 virtual void Imp_Skip(uint64 iCount, uint64* oCountSkipped);
00051
00052
00053 virtual uint64 Imp_GetPosition();
00054 virtual void Imp_SetPosition(uint64 iPosition);
00055
00056 virtual uint64 Imp_GetSize();
00057
00058 protected:
00059 void Internal_Init(size_t iBufferCount, size_t iBufferSize);
00060
00061 const ZStreamRPos& fStreamReal;
00062 struct Buffer;
00063
00064 Buffer* fBuffer_Head;
00065 Buffer* fBuffer_Tail;
00066 size_t fBufferSize;
00067
00068 uint64 fPosition;
00069 };
00070
00071
00072 #pragma mark -
00073 #pragma mark * ZStreamerRPos_PageBuffered
00074
00076
00077 class ZStreamerRPos_PageBuffered : public ZStreamerRPos
00078 {
00079 public:
00080 ZStreamerRPos_PageBuffered(
00081 size_t iBufferCount, size_t iBufferSize, ZRef<ZStreamerRPos> iStreamerSource);
00082
00083 virtual ~ZStreamerRPos_PageBuffered();
00084
00085
00086 virtual const ZStreamRPos& GetStreamRPos();
00087
00088 protected:
00089 ZRef<ZStreamerRPos> fStreamerSource;
00090 ZStreamRPos_PageBuffered fStream;
00091 };
00092
00093
00094 #pragma mark -
00095 #pragma mark * ZStreamRWPos_PageBuffered
00096
00101 class ZStreamRWPos_PageBuffered : public ZStreamRWPos
00102 {
00103 public:
00104 ZStreamRWPos_PageBuffered(
00105 size_t iBufferCount, size_t iBufferSize, const ZStreamRWPos& iStreamReal);
00106
00107 ~ZStreamRWPos_PageBuffered();
00108
00109
00110 virtual void Imp_Read(void* iDest, size_t iCount, size_t* oCountRead);
00111
00112
00113 virtual void Imp_Write(const void* iSource, size_t iCount, size_t* oCountWritten);
00114 virtual void Imp_Flush();
00115
00116
00117 virtual uint64 Imp_GetPosition();
00118 virtual void Imp_SetPosition(uint64 iPosition);
00119
00120 virtual uint64 Imp_GetSize();
00121
00122
00123 virtual void Imp_SetSize(uint64 iSize);
00124
00125 protected:
00126 void Internal_Init(size_t iBufferCount, size_t iBufferSize);
00127
00128 const ZStreamRWPos& fStreamReal;
00129 struct Buffer;
00130
00131 Buffer* fBuffer_Head;
00132 Buffer* fBuffer_Tail;
00133 size_t fBufferSize;
00134
00135 uint64 fPosition;
00136 };
00137
00138
00139 #pragma mark -
00140 #pragma mark * ZStreamerRWPos_PageBuffered
00141
00143
00144 class ZStreamerRWPos_PageBuffered : public ZStreamerRWPos
00145 {
00146 public:
00147 ZStreamerRWPos_PageBuffered(
00148 size_t iBufferCount, size_t iBufferSize, ZRef<ZStreamerRWPos> iStreamerReal);
00149
00150 virtual ~ZStreamerRWPos_PageBuffered();
00151
00152
00153 virtual const ZStreamRWPos& GetStreamRWPos();
00154
00155 protected:
00156 ZRef<ZStreamerRWPos> fStreamerReal;
00157 ZStreamRWPos_PageBuffered fStream;
00158 };
00159
00160 #endif // __ZStream_PageBuffered__