VMware Tanzu GemFire Native C++ Reference 10.2.7
EntryEvent.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#ifndef GEODE_ENTRYEVENT_H_
21#define GEODE_ENTRYEVENT_H_
22
23#include <memory>
24
25#include "CacheableKey.hpp"
26#include "Region.hpp"
27#include "geode/Serializable.hpp"
28#include "internal/geode_globals.hpp"
29
33namespace apache {
34namespace geode {
35namespace client {
36
37class CacheableKey;
38class Region;
39class Serializable;
40
44class APACHE_GEODE_EXPORT EntryEvent {
45 protected:
46 std::shared_ptr<Region> m_region;
47 std::shared_ptr<CacheableKey> m_key;
48 std::shared_ptr<Cacheable> m_oldValue;
49 std::shared_ptr<Cacheable> m_newValue;
50 std::shared_ptr<Serializable>
54 public:
56 EntryEvent(const std::shared_ptr<Region>& region,
57 const std::shared_ptr<CacheableKey>& key,
58 const std::shared_ptr<Cacheable>& oldValue,
59 const std::shared_ptr<Cacheable>& newValue,
60 const std::shared_ptr<Serializable>& aCallbackArgument,
61 const bool remoteOrigin);
62
64 virtual ~EntryEvent();
65
68
70 inline std::shared_ptr<Region> getRegion() const { return m_region; }
71
73 inline std::shared_ptr<CacheableKey> getKey() const { return m_key; }
74
79 inline std::shared_ptr<Cacheable> getOldValue() const { return m_oldValue; }
80
85 inline std::shared_ptr<Cacheable> getNewValue() const { return m_newValue; }
86
92 inline std::shared_ptr<Serializable> getCallbackArgument() const {
93 return m_callbackArgument;
94 }
95
97 inline bool remoteOrigin() const { return m_remoteOrigin; }
98
99 private:
100 // never implemented.
101 EntryEvent(const EntryEvent& other);
102 void operator=(const EntryEvent& other);
103};
104} // namespace client
105} // namespace geode
106} // namespace apache
107
108#endif // GEODE_ENTRYEVENT_H_
Represents an entry event affecting an entry, including its identity and the the circumstances of the...
Definition: EntryEvent.hpp:44
EntryEvent(const std::shared_ptr< Region > &region, const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &oldValue, const std::shared_ptr< Cacheable > &newValue, const std::shared_ptr< Serializable > &aCallbackArgument, const bool remoteOrigin)
Constructor, given all values.
bool remoteOrigin() const
If the event originated in a remote process, returns true.
Definition: EntryEvent.hpp:97
bool m_remoteOrigin
True if from a remote (non-local) process.
Definition: EntryEvent.hpp:52
std::shared_ptr< Cacheable > getOldValue() const
If the prior state of the entry was invalid, or non-existent/destroyed, then the old value will be nu...
Definition: EntryEvent.hpp:79
std::shared_ptr< Cacheable > m_oldValue
Old value.
Definition: EntryEvent.hpp:48
std::shared_ptr< Serializable > getCallbackArgument() const
Returns the callbackArgument passed to the method that generated this event.
Definition: EntryEvent.hpp:92
std::shared_ptr< Cacheable > m_newValue
New value.
Definition: EntryEvent.hpp:49
virtual ~EntryEvent()
Destructor.
std::shared_ptr< CacheableKey > m_key
Cacheable key.
Definition: EntryEvent.hpp:47
std::shared_ptr< CacheableKey > getKey() const
Definition: EntryEvent.hpp:73
std::shared_ptr< Region > getRegion() const
Definition: EntryEvent.hpp:70
std::shared_ptr< Serializable > m_callbackArgument
Callback argument for this event, if any.
Definition: EntryEvent.hpp:51
std::shared_ptr< Cacheable > getNewValue() const
If the event is a destroy or invalidate operation, then the new value will be nullptr.
Definition: EntryEvent.hpp:85
std::shared_ptr< Region > m_region
Region.
Definition: EntryEvent.hpp:46

Apache Geode C++ Cache API Documentation