20 #ifndef HAZELCAST_ENTRY_EVENT 21 #define HAZELCAST_ENTRY_EVENT 24 #include "hazelcast/client/Member.h" 25 #include "hazelcast/client/TypedData.h" 27 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 29 #pragma warning(disable: 4251) //for dll export 52 INVALIDATION = 1 << 8,
78 void operator = (
int i);
89 template <
typename K,
typename V>
96 std::auto_ptr<K> key, std::auto_ptr<V> value)
99 , eventType(eventType)
108 std::auto_ptr<K> key, std::auto_ptr<V> value,
109 std::auto_ptr<V> oldValue, std::auto_ptr<V> mergingValue)
112 , eventType(eventType)
116 , mergingValue(mergingValue) {
122 , eventType(eventType) {
166 return oldValue.get();
232 return mergingValue.get();
286 std::ostream &operator<< (std::ostream &out)
const {
287 out <<
"EntryEvent{entryEventType=" << eventType <<
288 ", member=" << member <<
", name='" << name <<
"', key=" << *key;
290 out <<
", value=" << *value;
292 if (oldValue.get()) {
293 out <<
", oldValue=" << *oldValue;
295 if (mergingValue.get()) {
296 out <<
", mergingValue=" << *mergingValue;
303 EntryEventType eventType;
304 std::auto_ptr<K> key;
305 std::auto_ptr<V> value;
306 std::auto_ptr<V> oldValue;
307 std::auto_ptr<V> mergingValue;
311 namespace mixedtype {
321 , eventType(eventType)
334 , eventType(eventType)
338 , mergingValue(new
TypedData(mergingValue)) {
358 return oldValue.
get();
377 return mergingValue.
get();
407 std::ostream &operator<< (std::ostream &out)
const {
408 out <<
"EntryEvent{entryEventType=" << eventType.value << eventType <<
409 ", member=" << member <<
", name='" << name;
418 std::auto_ptr<TypedData> oldValue;
419 std::auto_ptr<TypedData> mergingValue;
426 template <
typename K,
typename V>
427 std::ostream &operator<<(std::ostream &out, const hazelcast::client::EntryEvent<K, V> &event) {
428 event.operator<<(out);
432 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 436 #endif //__EntryEvent_H_ EntryEventType getEventType() const
Return the event type.
Definition: EntryEvent.h:394
MixedEntryEvent(const std::string &name, const Member &member, EntryEventType eventType, TypedData key, TypedData value, TypedData oldValue, TypedData mergingValue)
Constructor.
Definition: EntryEvent.h:329
const Member & getMember() const
Returns the member fired this event.
Definition: EntryEvent.h:385
std::auto_ptr< V > releaseOldValue()
Releases the old value of the entry event.
Definition: EntryEvent.h:177
const V & getValue() const
Definition: EntryEvent.h:222
virtual const K * getKeyObject() const
Returns the key of the entry event.
Definition: EntryEvent.h:133
std::auto_ptr< V > releaseMergingValue() const
Releases the mergingValue of the entry event.
Definition: EntryEvent.h:243
const V & getMergingValue() const
Definition: EntryEvent.h:255
const std::string & getName() const
Returns the name of the map for this event.
Definition: EntryEvent.h:403
const TypedData & getKey() const
Returns the key of the entry event.
Definition: EntryEvent.h:347
std::auto_ptr< K > releaseKey()
Releases the key of the entry event.
Definition: EntryEvent.h:144
Type
Type enum.
Definition: EntryEvent.h:42
const TypedData * getMergingValue() const
Returns the incoming merging value of the entry event.
Definition: EntryEvent.h:376
const V & getOldValue() const
Definition: EntryEvent.h:189
EntryEvent(const std::string &name, const Member &member, EntryEventType eventType, std::auto_ptr< K > key, std::auto_ptr< V > value, std::auto_ptr< V > oldValue, std::auto_ptr< V > mergingValue)
Constructor.
Definition: EntryEvent.h:107
const std::string & getName() const
Returns the name of the map for this event.
Definition: EntryEvent.h:282
const TypedData & getValue() const
Returns the value of the entry event.
Definition: EntryEvent.h:367
Definition: EntryEvent.h:312
const Member & getMember() const
Returns the member fired this event.
Definition: EntryEvent.h:264
EntryEvent(const std::string &name, const Member &member, EntryEventType eventType, std::auto_ptr< K > key, std::auto_ptr< V > value)
Constructor.
Definition: EntryEvent.h:95
const TypedData * getOldValue() const
Returns the old value of the entry event.
Definition: EntryEvent.h:357
Cluster member class.
Definition: Member.h:43
MixedEntryEvent(const std::string &name, const Member &member, EntryEventType eventType, TypedData key, TypedData value)
Constructor.
Definition: EntryEvent.h:317
virtual const V * getMergingValueObject() const
Returns the incoming merging value of the entry event.
Definition: EntryEvent.h:231
Map Entry event.
Definition: EntryEvent.h:90
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
Type value
Type value.
Definition: EntryEvent.h:58
virtual const V * getValueObject() const
Returns the value of the entry event.
Definition: EntryEvent.h:198
Type of entry event.
Definition: EntryEvent.h:37
std::auto_ptr< V > releaseValue()
Releases the value of the entry event.
Definition: EntryEvent.h:210
EntryEventType getEventType() const
Return the event type.
Definition: EntryEvent.h:273
TypedData class is a wrapper class for the serialized binary data.
Definition: TypedData.h:40
const K & getKey() const
Definition: EntryEvent.h:156
std::auto_ptr< T > get() const
Deserializes the underlying binary data and produces the object of type T.
Definition: TypedData.h:68
virtual const V * getOldValueObject() const
Returns the old value of the entry event.
Definition: EntryEvent.h:165