00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_ABSTRACT_OCTET_ARRAY_READ_BUFFER_HPP
00017 #define COH_ABSTRACT_OCTET_ARRAY_READ_BUFFER_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/io/AbstractReadBuffer.hpp"
00022
00023
00024
00025 COH_OPEN_NAMESPACE2(coherence,util)
00026
00027 class Binary;
00028
00029 COH_CLOSE_NAMESPACE2
00030
00031 COH_OPEN_NAMESPACE2(coherence,io)
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class COH_EXPORT AbstractOctetArrayReadBuffer
00050 : public abstract_spec<AbstractOctetArrayReadBuffer,
00051 extends<AbstractReadBuffer> >
00052 {
00053
00054
00055 public:
00056
00057
00058
00059 static const size32_t npos = size32_t(-1);
00060
00061
00062
00063
00064 public:
00065 typedef this_spec::Handle Handle;
00066 typedef this_spec::View View;
00067 typedef this_spec::Holder Holder;
00068
00069
00070
00071
00072 typedef TypedHandle<const coherence::util::Binary> BinaryView;
00073
00074
00075
00076
00077 protected:
00078
00079
00080
00081
00082
00083
00084
00085 AbstractOctetArrayReadBuffer();
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 AbstractOctetArrayReadBuffer(Array<octet_t>::View vab, size32_t of = 0,
00102 size32_t cb = npos);
00103
00104
00105
00106
00107 public:
00108
00109
00110
00111 virtual size32_t length() const;
00112
00113
00114
00115
00116 virtual octet_t read(size32_t of) const;
00117
00118
00119
00120
00121 virtual void read(size32_t ofBegin, size32_t ofEnd,
00122 Array<octet_t>::Handle habDest, size32_t ofDest) const;
00123
00124
00125
00126
00127 virtual BinaryView toBinary() const;
00128
00129
00130
00131
00132 virtual BinaryView toBinary(size32_t of, size32_t cb) const;
00133
00134
00135
00136
00137 virtual Array<octet_t>::View toOctetArray(size32_t of, size32_t cb) const;
00138
00139
00140
00141
00142 using AbstractReadBuffer::toOctetArray;
00143
00144
00145
00146
00147 public:
00148
00149
00150
00151 virtual bool equals(Object::View v) const;
00152
00153
00154
00155
00156 protected:
00157
00158
00159
00160 virtual BufferInput::Handle instantiateBufferInput() const;
00161
00162
00163
00164
00165 protected:
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175 virtual void resetRange(size32_t of, size32_t cb);
00176
00177
00178
00179
00180 public:
00181
00182
00183
00184
00185
00186
00187
00188 class COH_EXPORT OctetArrayBufferInput
00189 : public class_spec<OctetArrayBufferInput,
00190 extends<AbstractBufferInput> >
00191 {
00192 friend class factory<OctetArrayBufferInput>;
00193
00194
00195
00196 protected:
00197
00198
00199
00200
00201
00202
00203 OctetArrayBufferInput(AbstractOctetArrayReadBuffer::View vBuf);
00204
00205
00206
00207 public:
00208
00209
00210
00211 using AbstractBufferInput::read;
00212
00213
00214
00215
00216 virtual octet_t read();
00217
00218
00219
00220
00221 virtual void read(Array<octet_t>::Handle hab, size32_t of,
00222 size32_t cb);
00223
00224
00225
00226
00227 virtual char16_t readChar16();
00228
00229
00230
00231
00232 virtual int16_t readInt16();
00233
00234
00235
00236
00237 virtual int32_t readInt32();
00238
00239
00240
00241
00242 virtual int64_t readInt64();
00243
00244
00245
00246
00247 virtual float32_t readFloat32();
00248
00249
00250
00251
00252 virtual float64_t readFloat64();
00253
00254
00255
00256 protected:
00257
00258
00259
00260 virtual String::View convertUTF(size32_t of, size32_t cb) const;
00261
00262
00263
00264 protected:
00265
00266
00267
00268 FinalView<AbstractOctetArrayReadBuffer> f_vBuf;
00269
00270
00271
00272
00273
00274 FinalView<Array<octet_t> > f_vab;
00275 };
00276
00277
00278
00279
00280 protected:
00281
00282
00283
00284
00285 FinalView<Array<octet_t> > f_vab;
00286
00287
00288
00289
00290
00291 size32_t m_of;
00292
00293
00294
00295
00296
00297
00298 size32_t m_cb;
00299 };
00300
00301 COH_CLOSE_NAMESPACE2
00302
00303 #endif // COH_ABSTRACT_OCTET_ARRAY_READ_BUFFER_HPP