00001
00002
00003
00004
00005
00006
00007 #ifndef COH_POF_BUFFER_READER_HPP
00008 #define COH_POF_BUFFER_READER_HPP
00009
00010 #include "coherence/lang.ns"
00011
00012 #include "coherence/io/ReadBuffer.hpp"
00013 #include "coherence/io/pof/PofContext.hpp"
00014 #include "coherence/io/pof/PofHelper.hpp"
00015 #include "coherence/io/pof/PofReader.hpp"
00016 #include "coherence/io/pof/RawDate.hpp"
00017 #include "coherence/io/pof/RawDateTime.hpp"
00018 #include "coherence/io/pof/RawDayTimeInterval.hpp"
00019 #include "coherence/io/pof/RawTime.hpp"
00020 #include "coherence/io/pof/RawTimeInterval.hpp"
00021 #include "coherence/io/pof/RawYearMonthInterval.hpp"
00022 #include "coherence/util/Binary.hpp"
00023 #include "coherence/util/Collection.hpp"
00024 #include "coherence/util/LongArray.hpp"
00025 #include "coherence/util/Map.hpp"
00026
00027 COH_OPEN_NAMESPACE3(coherence,io,pof)
00028
00029 using coherence::io::ReadBuffer;
00030 using coherence::util::Binary;
00031 using coherence::util::Collection;
00032 using coherence::util::LongArray;
00033 using coherence::util::Map;
00034
00035
00036
00037
00038
00039
00040
00041
00042 class COH_EXPORT PofBufferReader
00043 : public class_spec<PofBufferReader,
00044 extends<PofHelper>,
00045 implements<PofReader> >
00046 {
00047 friend class factory<PofBufferReader>;
00048 friend class IdentityHolder;
00049
00050
00051
00052 protected:
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 PofBufferReader(ReadBuffer::BufferInput::Handle hIn,
00063 PofContext::View vCtx);
00064
00065
00066
00067
00068 public:
00069
00070
00071
00072 virtual bool readBoolean(int32_t iProp);
00073
00074
00075
00076
00077 virtual octet_t readOctet(int32_t iProp);
00078
00079
00080
00081
00082 virtual wchar16_t readChar16(int32_t iProp);
00083
00084
00085
00086
00087 virtual int16_t readInt16(int32_t iProp);
00088
00089
00090
00091
00092 virtual int32_t readInt32(int32_t iProp);
00093
00094
00095
00096
00097 virtual int64_t readInt64(int32_t iProp);
00098
00099
00100
00101
00102 virtual float32_t readFloat32(int32_t iProp);
00103
00104
00105
00106
00107 virtual float64_t readFloat64(int32_t iProp);
00108
00109
00110
00111
00112 virtual Array<bool>::Handle readBooleanArray(int32_t iProp);
00113
00114
00115
00116
00117 virtual Array<octet_t>::Handle readOctetArray(int32_t iProp);
00118
00119
00120
00121
00122 virtual Array<wchar16_t>::Handle readChar16Array(int32_t iProp);
00123
00124
00125
00126
00127 virtual Array<int16_t>::Handle readInt16Array(int32_t iProp);
00128
00129
00130
00131
00132 virtual Array<int32_t>::Handle readInt32Array(int32_t iProp);
00133
00134
00135
00136
00137 virtual Array<int64_t>::Handle readInt64Array(int32_t iProp);
00138
00139
00140
00141
00142 virtual Array<float32_t>::Handle readFloat32Array(int32_t iProp);
00143
00144
00145
00146
00147 virtual Array<float64_t>::Handle readFloat64Array(int32_t iProp);
00148
00149
00150
00151
00152 virtual Binary::View readBinary(int32_t iProp);
00153
00154
00155
00156
00157 virtual String::View readString(int32_t iProp);
00158
00159
00160
00161
00162 virtual RawDate::View readRawDate(int32_t iProp);
00163
00164
00165
00166
00167 using PofHelper::readRawDate;
00168
00169
00170
00171
00172 virtual RawTime::View readRawTime(int32_t iProp);
00173
00174
00175
00176
00177 using PofHelper::readRawTime;
00178
00179
00180
00181
00182 virtual RawDateTime::View readRawDateTime(int32_t iProp);
00183
00184
00185
00186
00187 virtual RawYearMonthInterval::View readRawYearMonthInterval(
00188 int32_t iProp);
00189
00190
00191
00192
00193 virtual RawTimeInterval::View readRawTimeInterval(int32_t iProp);
00194
00195
00196
00197
00198 virtual RawDayTimeInterval::View readRawDayTimeInterval(int32_t iProp);
00199
00200
00201
00202
00203 virtual Object::Holder readObject(int32_t iProp);
00204
00205
00206
00207
00208 virtual ObjectArray::Handle readObjectArray(int32_t iProp,
00209 ObjectArray::Handle ha = NULL);
00210
00211
00212
00213
00214 virtual LongArray::View readLongArray(int32_t iProp,
00215 LongArray::Handle hla = NULL);
00216
00217
00218
00219
00220 virtual Collection::View readCollection(int32_t iProp,
00221 Collection::Handle hCol = NULL);
00222
00223
00224
00225
00226 virtual Map::View readMap(int32_t iProp, Map::Handle hMap = NULL);
00227
00228
00229
00230
00231 virtual PofContext::View getPofContext() const;
00232
00233
00234
00235
00236 virtual void setPofContext(PofContext::View vCtx);
00237
00238
00239
00240
00241 virtual int32_t getUserTypeId() const;
00242
00243
00244
00245
00246 virtual int32_t getVersionId() const;
00247
00248
00249
00250
00251 virtual void registerIdentity(Object::Holder oh);
00252
00253
00254
00255
00256 virtual PofReader::Handle createNestedPofReader(int32_t iProp);
00257
00258
00259
00260
00261 virtual Binary::View readRemainder();
00262
00263
00264
00265
00266 protected:
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281 virtual bool advanceTo(int32_t iProp);
00282
00283
00284
00285
00286
00287
00288
00289
00290 virtual void complete(int32_t iProp);
00291
00292
00293
00294
00295
00296
00297
00298
00299 virtual PofBufferReader::Handle getParentParser();
00300
00301
00302
00303
00304
00305
00306
00307
00308 virtual PofBufferReader::View getParentParser() const;
00309
00310
00311
00312
00313
00314
00315
00316 virtual LongArray::Handle ensureReferenceRegistry();
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327 virtual void registerIdentity(int32_t nId, Object::Holder ohValue);
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339 virtual Object::Holder lookupIdentity(int32_t nId);
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350 virtual Object::Holder readAsObject(int32_t nType);
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 virtual Object::Holder readAsUniformObject(int32_t nType);
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377 virtual ObjectArray::Handle readAsObjectArray(int32_t nType,
00378 ObjectArray::Handle ha = NULL);
00379
00380
00381
00382
00383 protected:
00384
00385
00386
00387 FinalHandle<ReadBuffer::BufferInput> f_hIn;
00388
00389
00390
00391
00392 FinalView<PofContext> f_vCtx;
00393
00394
00395
00396
00397 FinalHandle<LongArray> f_hlaRefs;
00398 };
00399
00400 COH_CLOSE_NAMESPACE3
00401
00402 #endif // COH_POF_BUFFER_READER_HPP