00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_DELTA_SET_HPP
00017 #define COH_DELTA_SET_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/util/AbstractSet.hpp"
00022 #include "coherence/util/Set.hpp"
00023
00024 COH_OPEN_NAMESPACE2(coherence,util)
00025
00026
00027
00028
00029
00030
00031
00032
00033 class COH_EXPORT DeltaSet
00034 : public class_spec<DeltaSet,
00035 extends<AbstractSet> >
00036 {
00037 friend class factory<DeltaSet>;
00038
00039
00040
00041 public:
00042
00043
00044
00045 DeltaSet(Set::Holder hSet);
00046
00047
00048
00049
00050 public:
00051
00052
00053
00054
00055
00056 virtual Set::View getOriginal() const;
00057
00058
00059
00060
00061
00062
00063 virtual bool isModified() const;
00064
00065
00066
00067
00068
00069
00070 virtual Set::View getAdded() const;
00071
00072
00073
00074
00075
00076
00077 virtual Set::View getRemoved() const;
00078
00079
00080
00081
00082
00083
00084 virtual Set::Handle ensureAdded();
00085
00086
00087
00088
00089
00090
00091 virtual Set::Handle ensureRemoved();
00092
00093
00094
00095
00096 virtual void resolve();
00097
00098
00099
00100
00101 virtual void reset();
00102
00103
00104
00105
00106 public:
00107
00108
00109
00110 virtual size32_t size() const;
00111
00112
00113
00114
00115 virtual bool contains(Object::View v) const;
00116
00117
00118
00119
00120 virtual Iterator::Handle iterator() const;
00121
00122
00123
00124
00125 virtual Muterator::Handle iterator();
00126
00127
00128
00129
00130 virtual ObjectArray::Handle toArray(ObjectArray::Handle hao = NULL) const;
00131
00132
00133
00134
00135 virtual bool add(Object::Holder oh);
00136
00137
00138
00139
00140 virtual bool remove(Object::View v);
00141
00142
00143
00144
00145 virtual void clear();
00146
00147
00148
00149
00150 protected:
00151
00152
00153
00154 FinalHolder<Set> m_ohSetOrig;
00155
00156
00157
00158
00159 MemberHandle<Set> m_hSetAdded;
00160
00161
00162
00163
00164 MemberHandle<Set> m_hSetRemoved;
00165 };
00166
00167 COH_CLOSE_NAMESPACE2
00168
00169 #endif // COH_DELTA_SET_HPP