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) {
158 return oldValue.get();
224 return mergingValue.get();
248 return *mergingValue;
278 std::ostream &operator<< (std::ostream &out)
const {
279 out <<
"EntryEvent{entryEventType=" << eventType.
value << eventType <<
280 ", member=" << member <<
", name='" << name <<
"', key=" << *key;
282 out <<
", value=" << *value;
284 if (oldValue.get()) {
285 out <<
", oldValue=" << *oldValue;
287 if (mergingValue.get()) {
288 out <<
", mergingValue=" << *mergingValue;
295 EntryEventType eventType;
296 std::auto_ptr<K> key;
297 std::auto_ptr<V> value;
298 std::auto_ptr<V> oldValue;
299 std::auto_ptr<V> mergingValue;
303 namespace mixedtype {
313 , eventType(eventType)
326 , eventType(eventType)
330 , mergingValue(new
TypedData(mergingValue)) {
350 return oldValue.
get();
369 return mergingValue.
get();
399 std::ostream &operator<< (std::ostream &out)
const {
400 out <<
"EntryEvent{entryEventType=" << eventType.value << eventType <<
401 ", member=" << member <<
", name='" << name;
410 std::auto_ptr<TypedData> oldValue;
411 std::auto_ptr<TypedData> mergingValue;
418 template <
typename K,
typename V>
419 std::ostream &operator<<(std::ostream &out, const hazelcast::client::EntryEvent<K, V> &event) {
420 event.operator<<(out);
424 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
428 #endif //__EntryEvent_H_
const V * getOldValueObject() const
Returns the old value of the entry event.
Definition: EntryEvent.h:157
const Member & getMember() const
Returns the member fired this event.
Definition: EntryEvent.h:256
std::auto_ptr< T > get() const
Deserializes the underlying binary data and produces the object of type T.
Definition: TypedData.h:69
const V * getValueObject() const
Returns the value of the entry event.
Definition: EntryEvent.h:190
const std::string & getName() const
Returns the name of the map for this event.
Definition: EntryEvent.h:274
MixedEntryEvent(const std::string &name, const Member &member, EntryEventType eventType, TypedData key, TypedData value, TypedData oldValue, TypedData mergingValue)
Constructor.
Definition: EntryEvent.h:321
const K & getKey() const
Definition: EntryEvent.h:148
const TypedData & getKey() const
Returns the key of the entry event.
Definition: EntryEvent.h:339
std::auto_ptr< V > releaseOldValue()
Releases the old value of the entry event.
Definition: EntryEvent.h:169
const K * getKeyObject() const
Returns the key of the entry event.
Definition: EntryEvent.h:125
const TypedData * getOldValue() const
Returns the old value of the entry event.
Definition: EntryEvent.h:349
const V & getMergingValue() const
Definition: EntryEvent.h:247
const V & getOldValue() const
Definition: EntryEvent.h:181
const std::string & getName() const
Returns the name of the map for this event.
Definition: EntryEvent.h:395
std::auto_ptr< K > releaseKey()
Releases the key of the entry event.
Definition: EntryEvent.h:136
Type
Type enum.
Definition: EntryEvent.h:42
const TypedData & getValue() const
Returns the value of the entry event.
Definition: EntryEvent.h:359
const V * getMergingValueObject() const
Returns the incoming merging value of the entry event.
Definition: EntryEvent.h:223
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
EntryEventType getEventType() const
Return the event type.
Definition: EntryEvent.h:265
EntryEventType getEventType() const
Return the event type.
Definition: EntryEvent.h:386
Definition: EntryEvent.h:304
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 Member & getMember() const
Returns the member fired this event.
Definition: EntryEvent.h:377
Cluster member class.
Definition: Member.h:44
MixedEntryEvent(const std::string &name, const Member &member, EntryEventType eventType, TypedData key, TypedData value)
Constructor.
Definition: EntryEvent.h:309
std::auto_ptr< V > releaseMergingValue() const
Releases the mergingValue of the entry event.
Definition: EntryEvent.h:235
Map Entry event.
Definition: EntryEvent.h:90
Definition: MapEntryView.h:32
Type value
Type value.
Definition: EntryEvent.h:58
Type of entry event.
Definition: EntryEvent.h:37
const TypedData * getMergingValue() const
Returns the incoming merging value of the entry event.
Definition: EntryEvent.h:368
const V & getValue() const
Definition: EntryEvent.h:214
std::auto_ptr< V > releaseValue()
Releases the value of the entry event.
Definition: EntryEvent.h:202
TypedData class is a wrapper class for the serialized binary data.
Definition: TypedData.h:40