GridGain C++
cache_entry_event_filter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 GridGain Systems, Inc. and Contributors.
3  *
4  * Licensed under the GridGain Community Edition License (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  * https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
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 
22 #ifndef _IGNITE_CACHE_EVENT_CACHE_ENTRY_EVENT_FILTER
23 #define _IGNITE_CACHE_EVENT_CACHE_ENTRY_EVENT_FILTER
24 
26 #include <ignite/impl/cache/event/cache_entry_event_filter_base.h>
27 
28 namespace ignite
29 {
30  class IgniteBinding;
31 
35  namespace impl
36  {
37  namespace cache
38  {
39  namespace event
40  {
41  template<typename T>
42  class CacheEntryEventFilterHolder;
43  }
44  }
45  }
50  namespace cache
51  {
52  namespace event
53  {
63  template<typename K, typename V>
64  class CacheEntryEventFilter : private impl::cache::event::CacheEntryEventFilterBase
65  {
66  template<typename T>
67  friend class impl::cache::event::CacheEntryEventFilterHolder;
68 
69  public:
74  {
75  // No-op.
76  }
77 
82  {
83  // No-op.
84  }
85 
92  virtual bool Process(const CacheEntryEvent<K, V>& event) = 0;
93 
94  private:
101  virtual bool ReadAndProcessEvent(binary::BinaryRawReader& reader)
102  {
103  CacheEntryEvent<K, V> event;
104 
105  event.Read(reader);
106 
107  return Process(event);
108  }
109  };
110  }
111  }
112 }
113 
114 #endif //_IGNITE_CACHE_EVENT_CACHE_ENTRY_EVENT_FILTER
ignite::binary::BinaryRawReader
Binary raw reader.
Definition: binary_raw_reader.h:56
ignite
Ignite API.
Definition: cache.h:47
cache_entry_event.h
ignite::cache::CacheEntryEvent
Cache entry event class template.
Definition: core/include/ignite/cache/event/cache_entry_event.h:74
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:81
ignite::cache::event::CacheEntryEventFilter
Cache entry event filter.
Definition: cache_entry_event_filter.h:64
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:170
ignite::cache::event::CacheEntryEventFilter::CacheEntryEventFilter
CacheEntryEventFilter()
Default constructor.
Definition: cache_entry_event_filter.h:73