Infinispan HotRod C++ Client  8.3.1.Final
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CounterEvent.h
Go to the documentation of this file.
1 /*
2  * CounterEvent.h
3  *
4  * Created on: May 9, 2018
5  * Author: rigazilla
6  */
7 
8 #ifndef INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_
9 #define INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_
10 
11 namespace infinispan {
12 namespace hotrod {
13 namespace event {
14 
28 };
29 
30 class CounterEvent {
31 public:
32  CounterEvent(std::string counterName, const long oldValue, const CounterState oldState, const long newValue,
33  const CounterState newState) :
34  counterName(counterName), oldValue(oldValue), oldState(oldState), newValue(newValue), newState(newState) {
35  }
36 
40  const std::string counterName;
44  const long oldValue;
45 
50 
54  const long newValue;
55 
60 };
61 
63 public:
64  CounterListener(const std::string counterName, std::function<void(const CounterEvent)> action) :
65  counterName(counterName), action(action) {
66  }
67  CounterListener(const std::string counterName) :
68  counterName(counterName) {
69  }
70  virtual void onUpdate(const CounterEvent entry) const {
71  action(entry);
72  }
73  virtual ~CounterListener() {}
74 private:
75  const std::string counterName;
76  const std::function<void(const CounterEvent)> action;
77 };
78 
79 }
80 }
81 }
82 #endif /* INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_ */
Definition: CounterEvent.h:62
CounterState
Definition: CounterEvent.h:15
const std::string counterName
Definition: CounterEvent.h:40
Definition: CounterEvent.h:30
const long oldValue
Definition: CounterEvent.h:44
CounterListener(const std::string counterName, std::function< void(const CounterEvent)> action)
Definition: CounterEvent.h:64
const long newValue
Definition: CounterEvent.h:54
Definition: CounterEvent.h:19
CounterListener(const std::string counterName)
Definition: CounterEvent.h:67
virtual void onUpdate(const CounterEvent entry) const
Definition: CounterEvent.h:70
virtual ~CounterListener()
Definition: CounterEvent.h:73
const CounterState oldState
Definition: CounterEvent.h:49
const CounterState newState
Definition: CounterEvent.h:59
CounterEvent(std::string counterName, const long oldValue, const CounterState oldState, const long newValue, const CounterState newState)
Definition: CounterEvent.h:32