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