| Apache Ignite C++

cache_entry_event_filter.h
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
23 #ifndef _IGNITE_CACHE_EVENT_CACHE_ENTRY_EVENT_FILTER
24 #define _IGNITE_CACHE_EVENT_CACHE_ENTRY_EVENT_FILTER
25
26 #include <ignite/cache/event/cache_entry_event.h>
27 #include <ignite/impl/cache/event/cache_entry_event_filter_base.h>
28
29 namespace ignite
30 {
31 class IgniteBinding;
32
33 namespace impl
34 {
35 namespace cache
36 {
37 namespace event
38 {
39 template<typename T>
40 class CacheEntryEventFilterHolder;
41 }
42 }
43 }
44
45 namespace cache
46 {
47 namespace event
48 {
58 template<typename K, typename V>
59 class CacheEntryEventFilter : private impl::cache::event::CacheEntryEventFilterBase
60 {
61 template<typename T>
62 friend class impl::cache::event::CacheEntryEventFilterHolder;
63
64 public:
68 CacheEntryEventFilter()
69 {
70 // No-op.
71 }
72
76 virtual ~CacheEntryEventFilter()
77 {
78 // No-op.
79 }
80
87 virtual bool Process(const CacheEntryEvent<K, V>& event) = 0;
88
89 private:
96 virtual bool ReadAndProcessEvent(binary::BinaryRawReader& reader)
97 {
98 CacheEntryEvent<K, V> event;
99
100 event.Read(reader);
101
102 return Process(event);
103 }
104 };
105 }
106 }
107 }
108
109 #endif //_IGNITE_CACHE_EVENT_CACHE_ENTRY_EVENT_FILTER
ignite::binary::BinaryRawReader
Binary raw reader.
Definition: binary_raw_reader.h:57
ignite
Apache Ignite API.
Definition: cache.h:48
cache_entry_event.h
ignite::cache::CacheEntryEvent
Cache entry event class template.
Definition: core/include/ignite/cache/event/cache_entry_event.h:79
ignite::cache::event::CacheEntryEventFilter::Process
virtual bool Process(const CacheEntryEvent< K, V > &event)=0
Event callback.
ignite::cache::event::CacheEntryEventFilter::~CacheEntryEventFilter
virtual ~CacheEntryEventFilter()
Destructor.
Definition: cache_entry_event_filter.h:76
ignite::cache::event::CacheEntryEventFilter
Cache entry event filter.
Definition: cache_entry_event_filter.h:59
ignite::cache::CacheEntryEvent::Read
void Read(binary::BinaryRawReader &reader)
Reads cache event using provided raw reader.
Definition: core/include/ignite/cache/event/cache_entry_event.h:175
ignite::impl::cache::event::CacheEntryEventFilterHolder
Definition: cache_entry_event_filter.h:40
ignite::cache::event::CacheEntryEventFilter::CacheEntryEventFilter
CacheEntryEventFilter()
Default constructor.
Definition: cache_entry_event_filter.h:68