Hazelcast C++ Client
Hazelcast C++ Client Library
entry_event.h
1 /*
2  * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <memory>
19 #include <ostream>
20 #include "hazelcast/client/member.h"
21 #include "hazelcast/client/serialization/serialization.h"
22 
23 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
24 #pragma warning(push)
25 #pragma warning(disable: 4251) //for dll export
26 #endif
27 
28 namespace hazelcast {
29  namespace client {
30 
39  class HAZELCAST_API entry_event {
40  public:
41  enum struct type {
42  ADDED = 1,
43  REMOVED = 1 << 1,
44  UPDATED = 1 << 2,
45  EVICTED = 1 << 3 ,
46  EXPIRED = 1 << 4,
47  EVICT_ALL = 1 << 5 ,
48  CLEAR_ALL = 1 << 6 ,
49  MERGED = 1 << 7 ,
50  INVALIDATION = 1 << 8,
51  LOADED = 1 << 9,
52  ALL = 0xFF
53  };
54 
55  entry_event(const std::string &name, member &&member, type event_type,
56  typed_data &&key, typed_data &&value, typed_data &&old_value, typed_data &&merging_value);
57 
64  const typed_data &get_key() const;
65 
71  const typed_data &get_old_value() const;
72 
79  const typed_data &get_value() const;
80 
87  const typed_data &get_merging_value() const;
88 
94  const member &get_member() const;
95 
101  type get_event_type() const;
102 
108  const std::string &get_name() const;
109 
110  friend std::ostream HAZELCAST_API &operator<<(std::ostream &os, const entry_event &event);
111 
112  protected:
113  std::string name_;
114  member member_;
115  type event_type_;
116  typed_data key_;
117  typed_data value_;
118  typed_data old_value_;
119  typed_data merging_value_;
120  };
121  }
122 }
123 
124 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
125 #pragma warning(pop)
126 #endif
127 
128 
hz_cluster member class.
Definition: member.h:39
typed_data class is a wrapper class for the serialized binary data.