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