8 #ifndef INCLUDE_INFINISPAN_HOTROD_CACHECLIENTLISTENER_H_
9 #define INCLUDE_INFINISPAN_HOTROD_CACHECLIENTLISTENER_H_
19 using namespace infinispan::hotrod;
21 namespace infinispan {
27 template <
class K,
class V>
32 template <
class K,
class V>
40 createdCallbacks.push_back(callback);
43 expiredCallbacks.push_back(callback);
46 modifiedCallbacks.push_back(callback);
49 removedCallbacks.push_back(callback);
52 customCallbacks.push_back(callback);
57 K* key= (K*)cache.baseKeyUnmarshall(marshEv.getKey());
60 for (
auto callable: createdCallbacks)
68 K* key= (K*)cache.baseKeyUnmarshall(marshEv.getKey());
71 for (
auto callable: modifiedCallbacks)
79 K* key= (K*)cache.baseKeyUnmarshall(marshEv.getKey());
82 for (
auto callable: removedCallbacks)
90 K* key= (K*)cache.baseKeyUnmarshall(marshEv.getKey());
93 for (
auto callable: expiredCallbacks)
101 for (
auto callable: customCallbacks)
107 std::list<std::function<void(ClientCacheEntryCreatedEvent<K>)>> createdCallbacks;
108 std::list<std::function<void(ClientCacheEntryExpiredEvent<K>)>> expiredCallbacks;
109 std::list<std::function<void(ClientCacheEntryModifiedEvent<K>)>> modifiedCallbacks;
110 std::list<std::function<void(ClientCacheEntryRemovedEvent<K>)>> removedCallbacks;
111 std::list<std::function<void(ClientCacheEntryCustomEvent)>> customCallbacks;
Definition: ClientEvent.h:130
virtual void processEvent(ClientCacheEntryExpiredEvent< std::vector< char >> marshEv, std::vector< char >listId, uint8_t isCustom) const
Definition: CacheClientListener.h:88
virtual void processEvent(ClientCacheEntryRemovedEvent< std::vector< char >> marshEv, std::vector< char >listId, uint8_t isCustom) const
Definition: CacheClientListener.h:77
void add_listener(std::function< void(ClientCacheEntryRemovedEvent< K >)> callback)
Definition: CacheClientListener.h:48
Definition: ClientEvent.h:155
Definition: CacheClientListener.h:28
RemoteCacheBase & cache
Definition: CacheClientListener.h:36
void add_listener(std::function< void(ClientCacheEntryModifiedEvent< K >)> callback)
Definition: CacheClientListener.h:45
virtual void processEvent(ClientCacheEntryCreatedEvent< std::vector< char >> marshEv, std::vector< char >listId, uint8_t isCustom) const
Definition: CacheClientListener.h:55
Definition: ClientEvent.h:114
Definition: ClientEvent.h:76
virtual void processEvent(ClientCacheEntryModifiedEvent< std::vector< char >> marshEv, std::vector< char >listId, uint8_t isCustom) const
Definition: CacheClientListener.h:66
Definition: ClientListener.h:35
virtual void processEvent(ClientCacheEntryCustomEvent ev, std::vector< char >listId, uint8_t isCustom) const
Definition: CacheClientListener.h:99
Definition: CacheClientListener.h:33
void add_listener(std::function< void(ClientCacheEntryExpiredEvent< K >)> callback)
Definition: CacheClientListener.h:42
Definition: RemoteCacheBase.h:36
void add_listener(std::function< void(ClientCacheEntryCreatedEvent< K >)> callback)
Definition: CacheClientListener.h:39
void add_listener(std::function< void(ClientCacheEntryCustomEvent)> callback)
Definition: CacheClientListener.h:51
Definition: ClientEvent.h:38
CacheClientListener(RemoteCache< K, V > &cache)
Definition: CacheClientListener.h:38