Infinispan HotRod C++ Client  9.1.0.Final
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 #include <string>
12 
13 namespace infinispan {
14 namespace hotrod {
15 namespace event {
16 
30 };
31 
32 class CounterEvent {
33 public:
34  CounterEvent(std::string counterName, const long oldValue, const CounterState oldState, const long newValue,
35  const CounterState newState) :
37  }
38 
42  const std::string counterName;
46  const long oldValue;
47 
52 
56  const long newValue;
57 
62 };
63 
65 public:
66  CounterListener(const std::string counterName, std::function<void(const CounterEvent)> action) :
67  counterName(counterName), action(action) {
68  }
69  CounterListener(const std::string counterName) :
70  counterName(counterName) {
71  }
72  virtual void onUpdate(const CounterEvent entry) const {
73  action(entry);
74  }
75  virtual ~CounterListener() {}
76 private:
77  const std::string counterName;
78  const std::function<void(const CounterEvent)> action;
79 };
80 
81 }
82 }
83 }
84 #endif /* INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_ */
Definition: CounterEvent.h:64
virtual void onUpdate(const CounterEvent entry) const
Definition: CounterEvent.h:72
CounterState
Definition: CounterEvent.h:17
const std::string counterName
Definition: CounterEvent.h:42
Definition: CounterEvent.h:32
const long oldValue
Definition: CounterEvent.h:46
CounterListener(const std::string counterName, std::function< void(const CounterEvent)> action)
Definition: CounterEvent.h:66
const long newValue
Definition: CounterEvent.h:56
Definition: AuthenticationConfiguration.h:10
Definition: CounterEvent.h:21
CounterListener(const std::string counterName)
Definition: CounterEvent.h:69
virtual ~CounterListener()
Definition: CounterEvent.h:75
const CounterState oldState
Definition: CounterEvent.h:51
const CounterState newState
Definition: CounterEvent.h:61
CounterEvent(std::string counterName, const long oldValue, const CounterState oldState, const long newValue, const CounterState newState)
Definition: CounterEvent.h:34