00001
00002
00003
00004
00005
00006
00007 #ifndef COH_NULL_IMPLEMENTATION_HPP
00008 #define COH_NULL_IMPLEMENTATION_HPP
00009
00010 #include "coherence/lang.ns"
00011
00012 #include "coherence/io/pof/PofReader.hpp"
00013 #include "coherence/io/pof/PofWriter.hpp"
00014 #include "coherence/io/pof/PortableObject.hpp"
00015 #include "coherence/util/AbstractSet.hpp"
00016 #include "coherence/util/Converter.hpp"
00017 #include "coherence/util/Filter.hpp"
00018 #include "coherence/util/MapListener.hpp"
00019 #include "coherence/util/ObservableMap.hpp"
00020 #include "coherence/util/ValueExtractor.hpp"
00021
00022 COH_OPEN_NAMESPACE2(coherence,util)
00023
00024 using coherence::io::pof::PofReader;
00025 using coherence::io::pof::PofWriter;
00026 using coherence::io::pof::PortableObject;
00027 using coherence::util::AbstractSet;
00028 using coherence::util::MapListener;
00029 using coherence::util::ObservableMap;
00030 using coherence::util::ValueExtractor;
00031
00032
00033
00034
00035
00036
00037
00038
00039 class COH_EXPORT NullImplementation
00040 {
00041
00042
00043 public:
00044
00045
00046
00047 static ObjectArray::Handle getArray();
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 static Converter::Handle getConverter();
00058
00059
00060
00061
00062 static Iterator::Handle getIterator();
00063
00064
00065
00066
00067 static Muterator::Handle getMuterator();
00068
00069
00070
00071
00072 static Set::Handle getSet();
00073
00074
00075
00076
00077 static Collection::Handle getCollection();
00078
00079
00080
00081
00082 static Map::Handle getMap();
00083
00084
00085
00086
00087 static ObservableMap::Handle getObservableMap();
00088
00089
00090
00091
00092 static ValueExtractor::Handle getValueExtractor();
00093
00094
00095
00096
00097 public:
00098 class COH_EXPORT NullConverter
00099 : public class_spec<NullConverter,
00100 extends<Object>,
00101 implements<Converter> >
00102 {
00103 friend class factory<NullImplementation::NullConverter>;
00104
00105
00106
00107 protected:
00108
00109
00110
00111 NullConverter();
00112
00113
00114
00115
00116 public:
00117
00118
00119
00120 virtual Object::Holder convert(Object::Holder oh) const;
00121
00122 public:
00123 static Handle getInstance();
00124 };
00125
00126
00127
00128
00129 public:
00130 class COH_EXPORT NullMuterator
00131 : public class_spec<NullMuterator,
00132 extends<Object>,
00133 implements<Muterator> >
00134 {
00135 friend class factory<NullImplementation::NullMuterator>;
00136
00137
00138
00139 protected:
00140
00141
00142
00143 NullMuterator();
00144
00145
00146
00147
00148 public:
00149
00150
00151
00152 virtual bool hasNext() const;
00153
00154
00155
00156
00157 virtual Object::Holder next();
00158
00159
00160
00161
00162 virtual void remove();
00163
00164 public:
00165 static Handle getInstance();
00166 };
00167
00168
00169
00170 public:
00171 class COH_EXPORT NullSet
00172 : public cloneable_spec<NullSet,
00173 extends<AbstractSet>,
00174 implements<PortableObject> >
00175 {
00176 friend class factory<NullImplementation::NullSet>;
00177
00178
00179
00180 protected:
00181
00182
00183
00184 NullSet();
00185
00186
00187
00188
00189 NullSet(const NullSet& that);
00190
00191
00192
00193
00194 public:
00195
00196
00197
00198
00199 virtual bool contains(Object::View v) const;
00200
00201
00202
00203
00204 virtual Iterator::Handle iterator() const;
00205
00206
00207
00208
00209 virtual Muterator::Handle iterator();
00210
00211
00212
00213
00214 virtual ObjectArray::Handle toArray(
00215 ObjectArray::Handle hao = NULL) const;
00216
00217
00218
00219
00220 virtual bool add(Object::Holder oh);
00221
00222
00223
00224
00225 virtual bool remove(Object::View v);
00226
00227
00228
00229
00230 virtual bool containsAll(Collection::View vc) const;
00231
00232
00233
00234
00235 virtual bool addAll(Collection::View vc);
00236
00237
00238
00239
00240 virtual bool removeAll(Collection::View vc);
00241
00242
00243
00244
00245 virtual bool retainAll(Collection::View vc);
00246
00247
00248
00249
00250 virtual size32_t size() const;
00251
00252
00253
00254
00255 virtual bool isEmpty() const;
00256
00257
00258
00259
00260 virtual void clear();
00261
00262
00263
00264
00265 public:
00266
00267
00268
00269 virtual void readExternal(PofReader::Handle hIn);
00270
00271
00272
00273
00274 virtual void writeExternal(PofWriter::Handle hOut) const;
00275
00276
00277
00278
00279 public:
00280
00281
00282
00283 virtual bool equals(Object::View v) const;
00284
00285 public:
00286 static Handle getInstance();
00287 };
00288
00289
00290 public:
00291 class COH_EXPORT NullCollection
00292 : public cloneable_spec<NullCollection,
00293 extends<Object>,
00294 implements<Collection, PortableObject> >
00295 {
00296 friend class factory<NullImplementation::NullCollection>;
00297
00298
00299
00300 protected:
00301
00302
00303
00304 NullCollection();
00305
00306
00307
00308
00309 NullCollection(const NullCollection& that);
00310
00311
00312
00313
00314 public:
00315
00316
00317
00318 virtual bool contains(Object::View v) const;
00319
00320
00321
00322
00323 virtual Iterator::Handle iterator() const;
00324
00325
00326
00327
00328 virtual Muterator::Handle iterator();
00329
00330
00331
00332
00333 virtual ObjectArray::Handle toArray(
00334 ObjectArray::Handle hoa = NULL) const;
00335
00336
00337
00338
00339 virtual bool add(Object::Holder oh);
00340
00341
00342
00343
00344 virtual bool remove(Object::View v);
00345
00346
00347
00348
00349 virtual bool containsAll(Collection::View vc) const;
00350
00351
00352
00353
00354 virtual bool addAll(Collection::View vc);
00355
00356
00357
00358
00359 virtual bool removeAll(Collection::View vc);
00360
00361
00362
00363
00364 virtual bool retainAll(Collection::View vc);
00365
00366
00367
00368
00369 virtual size32_t size() const;
00370
00371
00372
00373
00374 virtual bool isEmpty() const;
00375
00376
00377
00378
00379 virtual void clear();
00380
00381
00382
00383
00384 public:
00385
00386
00387
00388 virtual void readExternal(PofReader::Handle hIn);
00389
00390
00391
00392
00393 virtual void writeExternal(PofWriter::Handle hOut) const;
00394
00395
00396
00397
00398 public:
00399
00400
00401
00402 virtual bool equals(Object::View v) const;
00403
00404 public:
00405 static Handle getInstance();
00406 };
00407
00408
00409
00410 public:
00411 class COH_EXPORT NullMap
00412 : public cloneable_spec<NullMap,
00413 extends<Object>,
00414 implements<Map, PortableObject> >
00415 {
00416 friend class factory<NullImplementation::NullMap>;
00417
00418
00419
00420 protected:
00421
00422
00423
00424 NullMap();
00425
00426
00427
00428
00429 NullMap(const NullMap& that);
00430
00431
00432
00433
00434 public:
00435
00436
00437
00438 virtual size32_t size() const;
00439
00440
00441
00442
00443 virtual bool isEmpty() const;
00444
00445
00446
00447
00448 virtual void clear();
00449
00450
00451
00452
00453 virtual bool containsKey(Object::View vKey) const;
00454
00455
00456
00457
00458 virtual bool containsValue(Object::View vValue) const;
00459
00460
00461
00462
00463 virtual Object::Holder get(Object::View vKey) const;
00464
00465
00466
00467
00468 virtual Object::Holder get(Object::View vKey);
00469
00470
00471
00472
00473 virtual Object::Holder put(Object::View vKey,
00474 Object::Holder ohValue);
00475
00476
00477
00478
00479 virtual Object::Holder remove(Object::View vKey);
00480 using Map::remove;
00481
00482
00483
00484
00485 virtual void putAll(Map::View vMap);
00486
00487
00488
00489
00490 virtual Set::View keySet() const;
00491
00492
00493
00494
00495 virtual Set::Handle keySet();
00496
00497
00498
00499
00500 virtual Collection::View values() const;
00501
00502
00503
00504
00505 virtual Collection::Handle values();
00506
00507
00508
00509
00510 virtual Set::View entrySet() const;
00511
00512
00513
00514
00515 virtual Set::Handle entrySet();
00516
00517
00518
00519
00520 public:
00521
00522
00523
00524 virtual void readExternal(PofReader::Handle hIn);
00525
00526
00527
00528
00529 virtual void writeExternal(PofWriter::Handle hOut) const;
00530
00531
00532
00533
00534 public:
00535
00536
00537
00538 virtual bool equals(Object::View v) const;
00539
00540 public:
00541 static Handle getInstance();
00542 };
00543
00544
00545
00546
00547 public:
00548 class COH_EXPORT NullObservableMap
00549 : public cloneable_spec<NullObservableMap,
00550 extends<NullMap>,
00551 implements<ObservableMap> >
00552 {
00553 friend class factory<NullImplementation::NullObservableMap>;
00554
00555
00556
00557 protected:
00558
00559
00560
00561 NullObservableMap();
00562
00563
00564
00565
00566 NullObservableMap(const NullObservableMap& that);
00567
00568
00569
00570
00571 public:
00572
00573
00574
00575 virtual void addKeyListener(MapListener::Handle hListener,
00576 Object::View vKey, bool fLite);
00577
00578
00579
00580
00581 virtual void removeKeyListener(MapListener::Handle hListener,
00582 Object::View vKey);
00583
00584
00585
00586
00587 virtual void addMapListener(MapListener::Handle hListener);
00588
00589
00590
00591
00592 virtual void removeMapListener(MapListener::Handle hListener);
00593
00594
00595
00596
00597 virtual void addFilterListener(MapListener::Handle hListener,
00598 Filter::View vFilter, bool fLite);
00599
00600
00601
00602
00603 virtual void removeFilterListener(MapListener::Handle hListener,
00604 Filter::View vFilter);
00605
00606 public:
00607 static Handle getInstance();
00608 };
00609
00610
00611
00612
00613 public:
00614 class COH_EXPORT NullValueExtractor
00615 : public class_spec<NullValueExtractor,
00616 extends<Object>,
00617 implements<ValueExtractor> >
00618 {
00619 friend class factory<NullImplementation::NullValueExtractor>;
00620
00621
00622
00623 protected:
00624
00625
00626
00627 NullValueExtractor();
00628
00629
00630
00631
00632 public:
00633
00634
00635
00636 virtual Object::Holder extract(Object::Holder ohTarget) const;
00637
00638
00639
00640
00641 public:
00642
00643
00644
00645 virtual bool equals(Object::View v) const;
00646
00647
00648
00649
00650 virtual size32_t hashCode() const;
00651
00652
00653
00654
00655 public:
00656
00657
00658
00659 virtual void readExternal(PofReader::Handle hIn);
00660
00661
00662
00663
00664 virtual void writeExternal(PofWriter::Handle hOut) const;
00665
00666 public:
00667 static Handle getInstance();
00668 };
00669 };
00670
00671 COH_CLOSE_NAMESPACE2
00672
00673 #endif