Hazelcast C++ Client
Hazelcast C++ Client Library
entry_event.h
1 /*
2  * Copyright (c) 2008-2022, 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 {
41 public:
42  enum struct type
43  {
44  ADDED = 1,
45  REMOVED = 1 << 1,
46  UPDATED = 1 << 2,
47  EVICTED = 1 << 3,
48  EXPIRED = 1 << 4,
49  EVICT_ALL = 1 << 5,
50  CLEAR_ALL = 1 << 6,
51  MERGED = 1 << 7,
52  INVALIDATION = 1 << 8,
53  LOADED = 1 << 9,
54  ALL = 0xFF
55  };
56 
57  entry_event(const std::string& name,
58  member&& member,
59  type event_type,
60  typed_data&& key,
61  typed_data&& value,
62  typed_data&& old_value,
63  typed_data&& merging_value);
64 
71  const typed_data& get_key() const;
72 
78  const typed_data& get_old_value() const;
79 
86  const typed_data& get_value() const;
87 
94  const typed_data& get_merging_value() const;
95 
101  const member& get_member() const;
102 
108  type get_event_type() const;
109 
115  const std::string& get_name() const;
116 
117  friend std::ostream HAZELCAST_API& operator<<(std::ostream& os,
118  const entry_event& event);
119 
120 protected:
121  std::string name_;
122  member member_;
123  type event_type_;
124  typed_data key_;
125  typed_data value_;
126  typed_data old_value_;
127  typed_data merging_value_;
128 };
129 } // namespace client
130 } // namespace hazelcast
131 
132 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
133 #pragma warning(pop)
134 #endif
hz_cluster member class.
Definition: member.h:62
typed_data class is a wrapper class for the serialized binary data.